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

Commit fb9e3643 authored by Jim Miller's avatar Jim Miller Committed by Android (Google) Code Review
Browse files

Merge "Fix 5620754: don't show pattern unlock after SIM unlock if not enabled."

parents b14ecd26 93708af1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ public class LockPatternUtils {
        saveLockPassword(null, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
        setLockPatternEnabled(false);
        saveLockPattern(null);
        setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
        setLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
        setLong(PASSWORD_TYPE_ALTERNATE_KEY, DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
    }

+13 −6
Original line number Diff line number Diff line
@@ -855,6 +855,9 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
            case Password:
                secure = mLockPatternUtils.isLockPasswordEnabled();
                break;
            case Unknown:
                // This means no security is set up
                break;
            default:
                throw new IllegalStateException("unknown unlock mode " + unlockMode);
        }
@@ -877,8 +880,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler

        // Re-create the unlock screen if necessary. This is primarily required to properly handle
        // SIM state changes. This typically happens when this method is called by reset()
        if (mode == Mode.UnlockScreen) {
        final UnlockMode unlockMode = getUnlockMode();
        if (mode == Mode.UnlockScreen && unlockMode != UnlockMode.Unknown) {
            if (force || mUnlockScreen == null || unlockMode != mUnlockScreenMode) {
                boolean restartFaceLock = stopFaceLockIfRunning();
                recreateUnlockScreen(unlockMode);
@@ -1052,12 +1055,16 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
                    break;
                case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
                case DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED:
                    if (mLockPatternUtils.isLockPatternEnabled()) {
                        // "forgot pattern" button is only available in the pattern mode...
                        if (mForgotPattern || mLockPatternUtils.isPermanentlyLocked()) {
                            currentMode = UnlockMode.Account;
                        } else {
                            currentMode = UnlockMode.Pattern;
                        }
                    } else {
                        currentMode = UnlockMode.Unknown;
                    }
                    break;
                default:
                   throw new IllegalStateException("Unknown unlock mode:" + mode);