Remove dismiss check from security container

An recent change was made to prevent invalid attempts from removing
keyguard. However, it doesn't work in all cases and can prevent valid
unlocks from working. This was causing an empty lockscreen to appear
when SideFPS was used just after locking.

Fixes: 285159911
Test: atest SecurityContainerControllerTest
Test: Use SideFPS device, open an app, hit power but then leave finger
on SideFPS so it attempts to unlock immediately. Must have "Allow
unlock anytime" setting turned on

Change-Id: I547adf2d9865279813d12cb2a6215cf58a7eff0a
This commit is contained in:
Matt Pietal
2023-06-09 17:28:19 +00:00
parent 565b8127e1
commit d987fed12f
2 changed files with 0 additions and 22 deletions

View File

@@ -264,13 +264,6 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
*/
@Override
public void finish(boolean fromPrimaryAuth, int targetUserId) {
if (!mKeyguardStateController.canDismissLockScreen() && !fromPrimaryAuth) {
Log.e(TAG,
"Tried to dismiss keyguard when lockscreen is not dismissible and user "
+ "was not authenticated with a primary security method "
+ "(pin/password/pattern).");
return;
}
// If there's a pending runnable because the user interacted with a widget
// and we're leaving keyguard, then run it.
boolean deferKeyguardDone = false;

View File

@@ -584,21 +584,6 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
assertThat(mKeyguardSecurityContainerController.willRunDismissFromKeyguard()).isFalse();
}
@Test
public void testSecurityCallbackFinish() {
when(mKeyguardStateController.canDismissLockScreen()).thenReturn(true);
when(mKeyguardUpdateMonitor.isUserUnlocked(0)).thenReturn(true);
mKeyguardSecurityContainerController.finish(true, 0);
verify(mViewMediatorCallback).keyguardDone(anyBoolean(), anyInt());
}
@Test
public void testSecurityCallbackFinish_cannotDismissLockScreenAndNotStrongAuth() {
when(mKeyguardStateController.canDismissLockScreen()).thenReturn(false);
mKeyguardSecurityContainerController.finish(false, 0);
verify(mViewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt());
}
@Test
public void testOnStartingToHide() {
mKeyguardSecurityContainerController.onStartingToHide();