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

Commit e83f5125 authored by Irina Dumitrescu's avatar Irina Dumitrescu
Browse files

Avoid LockSettingsService NPE during CTS due to races around user removal.

Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.ManagedProfileTest
Fixes: 125421639
Change-Id: Ie015748f4ef54a8de9ad143df2fe1b0f40976f40
parent 8e95f0bf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1966,7 +1966,8 @@ public class LockSettingsService extends ILockSettings.Stub {
        } catch (RemoteException ex) {
            Slog.w(TAG, "unable to clear GK secure user id");
        }
        if (unknownUser || mUserManager.getUserInfo(userId).isManagedProfile()) {
        UserInfo userInfo = mUserManager.getUserInfo(userId);
        if (unknownUser || userInfo == null || userInfo.isManagedProfile()) {
            removeKeystoreProfileKey(userId);
        }
    }