Allow FGS start within a grace period after its activity going to BG

If a visibile activity switches to background, within a certain
amount of time, the app would still be eligible to start FGS from BG.

Bug: 182796375
Test: atest CtsAppTestCases:ActivityManagerFgsBgStartTest
Change-Id: I9b09ac27456d29a9122d299af47f1478d8e2c9e2
5 files changed