Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +2 −10 Original line number Diff line number Diff line Loading @@ -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() { Loading Loading @@ -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; Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +0 −25 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -205,25 +203,6 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { createAndStartViewMediator(); } @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); Loading Loading @@ -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()); } Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +2 −10 Original line number Diff line number Diff line Loading @@ -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() { Loading Loading @@ -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; Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +0 −25 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -205,25 +203,6 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { createAndStartViewMediator(); } @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); Loading Loading @@ -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()); } Loading