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

Commit 4ef8e01e authored by beverlyt's avatar beverlyt Committed by Evelyn Torres
Browse files

RESTRICT AUTOMERGE Check the strongAuthTracker for lockdown instead of LockPatternUtils

LockPatternUtils and the StrongAuthTracker check for
lockdown may be out of sync, so always check the
KeyguardUpdateMonitor's strong auth tracker for
lockdown.

Test: atest KeyguardViewMediatorTest
Test: pin an app; lock down device;
observe keyguard always shows (repeat 10x times)
Bug: 438973280
Flag: EXEMPT CVE_FIX

(cherry picked from commit 5c25e76eb886ad3508103b486b146b6920c8c651)
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:047999f46315f938a75488285f60908bd0dc7b65
Merged-In: I076f5a8cacd14fc8ab8893aedf98ff831a9c195f
Change-Id: I076f5a8cacd14fc8ab8893aedf98ff831a9c195f
parent 0478d0ba
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -286,8 +286,11 @@ public class KeyguardUpdateMonitorCallback {
            BiometricSourceType biometricSourceType) { }

    /**
     * Called when the state that the user hasn't used strong authentication since quite some time
     * has changed.
     * Called when the strong auth state changes and primary auth may be required.
     * If responding to a change in strong auth state from this method, use
     * {@link KeyguardUpdateMonitor} as the source for truth for strong auth state.
     * For example:
     *  - {@link KeyguardUpdateMonitor#isUserInLockdown(int)}
     */
    public void onStrongAuthStateChanged(int userId) { }

+2 −2
Original line number Diff line number Diff line
@@ -671,7 +671,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,

        @Override
        public void onStrongAuthStateChanged(int userId) {
            if (mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
            if (mUpdateMonitor.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
                doKeyguardLocked(null);
            }
        }
@@ -1547,7 +1547,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable,

        // if another app is disabling us, don't show unless we're in lockdown mode
        if (!mExternallyEnabled
                && !mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
            && !mUpdateMonitor.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
            if (DEBUG) Log.d(TAG, "doKeyguard: not showing because externally disabled");

            mNeedToReshowWhenReenabled = true;