Skip to content
Commit aed1e2ec authored by Jing Ji's avatar Jing Ji
Browse files

Kill bg restricted app when it's been cached & idle for a while

Previous CL 6cf25139 would kill it as long as: in bg restricted
mode, cached and UID idle. However it may thrash the system because
apps could be brought back to life in background but non-cached state,
and UID remains idle - so once it drops into cached it'll be killed,
while it may have to be brought back again soon.

Now to avoid from thrashing the system, it'll only be killed when
it's in bg restricted mode, UID idle, and it's been in cached
state for a while (default to 60s).

Also it'll only honor the individual app's bg restricted mode,
the battery saver case is ignored.

Bug: 192082833
Test: atest FrameworksServicesTests:ActivityManagerTest
Test: atest FrameworksMockingServicesTests:AppStateTrackerTest
Test: atest CtsAppTestCases:ActivityManagerFgsBgStartTest
Test: Manual - see b/192082833#comment8
Change-Id: I14d15edac8267c899750834353a886034515ef7e
parent 1461e1b1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment