diff options
| author | 2024-01-19 17:52:27 +0000 | |
|---|---|---|
| committer | 2024-01-23 14:22:00 +0000 | |
| commit | cd94650c1bb82d03b700bbbd88f8aee807792fb4 (patch) | |
| tree | f42de63031b20bd0b6cefaa57b8e06b02c80d0df | |
| parent | 5b4e13aaa4c532aa2e4bb619ccc785cd3f20487a (diff) | |
Only run face auth when the assistant becomes visible
Don't run face auth if the assistant stopped being visible.
Test: KeyguardUpdateMonitorTest
Fixes: 319666295
Flag: NONE
Change-Id: Icf023b9908ee970dd86428c44835a30087dec043
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java | 6 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java | 18 |
2 files changed, 21 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index fe96099b0824..3e8c6a76998a 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -1644,11 +1644,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab void setAssistantVisible(boolean assistantVisible) { mAssistantVisible = assistantVisible; mLogger.logAssistantVisible(mAssistantVisible); - if (getFaceAuthInteractor() != null) { - getFaceAuthInteractor().onAssistantTriggeredOnLockScreen(); - } updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE); if (mAssistantVisible) { + if (getFaceAuthInteractor() != null) { + getFaceAuthInteractor().onAssistantTriggeredOnLockScreen(); + } requestActiveUnlock( ActiveUnlockConfig.ActiveUnlockRequestOrigin.ASSISTANT, "assistant", diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java index d8eb05a43e40..d06457ba86ab 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java @@ -1720,6 +1720,24 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { } @Test + public void assistantVisible_sendEventToFaceAuthInteractor() { + // WHEN the assistant is visible + mKeyguardUpdateMonitor.setAssistantVisible(true); + + // THEN send event to face auth interactor + verify(mFaceAuthInteractor).onAssistantTriggeredOnLockScreen(); + } + + @Test + public void assistantNotVisible_doesNotSendEventToFaceAuthInteractor() { + // WHEN the assistant is visible + mKeyguardUpdateMonitor.setAssistantVisible(false); + + // THEN never send event to face auth interactor + verify(mFaceAuthInteractor, never()).onAssistantTriggeredOnLockScreen(); + } + + @Test public void fingerprintFailure_requestActiveUnlock_dismissKeyguard() { // GIVEN shouldTriggerActiveUnlock bouncerFullyVisible(); |