Merge "Reset mAssistantVisible state whenever device starts going to sleep" into tm-qpr-dev am: dd37c73b3b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21078346 Change-Id: I796f6627de8491f8fc490d7e5dae80e1df6d762a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1937,6 +1937,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mGoingToSleep = true;
|
mGoingToSleep = true;
|
||||||
|
// Resetting assistant visibility state as the device is going to sleep now.
|
||||||
|
// TaskStackChangeListener gets triggered a little late when we transition to AoD,
|
||||||
|
// which results in face auth running once on AoD.
|
||||||
|
mAssistantVisible = false;
|
||||||
|
mLogger.d("Started going to sleep, mGoingToSleep=true, mAssistantVisible=false");
|
||||||
updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE, FACE_AUTH_UPDATED_GOING_TO_SLEEP);
|
updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE, FACE_AUTH_UPDATED_GOING_TO_SLEEP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3330,7 +3335,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
/**
|
/**
|
||||||
* Handle {@link #MSG_KEYGUARD_RESET}
|
* Handle {@link #MSG_KEYGUARD_RESET}
|
||||||
*/
|
*/
|
||||||
private void handleKeyguardReset() {
|
@VisibleForTesting
|
||||||
|
protected void handleKeyguardReset() {
|
||||||
mLogger.d("handleKeyguardReset");
|
mLogger.d("handleKeyguardReset");
|
||||||
updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE,
|
updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE,
|
||||||
FACE_AUTH_UPDATED_KEYGUARD_RESET);
|
FACE_AUTH_UPDATED_KEYGUARD_RESET);
|
||||||
|
|||||||
@@ -853,6 +853,32 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void faceUnlockDoesNotRunWhenDeviceIsGoingToSleepWithAssistantVisible() {
|
||||||
|
mKeyguardUpdateMonitor.setKeyguardShowing(true, true);
|
||||||
|
mKeyguardUpdateMonitor.setAssistantVisible(true);
|
||||||
|
|
||||||
|
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
clearInvocations(mFaceManager);
|
||||||
|
|
||||||
|
// Device going to sleep while assistant is visible
|
||||||
|
mKeyguardUpdateMonitor.handleStartedGoingToSleep(0);
|
||||||
|
mKeyguardUpdateMonitor.handleFinishedGoingToSleep(0);
|
||||||
|
mTestableLooper.moveTimeForward(DEFAULT_CANCEL_SIGNAL_TIMEOUT);
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
|
||||||
|
mKeyguardUpdateMonitor.handleKeyguardReset();
|
||||||
|
|
||||||
|
assertThat(mKeyguardUpdateMonitor.isFaceDetectionRunning()).isFalse();
|
||||||
|
verify(mFaceManager, never()).authenticate(any(),
|
||||||
|
any(),
|
||||||
|
any(),
|
||||||
|
any(),
|
||||||
|
anyInt(),
|
||||||
|
anyBoolean());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIgnoresAuth_whenTrustAgentOnKeyguard_withoutBypass() {
|
public void testIgnoresAuth_whenTrustAgentOnKeyguard_withoutBypass() {
|
||||||
mKeyguardUpdateMonitor.dispatchStartedWakingUp(PowerManager.WAKE_REASON_POWER_BUTTON);
|
mKeyguardUpdateMonitor.dispatchStartedWakingUp(PowerManager.WAKE_REASON_POWER_BUTTON);
|
||||||
|
|||||||
Reference in New Issue
Block a user