Reschedule bg stop if user has visible activities
If the user is currently displaying a visible activity (e.g. because it
is running an app with the FLAG_SHOW_FOR_ALL_USERS flag), we should not
automatically stop the user (in stopExcessRunningUsers or
processScheduledStopOfBackgroundUser); instead, we reschedule the stop
for later.
Test: atest FrameworksServicesTests:com.android.server.am.UserControllerTest#testScheduleStopOfBackgroundUser_rescheduleIfVisibleActivity
Fixes: 423731424
Flag: android.multiuser.reschedule_stop_if_visible_activities
Change-Id: Ia2a18646d0898f8b1075106d4017620ec1fe8364
3 files changed