Continue to remove users when destroyUserKey fails.
destroyUserKey can fail if the user is partially created; even when something fails it still destroys all it can. Its failure shouldn't halt user removal. Bug: 26847403 Change-Id: Iab1f551d19fd777198387b463b270c2508d07fd5
This commit is contained in:
@@ -2189,7 +2189,13 @@ public class UserManagerService extends IUserManager.Stub {
|
||||
}
|
||||
|
||||
private void removeUserState(final int userHandle) {
|
||||
mContext.getSystemService(StorageManager.class).destroyUserKey(userHandle);
|
||||
try {
|
||||
mContext.getSystemService(StorageManager.class).destroyUserKey(userHandle);
|
||||
} catch (IllegalStateException e) {
|
||||
// This may be simply because the user was partially created.
|
||||
Slog.i(LOG_TAG,
|
||||
"Destroying key for user " + userHandle + " failed, continuing anyway", e);
|
||||
}
|
||||
// Cleanup package manager settings
|
||||
mPm.cleanUpUser(this, userHandle);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user