multiuser: postpone user cleanup to systemready

User cleanup was too early and causing exceptions during boot.

Bug: 20826665
Change-Id: Idace66d41cefaff1d80f490c161f8868e91d36d9
This commit is contained in:
Xiaohui Chen
2015-05-06 09:55:43 -07:00
parent afa81ed0b1
commit 4be96e4e47

View File

@@ -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<UserInfo> partials = new ArrayList<UserInfo>();
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));