Don't require awakeKeyguard for activeUnlock

Request active unlock even when the device is on AoD/dozing.
Allow TrustAgents with FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE to
dismiss the keyguard if the device's screen isn't on.

Fixes: 231333697
Change-Id: I23cea0743c89ca6d4eb761aff12672d79a2820dc
This commit is contained in:
Beverly
2022-05-05 20:11:00 +00:00
committed by Beverly Tai
parent 5ecc0793a1
commit 8982038d26
2 changed files with 5 additions and 2 deletions

View File

@@ -71,13 +71,16 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView>
public void onTrustGrantedWithFlags(int flags, int userId) {
if (userId != KeyguardUpdateMonitor.getCurrentUser()) return;
boolean bouncerVisible = mView.isVisibleToUser();
boolean temporaryAndRenewable =
(flags & TrustAgentService.FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE)
!= 0;
boolean initiatedByUser =
(flags & TrustAgentService.FLAG_GRANT_TRUST_INITIATED_BY_USER) != 0;
boolean dismissKeyguard =
(flags & TrustAgentService.FLAG_GRANT_TRUST_DISMISS_KEYGUARD) != 0;
if (initiatedByUser || dismissKeyguard) {
if (mViewMediatorCallback.isScreenOn()
if ((mViewMediatorCallback.isScreenOn() || temporaryAndRenewable)
&& (bouncerVisible || dismissKeyguard)) {
if (!bouncerVisible) {
// The trust agent dismissed the keyguard without the user proving

View File

@@ -2405,7 +2405,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
// Triggers:
final boolean triggerActiveUnlockForAssistant = shouldTriggerActiveUnlockForAssistant();
final boolean awakeKeyguard = mBouncerFullyShown || mUdfpsBouncerShowing
|| (mKeyguardIsVisible && mDeviceInteractive && !mGoingToSleep
|| (mKeyguardIsVisible && !mGoingToSleep
&& mStatusBarState != StatusBarState.SHADE_LOCKED);
// Gates: