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

Commit f8642831 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 am: fbfce4e3

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



Change-Id: Ia6c015b1ea99d851ed53b9175a7313fbe62926b3
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a7cbd3c8 fbfce4e3
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -5673,18 +5673,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);