From 51c04d7a03861d4c34dc98d52edf14bdf4d127f5 Mon Sep 17 00:00:00 2001 From: Beverly Date: Fri, 23 Apr 2021 19:54:52 -0400 Subject: [PATCH] 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 --- .../phone/BiometricUnlockController.java | 15 ++++++++++++--- .../phone/BiometricsUnlockControllerTest.java | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java index a4ee9eee71511..5399094912617 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java @@ -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; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java index f1c8ece58fdac..a63d509b0b535 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java @@ -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); }