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

Commit 6e3ccb6e authored by Ellen Arteca's avatar Ellen Arteca Committed by Automerger Merge Worker
Browse files

Merge "Wipe the LockscreenCredential in DPMS#resetPasswordInternal" into main...

Merge "Wipe the LockscreenCredential in DPMS#resetPasswordInternal" into main am: f245247d am: 3d527fd8

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



Change-Id: I700f6df36f04a0f5813cb0529d11a4b2bf05eec8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3e5348bd 3d527fd8
Loading
Loading
Loading
Loading
+10 −7
Original line number Original line Diff line number Diff line
@@ -5673,15 +5673,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    private boolean resetPasswordInternal(String password, long tokenHandle, byte[] token,
    private boolean resetPasswordInternal(String password, long tokenHandle, byte[] token,
            int flags, CallerIdentity caller) {
            int flags, CallerIdentity caller) {
        final int callingUid = caller.getUid();
        final int userHandle = UserHandle.getUserId(callingUid);
        final boolean isPin = PasswordMetrics.isNumericOnly(password);
        final boolean isPin = PasswordMetrics.isNumericOnly(password);
        final LockscreenCredential newCredential;
        try (LockscreenCredential newCredential =
        if (isPin) {
                isPin ? LockscreenCredential.createPin(password) :
            newCredential = LockscreenCredential.createPin(password);
                       LockscreenCredential.createPasswordOrNone(password)) {
        } else {
            return resetPasswordInternal(newCredential, tokenHandle, token, flags, caller);
            newCredential = LockscreenCredential.createPasswordOrNone(password);
        }
    }
    }
    private boolean resetPasswordInternal(LockscreenCredential newCredential,
            long tokenHandle, byte[] token, int flags, CallerIdentity caller) {
        final int callingUid = caller.getUid();
        final int userHandle = UserHandle.getUserId(callingUid);
        synchronized (getLockObject()) {
        synchronized (getLockObject()) {
            final PasswordMetrics minMetrics = getPasswordMinimumMetricsUnchecked(userHandle);
            final PasswordMetrics minMetrics = getPasswordMinimumMetricsUnchecked(userHandle);
            final int complexity = getAggregatedPasswordComplexityLocked(userHandle);
            final int complexity = getAggregatedPasswordComplexityLocked(userHandle);