Loading
Don't exempt MainUser in startUserInBackgroundTemp
startUserInBackgroundTemporarily() uses the same infrastructure as config_backgroundUserScheduledStopTimeSecs. However, for the latter we want to exempt the MainUser from being automatically stopped, whereas we have no such desire for the former (since it is being stopped by request, rather than just due to inactivity). We therefore slightly separate the two, having the MainUser exemption only apply to the latter. For simplicity, we also make it so that requested duration in startUserInBackgroundTemporarily() replaces that of config_backgroundUserScheduledStopTimeSecs when this method is called. We previously took the smallest value between them, but that seems overly complicated now. It isn't even clear what the best policy is, so we may as well adopt the simpler one for now. Bug: 401340391 Bug: 330351042 Test: UserControllerTest Flag: android.multiuser.schedule_stop_of_background_user Change-Id: I0f7b2fdd2a13219e2c392276929f427a3dca8a0f