Update reset logic for time limited foreground services.

- When the app is force-stopped, reset its limits to handle cases
  where the user force stops an app when it continously crashes.

- When the app is currently in the TOP state (or better), also
  reset its limits even if the time limit has been exhausted
  since this could be a user requested FGS start.

Bug: 330399444
Test: atest CtsFgsTimeoutTestCases
Change-Id: I80687713591cf146b70f196a4ffaeb0f3c26a1e5
2 files changed