From 4be96e4e47d249d07d3e7dae5578e87aef90bd07 Mon Sep 17 00:00:00 2001 From: Xiaohui Chen Date: Wed, 6 May 2015 09:55:43 -0700 Subject: multiuser: postpone user cleanup to systemready User cleanup was too early and causing exceptions during boot. Bug: 20826665 Change-Id: Idace66d41cefaff1d80f490c161f8868e91d36d9 --- .../core/java/com/android/server/pm/UserManagerService.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'services/core/java') diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java index e79a206..e6f5e3d 100644 --- a/services/core/java/com/android/server/pm/UserManagerService.java +++ b/services/core/java/com/android/server/pm/UserManagerService.java @@ -234,6 +234,14 @@ public class UserManagerService extends IUserManager.Stub { mUserListFile = new File(mUsersDir, USER_LIST_FILENAME); initDefaultGuestRestrictions(); readUserListLocked(); + sInstance = this; + } + } + } + + void systemReady() { + synchronized (mInstallLock) { + synchronized (mPackagesLock) { // Prune out any partially created/partially removed users. ArrayList partials = new ArrayList(); for (int i = 0; i < mUsers.size(); i++) { @@ -248,12 +256,8 @@ public class UserManagerService extends IUserManager.Stub { + " (name=" + ui.name + ")"); removeUserStateLocked(ui.id); } - sInstance = this; } } - } - - void systemReady() { userForeground(UserHandle.USER_OWNER); mAppOpsService = IAppOpsService.Stub.asInterface( ServiceManager.getService(Context.APP_OPS_SERVICE)); -- cgit v1.1