Skip to content
Commit 0d9a81ce authored by Christopher Tate's avatar Christopher Tate
Browse files

Services exit fg when bg-restricted app leaves top

Apps under bg restrictions can still start foreground services while
they are the top/frontmost UI.  However, this was not being reexamined
when the app was no longer the top UI.  This is now fixed:  when an app
under bg restrictions exits the top state, any foreground services it is
hosting are demoted out of the foreground state.  At this point the
service lifecycle is just like any other ordinary service that an app
has left running after it is no longer the active UI:  the service is
stopped by the OS after the standard grace period.

Bug: 139436349
Test: repro app supplied with the bug
Test: foreground use of GPM under bg restrictions
Test: atest CtsAppTestCases:android.app.cts.ActivityManagerProcessStateTest\#testBgRestrictedForegroundService
Change-Id: I6d0e954c961f7c547c1f5d98e3926586f3071bca
Merged-In: I6d0e954c961f7c547c1f5d98e3926586f3071bca
parent 18bece7b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment