Purge Nonexistent User Jobs on Boot

In the case that a user has been removed but their jobs still exist on
disk, the JobSchedulerService will remove all jobs not associated with
current users on boot.
Exposed UserManagerService#getUserIds() via UserManagerInternal for
quick user id retrieval.

Fixes: 38261977
Test: manual

Change-Id: Id4b3c0a4142b4818fcd875eef18ea03f3c45ca40
Signed-off-by: Michael Wachenschwanz <mwachens@google.com>
This commit is contained in:
Michael Wachenschwanz
2017-05-15 13:53:09 -07:00
parent 7e08c7ec17
commit 3f2b6552ec
4 changed files with 43 additions and 0 deletions

View File

@@ -167,4 +167,12 @@ public abstract class UserManagerInternal {
* Remove user's running state
*/
public abstract void removeUserState(int userId);
/**
* Returns an array of user ids. This array is cached in UserManagerService and passed as a
* reference, so do not modify the returned array.
*
* @return the array of user ids.
*/
public abstract int[] getUserIds();
}