Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91293794 authored by Paul Crowley's avatar Paul Crowley
Browse files

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
parent 91628f6c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2189,7 +2189,13 @@ public class UserManagerService extends IUserManager.Stub {
    }

    private void removeUserState(final int 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);