Split up MODE_SHOW_BOUNCER and MODE_UNLOCK_COLLAPSING

MODE_SHOW_BOUNCER shouldn't notifyKeyguardAuthenticated, but
MODE_UNLOCK_COLLAPSING should.

Test: use biometric auth right after reboot - goes to bouncer
Test: atest BiometricsUnlockControllerTest
Fixes: 186179437
Change-Id: I3f054a66de9125d8c61a52c2096779500c5012c0
This commit is contained in:
Beverly
2021-04-23 19:54:52 -04:00
committed by Beverly Tai
parent 320acb1204
commit 51c04d7a03
2 changed files with 14 additions and 3 deletions

View File

@@ -411,13 +411,22 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
Trace.endSection();
break;
case MODE_UNLOCK_COLLAPSING:
case MODE_SHOW_BOUNCER:
Trace.beginSection("MODE_UNLOCK_COLLAPSING or MODE_SHOW_BOUNCER");
Trace.beginSection("MODE_UNLOCK_COLLAPSING");
if (!wasDeviceInteractive) {
mPendingShowBouncer = true;
} else {
showBouncer();
mKeyguardViewController.notifyKeyguardAuthenticated(
false /* strongAuth */);
}
Trace.endSection();
break;
case MODE_SHOW_BOUNCER:
Trace.beginSection("MODE_SHOW_BOUNCER");
if (!wasDeviceInteractive) {
mPendingShowBouncer = true;
} else {
showBouncer();
mKeyguardViewController.notifyKeyguardAuthenticated(false /* strongAuth */);
}
Trace.endSection();
break;

View File

@@ -123,6 +123,7 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
verify(mStatusBarKeyguardViewManager).showBouncer(eq(false));
verify(mShadeController).animateCollapsePanels(anyInt(), anyBoolean(), anyBoolean(),
anyFloat());
verify(mStatusBarKeyguardViewManager, never()).notifyKeyguardAuthenticated(anyBoolean());
assertThat(mBiometricUnlockController.getMode())
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
}
@@ -170,6 +171,7 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
verify(mShadeController).animateCollapsePanels(anyInt(), anyBoolean(), anyBoolean(),
anyFloat());
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false));
assertThat(mBiometricUnlockController.getMode())
.isEqualTo(BiometricUnlockController.MODE_UNLOCK_COLLAPSING);
}