Re-start background user when starting garage mode
- This allows running JobScheduler jobs for background user.
- When garage mode ends, those users are stopped again.
- When user is never unlocked after power cycle, garage mode for that
user will not run. There is no way to auto unlock them.
- This depends on UserController side change to keep data unlocked while
stopping background user.
- stopUser should happen with some delay to prevent stressing system server too much.
For now, stop each user with 10 secs interval.
- As a reference config, set config_multiuserMaxRunningUsers into 3. For automotive, background user
other than user 0 will be always stopped. This only affects how many users can run while in garage mode.
After garage mode is done, all background users are stopped again.
Bug: 128038498
Test: garage mode entry / exit and check if jobs for background users run. Also check if
all background users are stopped after garage mode is stopped.
$ adb shell dumpsys car_service garage-mode on
$ adb shell dumpsys car_service garage-mode off
Change-Id: Id179030d870285fd00e8831b71632e7f7a300de1
3 files changed