summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Beverly Tai <beverlyt@google.com> 2023-09-14 20:51:56 +0000
committer Beverly Tai <beverlyt@google.com> 2023-09-18 16:17:18 +0000
commiteaa129138096bc00b663bca93a5af9786aa47154 (patch)
treeafdcf17240ae6caf2aa94888784aac366d1c0f05
parentf0ebf508416f19a7e30b89c4f6aea669db0fb6a0 (diff)
Revert "On device lockdown, always show the keyguard"
This reverts commit c851ef6d27bf7d3193c85170706a67fb6185981a. Reason for revert: b/300463732 regression Bug: 300463732 Bug: 218495634 Change-Id: I314e5615b798487d9a965eaa0937905b65aa85fc Merged-In: I314e5615b798487d9a965eaa0937905b65aa85fc
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java12
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java25
2 files changed, 2 insertions, 35 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 18474e0af5b8..015918884f2e 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -768,13 +768,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
}
}
}
-
- @Override
- public void onStrongAuthStateChanged(int userId) {
- if (mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
- doKeyguardLocked(null);
- }
- }
};
ViewMediatorCallback mViewMediatorCallback = new ViewMediatorCallback() {
@@ -2159,9 +2152,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
* Enable the keyguard if the settings are appropriate.
*/
private void doKeyguardLocked(Bundle options) {
- // if another app is disabling us, don't show unless we're in lockdown mode
- if (!mExternallyEnabled
- && !mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
+ // if another app is disabling us, don't show
+ if (!mExternallyEnabled) {
if (DEBUG) Log.d(TAG, "doKeyguard: not showing because externally disabled");
mNeedToReshowWhenReenabled = true;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
index 1c8241433172..cfe3b0d2a803 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
@@ -157,8 +157,6 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
private @Mock AuthController mAuthController;
private @Mock ShadeExpansionStateManager mShadeExpansionStateManager;
private @Mock ShadeWindowLogger mShadeWindowLogger;
- private @Captor ArgumentCaptor<KeyguardUpdateMonitorCallback>
- mKeyguardUpdateMonitorCallbackCaptor;
private @Captor ArgumentCaptor<KeyguardStateController.Callback>
mKeyguardStateControllerCallback;
private DeviceConfigProxy mDeviceConfig = new DeviceConfigProxyFake();
@@ -206,25 +204,6 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
}
@Test
- @TestableLooper.RunWithLooper(setAsMainLooper = true)
- public void onLockdown_showKeyguard_evenIfKeyguardIsNotEnabledExternally() {
- // GIVEN keyguard is not enabled and isn't showing
- mViewMediator.onSystemReady();
- mViewMediator.setKeyguardEnabled(false);
- TestableLooper.get(this).processAllMessages();
- captureKeyguardUpdateMonitorCallback();
- assertFalse(mViewMediator.isShowingAndNotOccluded());
-
- // WHEN lockdown occurs
- when(mLockPatternUtils.isUserInLockdown(anyInt())).thenReturn(true);
- mKeyguardUpdateMonitorCallbackCaptor.getValue().onStrongAuthStateChanged(0);
-
- // THEN keyguard is shown
- TestableLooper.get(this).processAllMessages();
- assertTrue(mViewMediator.isShowingAndNotOccluded());
- }
-
- @Test
public void testOnGoingToSleep_UpdatesKeyguardGoingAway() {
mViewMediator.onStartedGoingToSleep(OFF_BECAUSE_OF_USER);
verify(mUpdateMonitor).dispatchKeyguardGoingAway(false);
@@ -844,10 +823,6 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
mViewMediator.registerCentralSurfaces(mCentralSurfaces, null, null, null, null, null);
}
- private void captureKeyguardUpdateMonitorCallback() {
- verify(mUpdateMonitor).registerCallback(mKeyguardUpdateMonitorCallbackCaptor.capture());
- }
-
private void captureKeyguardStateControllerCallback() {
verify(mKeyguardStateController).addCallback(mKeyguardStateControllerCallback.capture());
}