Merge "Preemptively hide UDPFS icon on biometric authenticated" into udc-dev am: 5889aa779d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22383268 Change-Id: Id2f3cfe9396d1e274adac753eb4bea3d4e2fe8d7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -167,6 +167,9 @@ constructor(
|
|||||||
|
|
||||||
private val keyguardStateControllerCallback: KeyguardStateController.Callback =
|
private val keyguardStateControllerCallback: KeyguardStateController.Callback =
|
||||||
object : KeyguardStateController.Callback {
|
object : KeyguardStateController.Callback {
|
||||||
|
override fun onUnlockedChanged() {
|
||||||
|
updatePauseAuth()
|
||||||
|
}
|
||||||
override fun onLaunchTransitionFadingAwayChanged() {
|
override fun onLaunchTransitionFadingAwayChanged() {
|
||||||
launchTransitionFadingAway = keyguardStateController.isLaunchTransitionFadingAway
|
launchTransitionFadingAway = keyguardStateController.isLaunchTransitionFadingAway
|
||||||
updatePauseAuth()
|
updatePauseAuth()
|
||||||
@@ -403,6 +406,15 @@ constructor(
|
|||||||
if (isBouncerExpansionGreaterThan(.5f)) {
|
if (isBouncerExpansionGreaterThan(.5f)) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
keyguardUpdateMonitor.getUserUnlockedWithBiometric(
|
||||||
|
KeyguardUpdateMonitor.getCurrentUser()
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
// If the device was unlocked by a biometric, immediately hide the UDFPS icon to avoid
|
||||||
|
// overlap with the LockIconView. Shortly afterwards, UDFPS will stop running.
|
||||||
|
return true
|
||||||
|
}
|
||||||
return view.unpausedAlpha < 255 * .1
|
return view.unpausedAlpha < 255 * .1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.android.systemui.biometrics;
|
|||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
import static org.mockito.Mockito.atLeast;
|
import static org.mockito.Mockito.atLeast;
|
||||||
import static org.mockito.Mockito.atLeastOnce;
|
import static org.mockito.Mockito.atLeastOnce;
|
||||||
import static org.mockito.Mockito.never;
|
import static org.mockito.Mockito.never;
|
||||||
@@ -156,6 +157,22 @@ public class UdfpsKeyguardViewControllerTest extends UdfpsKeyguardViewController
|
|||||||
assertFalse(mController.shouldPauseAuth());
|
assertFalse(mController.shouldPauseAuth());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onBiometricAuthenticated_pauseAuth() {
|
||||||
|
// GIVEN view is attached and we're on the keyguard (see testShouldNotPauseAuthOnKeyguard)
|
||||||
|
mController.onViewAttached();
|
||||||
|
captureStatusBarStateListeners();
|
||||||
|
sendStatusBarStateChanged(StatusBarState.KEYGUARD);
|
||||||
|
|
||||||
|
// WHEN biometric is authenticated
|
||||||
|
captureKeyguardStateControllerCallback();
|
||||||
|
when(mKeyguardUpdateMonitor.getUserUnlockedWithBiometric(anyInt())).thenReturn(true);
|
||||||
|
mKeyguardStateControllerCallback.onUnlockedChanged();
|
||||||
|
|
||||||
|
// THEN pause auth
|
||||||
|
assertTrue(mController.shouldPauseAuth());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testShouldPauseAuthIsLaunchTransitionFadingAway() {
|
public void testShouldPauseAuthIsLaunchTransitionFadingAway() {
|
||||||
// GIVEN view is attached and we're on the keyguard (see testShouldNotPauseAuthOnKeyguard)
|
// GIVEN view is attached and we're on the keyguard (see testShouldNotPauseAuthOnKeyguard)
|
||||||
|
|||||||
Reference in New Issue
Block a user