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

Commit bf2fbaa7 authored by Pavel Grafov's avatar Pavel Grafov Committed by android-build-merger
Browse files

Restore separate challenge state on error am: f10ae7e7

am: 1ed95cb0

Change-Id: I28a6f5f4a05b64ad5a7cf2cda486e84a9a7503e7
parents 4d9f7a8b 1ed95cb0
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -955,13 +955,19 @@ public class LockSettingsService extends ILockSettings.Stub {
    @GuardedBy("mSeparateChallengeLock")
    private void setSeparateProfileChallengeEnabledLocked(@UserIdInt int userId, boolean enabled,
            String managedUserPassword) {
        final boolean old = getBoolean(SEPARATE_PROFILE_CHALLENGE_KEY, false, userId);
        setBoolean(SEPARATE_PROFILE_CHALLENGE_KEY, enabled, userId);
        try {
            if (enabled) {
                mStorage.removeChildProfileLock(userId);
                removeKeystoreProfileKey(userId);
            } else {
                tieManagedProfileLockIfNecessary(userId, managedUserPassword);
            }
        } catch (IllegalStateException e) {
            setBoolean(SEPARATE_PROFILE_CHALLENGE_KEY, old, userId);
            throw e;
        }
    }

    private void notifySeparateProfileChallengeChanged(int userId) {