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

Commit 236b2b5d authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix crashes when removing work profile

This isn't specific to work profile. When multiple user
deletions happen in sequence, a race causes a dying user
to lose permissions prematurely. This fix delays removal of
user state until the user is completely cleaned up and all the
processes have been killed.

Bug: 23178833
Change-Id: I1636bc2022416359a25f19a3f65d113c05289cd3
parent bd58d6fc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -403,9 +403,10 @@ public class UserManagerService extends IUserManager.Stub {
        return ui;
    }

    /** Called by PackageManagerService */
    public boolean exists(int userId) {
        synchronized (mPackagesLock) {
            return ArrayUtils.contains(mUserIds, userId);
            return mUsers.get(userId) != null;
        }
    }