diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2023-04-14 00:27:23 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2023-04-14 00:27:23 -0700 |
commit | 308c98f901f540b2a61bde5363434d613b27fd0b (patch) | |
tree | a009a2d5eb74f021d5f20fbb36c221a124def03d /packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java | |
parent | b77f39e30b9df5c24ec1d8428bf1b5f2946560b5 (diff) | |
parent | 5a47c505d9dd08c276dad9d6fbd157f7207fbb56 (diff) |
Merge 5a47c505d9dd08c276dad9d6fbd157f7207fbb56 on remote branch
Change-Id: Ic8a4252f1c0cdf4a82e9dadcce37606fdcaa68cd
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java index db64f05ccbea..d4ca8e34fb32 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java @@ -21,7 +21,6 @@ import android.content.res.ColorStateList; import android.content.res.Resources; import android.media.AudioManager; import android.os.SystemClock; -import android.service.trust.TrustAgentService; import android.telephony.TelephonyManager; import android.util.Log; import android.util.MathUtils; @@ -68,30 +67,28 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> private final KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() { @Override - 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() || temporaryAndRenewable) - && (bouncerVisible || dismissKeyguard)) { - if (!bouncerVisible) { - // The trust agent dismissed the keyguard without the user proving - // that they are present (by swiping up to show the bouncer). That's - // fine if the user proved presence via some other way to the trust - //agent. - Log.i(TAG, "TrustAgent dismissed Keyguard."); - } - mSecurityCallback.dismiss(false /* authenticated */, userId, - /* bypassSecondaryLockScreen */ false, SecurityMode.Invalid); - } else { + public void onTrustGrantedForCurrentUser( + boolean dismissKeyguard, + boolean newlyUnlocked, + TrustGrantFlags flags, + String message + ) { + if (dismissKeyguard) { + if (!mView.isVisibleToUser()) { + // The trust agent dismissed the keyguard without the user proving + // that they are present (by swiping up to show the bouncer). That's + // fine if the user proved presence via some other way to the trust + // agent. + Log.i(TAG, "TrustAgent dismissed Keyguard."); + } + mSecurityCallback.dismiss( + false /* authenticated */, + KeyguardUpdateMonitor.getCurrentUser(), + /* bypassSecondaryLockScreen */ false, + SecurityMode.Invalid + ); + } else { + if (flags.isInitiatedByUser() || flags.dismissKeyguardRequested()) { mViewMediatorCallback.playTrustedSound(); } } |