Update udfps view state before showing

Also continue to listen for fingerprints on shade and fullscreen user
switcher, logic to hide icon is in UdfpsAnimationView

Test: manual
Fixes: 181573493
Change-Id: I7e7aed339498bb5cac588bb67f432251a93638a5
This commit is contained in:
Beverly
2021-03-09 11:50:09 -05:00
parent d6209d4e18
commit bfcdcea0f3
3 changed files with 1 additions and 32 deletions

View File

@@ -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();
}

View File

@@ -404,6 +404,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);

View File

@@ -792,36 +792,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
assertThat(mKeyguardUpdateMonitor.shouldListenForUdfps()).isEqualTo(true);
}
@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