Add multiuserDelayUserDataLocking configuration
- In this mode, when user switching happens, old user (=background user) is
always stopped but the user's data is kept unlocked.
- Locking of user data is postponed until mMaxRunningUsers is reached.
So this change does not leave more users unlocked while all background users
, other than user 0, are stopped.
- For users in stopped state with data unlocked, user can be re-started
in background for usage like running JobScheduler jobs.
- Exceptions to this configuration of stopping / locking background users are:
User 0 is never stopped / locked.
Ephemeral user is always stopped / locked.
User with DISALLOW_RUN_IN_BACKGROUND flag will be always stopped / locked.
- Added tests for this mode vs normal mode.
Bug:
128038498
Test: Do user switch and check user locking / stopping through log.
Change-Id: I554d0744adad172f361e9f00f609e2f91100b9e4