diff options
author | 2021-03-10 17:41:35 +0000 | |
---|---|---|
committer | 2021-03-10 17:41:35 +0000 | |
commit | 44d2d8f916657ea2a11fe6967843bbf98f306a08 (patch) | |
tree | 48ba42d676ae0437d397ae3e868cbfde1acef438 | |
parent | 34555e20813b4a2f78625d92edce43fe553eaac0 (diff) | |
parent | bfcdcea0f38fc11bfa397eacfd05d2ebc37e7387 (diff) |
Merge "Update udfps view state before showing" into sc-dev
3 files changed, 1 insertions, 32 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index a4054bea1167..69e6ed043172 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -2077,8 +2077,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab boolean shouldListenForUdfps() { return shouldListenForFingerprint() && !mBouncer - && mStatusBarState != StatusBarState.SHADE_LOCKED - && mStatusBarState != StatusBarState.FULLSCREEN_USER_SWITCHER && mStrongAuthTracker.hasUserAuthenticatedSinceBoot(); } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java index 1d789ca15dfb..4b6a8f639cc4 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java @@ -451,6 +451,7 @@ public class UdfpsController implements DozeReceiver, HbmCallback { mStatusBar.addExpansionChangedListener(mStatusBarExpansionListener); mStatusBarStateController.addCallback(mStatusBarStateListener); + mStatusBarStateListener.onStateChanged(mStatusBarStateController.getState()); mWindowManager.addView(mView, computeLayoutParams(animation)); mView.setOnTouchListener(mOnTouchListener); diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java index eb95d1653e84..b9d8d27b8971 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java @@ -793,36 +793,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { } @Test - public void testStartUdfpsServiceOnShadeLocked() { - // GIVEN - // - bouncer isn't showing - // - user has authenticated since boot - setKeyguardBouncerVisibility(false /* isVisible */); - when(mStrongAuthTracker.hasUserAuthenticatedSinceBoot()).thenReturn(true); - - // WHEN the status bar state changes to SHADE_LOCKED - mStatusBarStateListener.onStateChanged(StatusBarState.SHADE_LOCKED); - - // THEN we shouldn't listen for udfps - assertThat(mKeyguardUpdateMonitor.shouldListenForUdfps()).isEqualTo(false); - } - - @Test - public void testStartUdfpsServiceOnFullscreenUserSwitcher() { - // GIVEN - // - bouncer isn't showing - // - user has authenticated since boot - setKeyguardBouncerVisibility(false /* isVisible */); - when(mStrongAuthTracker.hasUserAuthenticatedSinceBoot()).thenReturn(true); - - // WHEN the status bar state changes to FULLSCREEN_USER_SWITCHER - mStatusBarStateListener.onStateChanged(StatusBarState.FULLSCREEN_USER_SWITCHER); - - // THEN we shouldn't listen for udfps - assertThat(mKeyguardUpdateMonitor.shouldListenForUdfps()).isEqualTo(false); - } - - @Test public void testStartUdfpsServiceNoAuthenticationSinceLastBoot() { // GIVEN // - bouncer isn't showing |