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

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

Merge "Revert "Wipe the LockscreenCredential in DPMS#resetPasswordInternal""...

Merge "Revert "Wipe the LockscreenCredential in DPMS#resetPasswordInternal"" into main am: 7a27431f

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



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