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

Commit 9cbad151 authored by Rubin Xu's avatar Rubin Xu Committed by Automerger Merge Worker
Browse files

Merge "Always clear password reset token when removing device owner" into...

Merge "Always clear password reset token when removing device owner" into udc-dev am: 65108620 am: 4726d6af

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22938376



Change-Id: If9783e4bc4920e2d51d9039e75cb5f7dac176a9c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 695c7769 4726d6af
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -10011,10 +10011,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                        "clearDeviceOwner can only be called by the device owner");
                        "clearDeviceOwner can only be called by the device owner");
            }
            }
            enforceUserUnlocked(deviceOwnerUserId);
            enforceUserUnlocked(deviceOwnerUserId);
            DevicePolicyData policy = getUserData(deviceOwnerUserId);
            if (policy.mPasswordTokenHandle != 0) {
                mLockPatternUtils.removeEscrowToken(policy.mPasswordTokenHandle, deviceOwnerUserId);
            }
            final ActiveAdmin admin = getDeviceOwnerAdminLocked();
            final ActiveAdmin admin = getDeviceOwnerAdminLocked();
            mInjector.binderWithCleanCallingIdentity(() -> {
            mInjector.binderWithCleanCallingIdentity(() -> {
@@ -10069,6 +10065,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        }
        }
        final DevicePolicyData policyData = getUserData(userId);
        final DevicePolicyData policyData = getUserData(userId);
        policyData.mCurrentInputMethodSet = false;
        policyData.mCurrentInputMethodSet = false;
        if (policyData.mPasswordTokenHandle != 0) {
            mLockPatternUtils.removeEscrowToken(policyData.mPasswordTokenHandle, userId);
            policyData.mPasswordTokenHandle = 0;
        }
        saveSettingsLocked(userId);
        saveSettingsLocked(userId);
        mPolicyCache.onUserRemoved(userId);
        mPolicyCache.onUserRemoved(userId);
        final DevicePolicyData systemPolicyData = getUserData(UserHandle.USER_SYSTEM);
        final DevicePolicyData systemPolicyData = getUserData(UserHandle.USER_SYSTEM);