Merge "Stop running face detection on bouncer if both face and fp are enrolled." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
18640ab7e7
@@ -55,10 +55,11 @@ data class KeyguardFaceListenModel(
|
|||||||
val faceAuthenticated: Boolean,
|
val faceAuthenticated: Boolean,
|
||||||
val faceDisabled: Boolean,
|
val faceDisabled: Boolean,
|
||||||
val goingToSleep: Boolean,
|
val goingToSleep: Boolean,
|
||||||
val keyguardAwake: Boolean,
|
val keyguardAwakeExcludingBouncerShowing: Boolean,
|
||||||
val keyguardGoingAway: Boolean,
|
val keyguardGoingAway: Boolean,
|
||||||
val listeningForFaceAssistant: Boolean,
|
val listeningForFaceAssistant: Boolean,
|
||||||
val occludingAppRequestingFaceAuth: Boolean,
|
val occludingAppRequestingFaceAuth: Boolean,
|
||||||
|
val onlyFaceEnrolled: Boolean,
|
||||||
val primaryUser: Boolean,
|
val primaryUser: Boolean,
|
||||||
val scanningAllowedByStrongAuth: Boolean,
|
val scanningAllowedByStrongAuth: Boolean,
|
||||||
val secureCameraLaunched: Boolean,
|
val secureCameraLaunched: Boolean,
|
||||||
|
|||||||
@@ -2474,8 +2474,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
}
|
}
|
||||||
|
|
||||||
final boolean statusBarShadeLocked = mStatusBarState == StatusBarState.SHADE_LOCKED;
|
final boolean statusBarShadeLocked = mStatusBarState == StatusBarState.SHADE_LOCKED;
|
||||||
final boolean awakeKeyguard = mKeyguardIsVisible && mDeviceInteractive && !mGoingToSleep
|
// mKeyguardIsVisible is true even when the bouncer is shown, we don't want to run face auth
|
||||||
&& !statusBarShadeLocked;
|
// on bouncer if both fp and fingerprint are enrolled.
|
||||||
|
final boolean awakeKeyguardExcludingBouncerShowing = mKeyguardIsVisible
|
||||||
|
&& mDeviceInteractive && !mGoingToSleep
|
||||||
|
&& !statusBarShadeLocked && !mBouncerFullyShown;
|
||||||
final int user = getCurrentUser();
|
final int user = getCurrentUser();
|
||||||
final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(user);
|
final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(user);
|
||||||
final boolean isLockDown =
|
final boolean isLockDown =
|
||||||
@@ -2515,14 +2518,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
final boolean faceDisabledForUser = isFaceDisabled(user);
|
final boolean faceDisabledForUser = isFaceDisabled(user);
|
||||||
final boolean biometricEnabledForUser = mBiometricEnabledForUser.get(user);
|
final boolean biometricEnabledForUser = mBiometricEnabledForUser.get(user);
|
||||||
final boolean shouldListenForFaceAssistant = shouldListenForFaceAssistant();
|
final boolean shouldListenForFaceAssistant = shouldListenForFaceAssistant();
|
||||||
|
final boolean onlyFaceEnrolled = isOnlyFaceEnrolled();
|
||||||
|
|
||||||
// Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
|
// Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
|
||||||
// instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
|
// instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
|
||||||
final boolean shouldListen =
|
final boolean shouldListen =
|
||||||
(mBouncerFullyShown && !mGoingToSleep
|
((mBouncerFullyShown && !mGoingToSleep && onlyFaceEnrolled)
|
||||||
|| mAuthInterruptActive
|
|| mAuthInterruptActive
|
||||||
|| mOccludingAppRequestingFace
|
|| mOccludingAppRequestingFace
|
||||||
|| awakeKeyguard
|
|| awakeKeyguardExcludingBouncerShowing
|
||||||
|| shouldListenForFaceAssistant
|
|| shouldListenForFaceAssistant
|
||||||
|| mAuthController.isUdfpsFingerDown()
|
|| mAuthController.isUdfpsFingerDown()
|
||||||
|| mUdfpsBouncerShowing)
|
|| mUdfpsBouncerShowing)
|
||||||
@@ -2546,10 +2550,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
faceAuthenticated,
|
faceAuthenticated,
|
||||||
faceDisabledForUser,
|
faceDisabledForUser,
|
||||||
mGoingToSleep,
|
mGoingToSleep,
|
||||||
awakeKeyguard,
|
awakeKeyguardExcludingBouncerShowing,
|
||||||
mKeyguardGoingAway,
|
mKeyguardGoingAway,
|
||||||
shouldListenForFaceAssistant,
|
shouldListenForFaceAssistant,
|
||||||
mOccludingAppRequestingFace,
|
mOccludingAppRequestingFace,
|
||||||
|
onlyFaceEnrolled,
|
||||||
mIsPrimaryUser,
|
mIsPrimaryUser,
|
||||||
strongAuthAllowsScanning,
|
strongAuthAllowsScanning,
|
||||||
mSecureCameraLaunched,
|
mSecureCameraLaunched,
|
||||||
@@ -2559,6 +2564,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
return shouldListen;
|
return shouldListen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isOnlyFaceEnrolled() {
|
||||||
|
return isFaceAuthEnabledForUser(getCurrentUser())
|
||||||
|
&& !isUnlockWithFingerprintPossible(getCurrentUser());
|
||||||
|
}
|
||||||
|
|
||||||
private void maybeLogListenerModelData(KeyguardListenModel model) {
|
private void maybeLogListenerModelData(KeyguardListenModel model) {
|
||||||
mLogger.logKeyguardListenerModel(model);
|
mLogger.logKeyguardListenerModel(model);
|
||||||
|
|
||||||
|
|||||||
@@ -86,10 +86,11 @@ private fun faceModel(user: Int) = KeyguardFaceListenModel(
|
|||||||
becauseCannotSkipBouncer = false,
|
becauseCannotSkipBouncer = false,
|
||||||
biometricSettingEnabledForUser = false,
|
biometricSettingEnabledForUser = false,
|
||||||
bouncerFullyShown = false,
|
bouncerFullyShown = false,
|
||||||
|
onlyFaceEnrolled = false,
|
||||||
faceAuthenticated = false,
|
faceAuthenticated = false,
|
||||||
faceDisabled = false,
|
faceDisabled = false,
|
||||||
goingToSleep = false,
|
goingToSleep = false,
|
||||||
keyguardAwake = false,
|
keyguardAwakeExcludingBouncerShowing = false,
|
||||||
keyguardGoingAway = false,
|
keyguardGoingAway = false,
|
||||||
listeningForFaceAssistant = false,
|
listeningForFaceAssistant = false,
|
||||||
occludingAppRequestingFaceAuth = false,
|
occludingAppRequestingFaceAuth = false,
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mBiometricEnabledCallbackArgCaptor;
|
mBiometricEnabledCallbackArgCaptor;
|
||||||
@Captor
|
@Captor
|
||||||
private ArgumentCaptor<FaceManager.AuthenticationCallback> mAuthenticationCallbackCaptor;
|
private ArgumentCaptor<FaceManager.AuthenticationCallback> mAuthenticationCallbackCaptor;
|
||||||
|
@Captor
|
||||||
|
private ArgumentCaptor<CancellationSignal> mCancellationSignalCaptor;
|
||||||
|
|
||||||
// Direct executor
|
// Direct executor
|
||||||
private Executor mBackgroundExecutor = Runnable::run;
|
private Executor mBackgroundExecutor = Runnable::run;
|
||||||
@@ -568,11 +570,12 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTriesToAuthenticate_whenBouncer() {
|
public void testTriesToAuthenticate_whenBouncer() {
|
||||||
|
fingerprintIsNotEnrolled();
|
||||||
setKeyguardBouncerVisibility(true);
|
setKeyguardBouncerVisibility(true);
|
||||||
|
|
||||||
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
||||||
verify(mFaceManager).isHardwareDetected();
|
verify(mFaceManager, atLeastOnce()).isHardwareDetected();
|
||||||
verify(mFaceManager).hasEnrolledTemplates(anyInt());
|
verify(mFaceManager, atLeastOnce()).hasEnrolledTemplates(anyInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -1204,6 +1207,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
// Face auth should run when the following is true.
|
// Face auth should run when the following is true.
|
||||||
bouncerFullyVisibleAndNotGoingToSleep();
|
bouncerFullyVisibleAndNotGoingToSleep();
|
||||||
|
fingerprintIsNotEnrolled();
|
||||||
keyguardNotGoingAway();
|
keyguardNotGoingAway();
|
||||||
currentUserIsPrimary();
|
currentUserIsPrimary();
|
||||||
strongAuthNotRequired();
|
strongAuthNotRequired();
|
||||||
@@ -1229,7 +1233,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mKeyguardUpdateMonitor =
|
mKeyguardUpdateMonitor =
|
||||||
new TestableKeyguardUpdateMonitor(mSpiedContext);
|
new TestableKeyguardUpdateMonitor(mSpiedContext);
|
||||||
|
|
||||||
// Face auth should run when the following is true.
|
// Preconditions for face auth to run
|
||||||
keyguardNotGoingAway();
|
keyguardNotGoingAway();
|
||||||
bouncerFullyVisibleAndNotGoingToSleep();
|
bouncerFullyVisibleAndNotGoingToSleep();
|
||||||
strongAuthNotRequired();
|
strongAuthNotRequired();
|
||||||
@@ -1246,7 +1250,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testShouldListenForFace_whenStrongAuthDoesNotAllowScanning_returnsFalse()
|
public void testShouldListenForFace_whenStrongAuthDoesNotAllowScanning_returnsFalse()
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
// Face auth should run when the following is true.
|
// Preconditions for face auth to run
|
||||||
keyguardNotGoingAway();
|
keyguardNotGoingAway();
|
||||||
bouncerFullyVisibleAndNotGoingToSleep();
|
bouncerFullyVisibleAndNotGoingToSleep();
|
||||||
currentUserIsPrimary();
|
currentUserIsPrimary();
|
||||||
@@ -1267,9 +1271,10 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testShouldListenForFace_whenBiometricsDisabledForUser_returnsFalse()
|
public void testShouldListenForFace_whenBiometricsDisabledForUser_returnsFalse()
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
// Face auth should run when the following is true.
|
// Preconditions for face auth to run
|
||||||
keyguardNotGoingAway();
|
keyguardNotGoingAway();
|
||||||
bouncerFullyVisibleAndNotGoingToSleep();
|
bouncerFullyVisibleAndNotGoingToSleep();
|
||||||
|
fingerprintIsNotEnrolled();
|
||||||
currentUserIsPrimary();
|
currentUserIsPrimary();
|
||||||
currentUserDoesNotHaveTrust();
|
currentUserDoesNotHaveTrust();
|
||||||
biometricsNotDisabledThroughDevicePolicyManager();
|
biometricsNotDisabledThroughDevicePolicyManager();
|
||||||
@@ -1289,9 +1294,10 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testShouldListenForFace_whenUserCurrentlySwitching_returnsFalse()
|
public void testShouldListenForFace_whenUserCurrentlySwitching_returnsFalse()
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
// Face auth should run when the following is true.
|
// Preconditions for face auth to run
|
||||||
keyguardNotGoingAway();
|
keyguardNotGoingAway();
|
||||||
bouncerFullyVisibleAndNotGoingToSleep();
|
bouncerFullyVisibleAndNotGoingToSleep();
|
||||||
|
fingerprintIsNotEnrolled();
|
||||||
currentUserIsPrimary();
|
currentUserIsPrimary();
|
||||||
currentUserDoesNotHaveTrust();
|
currentUserDoesNotHaveTrust();
|
||||||
biometricsNotDisabledThroughDevicePolicyManager();
|
biometricsNotDisabledThroughDevicePolicyManager();
|
||||||
@@ -1310,9 +1316,10 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testShouldListenForFace_whenSecureCameraLaunched_returnsFalse()
|
public void testShouldListenForFace_whenSecureCameraLaunched_returnsFalse()
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
// Face auth should run when the following is true.
|
// Preconditions for face auth to run
|
||||||
keyguardNotGoingAway();
|
keyguardNotGoingAway();
|
||||||
bouncerFullyVisibleAndNotGoingToSleep();
|
bouncerFullyVisibleAndNotGoingToSleep();
|
||||||
|
fingerprintIsNotEnrolled();
|
||||||
currentUserIsPrimary();
|
currentUserIsPrimary();
|
||||||
currentUserDoesNotHaveTrust();
|
currentUserDoesNotHaveTrust();
|
||||||
biometricsNotDisabledThroughDevicePolicyManager();
|
biometricsNotDisabledThroughDevicePolicyManager();
|
||||||
@@ -1331,7 +1338,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testShouldListenForFace_whenOccludingAppRequestsFaceAuth_returnsTrue()
|
public void testShouldListenForFace_whenOccludingAppRequestsFaceAuth_returnsTrue()
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
// Face auth should run when the following is true.
|
// Preconditions for face auth to run
|
||||||
keyguardNotGoingAway();
|
keyguardNotGoingAway();
|
||||||
bouncerFullyVisibleAndNotGoingToSleep();
|
bouncerFullyVisibleAndNotGoingToSleep();
|
||||||
currentUserIsPrimary();
|
currentUserIsPrimary();
|
||||||
@@ -1354,7 +1361,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testShouldListenForFace_whenBouncerShowingAndDeviceIsAwake_returnsTrue()
|
public void testShouldListenForFace_whenBouncerShowingAndDeviceIsAwake_returnsTrue()
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
// Face auth should run when the following is true.
|
// Preconditions for face auth to run
|
||||||
keyguardNotGoingAway();
|
keyguardNotGoingAway();
|
||||||
currentUserIsPrimary();
|
currentUserIsPrimary();
|
||||||
currentUserDoesNotHaveTrust();
|
currentUserDoesNotHaveTrust();
|
||||||
@@ -1366,6 +1373,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
|
||||||
|
|
||||||
bouncerFullyVisibleAndNotGoingToSleep();
|
bouncerFullyVisibleAndNotGoingToSleep();
|
||||||
|
fingerprintIsNotEnrolled();
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
|
|
||||||
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue();
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue();
|
||||||
@@ -1374,7 +1382,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testShouldListenForFace_whenAuthInterruptIsActive_returnsTrue()
|
public void testShouldListenForFace_whenAuthInterruptIsActive_returnsTrue()
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
// Face auth should run when the following is true.
|
// Preconditions for face auth to run
|
||||||
keyguardNotGoingAway();
|
keyguardNotGoingAway();
|
||||||
currentUserIsPrimary();
|
currentUserIsPrimary();
|
||||||
currentUserDoesNotHaveTrust();
|
currentUserDoesNotHaveTrust();
|
||||||
@@ -1391,6 +1399,122 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue();
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testShouldListenForFace_whenKeyguardIsAwake_returnsTrue() throws RemoteException {
|
||||||
|
// Preconditions for face auth to run
|
||||||
|
keyguardNotGoingAway();
|
||||||
|
currentUserIsPrimary();
|
||||||
|
currentUserDoesNotHaveTrust();
|
||||||
|
biometricsNotDisabledThroughDevicePolicyManager();
|
||||||
|
biometricsEnabledForCurrentUser();
|
||||||
|
userNotCurrentlySwitching();
|
||||||
|
bouncerFullyVisible();
|
||||||
|
|
||||||
|
statusBarShadeIsLocked();
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
|
||||||
|
|
||||||
|
deviceNotGoingToSleep();
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
|
||||||
|
deviceIsInteractive();
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
|
||||||
|
keyguardIsVisible();
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
|
||||||
|
statusBarShadeIsNotLocked();
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
|
||||||
|
bouncerNotFullyVisible();
|
||||||
|
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testShouldListenForFace_whenUdfpsFingerDown_returnsTrue() throws RemoteException {
|
||||||
|
// Preconditions for face auth to run
|
||||||
|
keyguardNotGoingAway();
|
||||||
|
currentUserIsPrimary();
|
||||||
|
currentUserDoesNotHaveTrust();
|
||||||
|
biometricsNotDisabledThroughDevicePolicyManager();
|
||||||
|
biometricsEnabledForCurrentUser();
|
||||||
|
userNotCurrentlySwitching();
|
||||||
|
when(mAuthController.isUdfpsFingerDown()).thenReturn(false);
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
|
||||||
|
|
||||||
|
when(mAuthController.isUdfpsFingerDown()).thenReturn(true);
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testShouldListenForFace_whenUdfpsBouncerIsShowing_returnsTrue()
|
||||||
|
throws RemoteException {
|
||||||
|
// Preconditions for face auth to run
|
||||||
|
keyguardNotGoingAway();
|
||||||
|
currentUserIsPrimary();
|
||||||
|
currentUserDoesNotHaveTrust();
|
||||||
|
biometricsNotDisabledThroughDevicePolicyManager();
|
||||||
|
biometricsEnabledForCurrentUser();
|
||||||
|
userNotCurrentlySwitching();
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
|
||||||
|
|
||||||
|
mKeyguardUpdateMonitor.setUdfpsBouncerShowing(true);
|
||||||
|
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBouncerVisibility_whenBothFingerprintAndFaceIsEnrolled_stopsFaceAuth()
|
||||||
|
throws RemoteException {
|
||||||
|
// Both fingerprint and face are enrolled by default
|
||||||
|
// Preconditions for face auth to run
|
||||||
|
keyguardNotGoingAway();
|
||||||
|
currentUserIsPrimary();
|
||||||
|
currentUserDoesNotHaveTrust();
|
||||||
|
biometricsNotDisabledThroughDevicePolicyManager();
|
||||||
|
biometricsEnabledForCurrentUser();
|
||||||
|
userNotCurrentlySwitching();
|
||||||
|
deviceNotGoingToSleep();
|
||||||
|
deviceIsInteractive();
|
||||||
|
statusBarShadeIsNotLocked();
|
||||||
|
keyguardIsVisible();
|
||||||
|
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
|
||||||
|
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isTrue();
|
||||||
|
|
||||||
|
mKeyguardUpdateMonitor.requestFaceAuth(true);
|
||||||
|
verify(mFaceManager).authenticate(any(),
|
||||||
|
mCancellationSignalCaptor.capture(),
|
||||||
|
mAuthenticationCallbackCaptor.capture(),
|
||||||
|
any(),
|
||||||
|
anyInt(),
|
||||||
|
anyBoolean());
|
||||||
|
CancellationSignal cancelSignal = mCancellationSignalCaptor.getValue();
|
||||||
|
|
||||||
|
bouncerFullyVisible();
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
|
||||||
|
assertThat(cancelSignal.isCanceled()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fingerprintIsNotEnrolled() {
|
||||||
|
when(mFingerprintManager.hasEnrolledTemplates(mCurrentUserId)).thenReturn(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void statusBarShadeIsNotLocked() {
|
||||||
|
mStatusBarStateListener.onStateChanged(StatusBarState.KEYGUARD);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void statusBarShadeIsLocked() {
|
||||||
|
mStatusBarStateListener.onStateChanged(StatusBarState.SHADE_LOCKED);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void keyguardIsVisible() {
|
||||||
|
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
||||||
|
}
|
||||||
|
|
||||||
private void triggerAuthInterrupt() {
|
private void triggerAuthInterrupt() {
|
||||||
mKeyguardUpdateMonitor.onAuthInterruptDetected(true);
|
mKeyguardUpdateMonitor.onAuthInterruptDetected(true);
|
||||||
}
|
}
|
||||||
@@ -1468,10 +1592,26 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void bouncerFullyVisibleAndNotGoingToSleep() {
|
private void bouncerFullyVisibleAndNotGoingToSleep() {
|
||||||
mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(true, true);
|
bouncerFullyVisible();
|
||||||
|
deviceNotGoingToSleep();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deviceNotGoingToSleep() {
|
||||||
mKeyguardUpdateMonitor.dispatchFinishedGoingToSleep(/* value doesn't matter */1);
|
mKeyguardUpdateMonitor.dispatchFinishedGoingToSleep(/* value doesn't matter */1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deviceIsInteractive() {
|
||||||
|
mKeyguardUpdateMonitor.dispatchStartedWakingUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bouncerNotFullyVisible() {
|
||||||
|
setKeyguardBouncerVisibility(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bouncerFullyVisible() {
|
||||||
|
setKeyguardBouncerVisibility(true);
|
||||||
|
}
|
||||||
|
|
||||||
private void setKeyguardBouncerVisibility(boolean isVisible) {
|
private void setKeyguardBouncerVisibility(boolean isVisible) {
|
||||||
mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(isVisible, isVisible);
|
mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(isVisible, isVisible);
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
|
|||||||
Reference in New Issue
Block a user