BG-FGS while-in-use restriction uses the same grace period mechanism as BG-Activity-Launch.

WindowProcessController.areBackgroundActivityStartsAllowed() has the 10 seconds grace period,
starts from last activity's launch time or finish time.

Expose this method for AMS to call, to determine if BG-FGS while-in-use permission is allowed.

Bug: 182400165
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java
Merged-In: I30706dc1950bf5d49926a8e26c0493d9e168eb1b
Change-Id: I3615d0a2dc3464b6e980237b906c83872c3b4bce
2 files changed