Merge "ActiveUnlock dismisses keyguard on trigger from assistant" into tm-qpr-dev am: d41ebc8bf8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22134780

Change-Id: I5adbbf30c55dc78d53b0bed9cf07e29c5138aaae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Beverly Tai
2023-03-20 17:03:29 +00:00
committed by Automerger Merge Worker
2 changed files with 21 additions and 1 deletions

View File

@@ -1602,7 +1602,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
requestActiveUnlock(
ActiveUnlockConfig.ActiveUnlockRequestOrigin.ASSISTANT,
"assistant",
false);
/* dismissKeyguard */ true);
}
}

View File

@@ -2244,6 +2244,26 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
assertThat(mKeyguardUpdateMonitor.shouldListenForFace()).isFalse();
}
@Test
public void assistantVisible_requestActiveUnlock() {
// GIVEN active unlock requests from the assistant are allowed
when(mActiveUnlockConfig.shouldAllowActiveUnlockFromOrigin(
ActiveUnlockConfig.ActiveUnlockRequestOrigin.ASSISTANT)).thenReturn(true);
// GIVEN should trigger active unlock
keyguardIsVisible();
keyguardNotGoingAway();
statusBarShadeIsNotLocked();
when(mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser())).thenReturn(true);
// WHEN the assistant is visible
mKeyguardUpdateMonitor.setAssistantVisible(true);
// THEN request unlock with keyguard dismissal
verify(mTrustManager).reportUserRequestedUnlock(eq(KeyguardUpdateMonitor.getCurrentUser()),
eq(true));
}
@Test
public void fingerprintFailure_requestActiveUnlock_dismissKeyguard()
throws RemoteException {