Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1744e24e authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Send newlyUnlocked information to KeyguardUpdateMontiorCallbacks" into...

Merge "Send newlyUnlocked information to KeyguardUpdateMontiorCallbacks" into tm-qpr-dev am: 92a79033

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



Change-Id: Ib15d4f59370847818310c278fa07fa4380a803e9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6891c60b 92a79033
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -67,8 +67,12 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView>
    private final KeyguardUpdateMonitorCallback mUpdateCallback =
            new KeyguardUpdateMonitorCallback() {
                @Override
                public void onTrustGrantedForCurrentUser(boolean dismissKeyguard,
                        TrustGrantFlags flags, String message) {
                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
+5 −2
Original line number Diff line number Diff line
@@ -510,7 +510,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                }
            }

            mLogger.logTrustGrantedWithFlags(flags, userId, message);
            mLogger.logTrustGrantedWithFlags(flags, newlyUnlocked, userId, message);
            if (userId == getCurrentUser()) {
                final TrustGrantFlags trustGrantFlags = new TrustGrantFlags(flags);
                for (int i = 0; i < mCallbacks.size(); i++) {
@@ -518,7 +518,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                    if (cb != null) {
                        cb.onTrustGrantedForCurrentUser(
                                shouldDismissKeyguardOnTrustGrantedWithCurrentUser(trustGrantFlags),
                                trustGrantFlags, message);
                                newlyUnlocked,
                                trustGrantFlags,
                                message
                        );
                    }
                }
            }
+8 −2
Original line number Diff line number Diff line
@@ -178,11 +178,17 @@ public class KeyguardUpdateMonitorCallback {
     * Called after trust was granted.
     * @param dismissKeyguard whether the keyguard should be dismissed as a result of the
     *                        trustGranted
     * @param newlyUnlocked whether the grantedTrust is believed to be the cause of a newly
     *                      unlocked device (after being locked).
     * @param message optional message the trust agent has provided to show that should indicate
     *                why trust was granted.
     */
    public void onTrustGrantedForCurrentUser(boolean dismissKeyguard,
            @NonNull TrustGrantFlags flags, @Nullable String message) { }
    public void onTrustGrantedForCurrentUser(
            boolean dismissKeyguard,
            boolean newlyUnlocked,
            @NonNull TrustGrantFlags flags,
            @Nullable String message
    ) { }

    /**
     * Called when a biometric has been acquired.
+4 −1
Original line number Diff line number Diff line
@@ -379,14 +379,17 @@ class KeyguardUpdateMonitorLogger @Inject constructor(

    fun logTrustGrantedWithFlags(
            flags: Int,
            newlyUnlocked: Boolean,
            userId: Int,
            message: String?
    ) {
        logBuffer.log(TAG, DEBUG, {
            int1 = flags
            bool1 = newlyUnlocked
            int2 = userId
            str1 = message
        }, { "trustGrantedWithFlags[user=$int2] flags=${TrustGrantFlags(int1)} message=$str1" })
        }, { "trustGrantedWithFlags[user=$int2] newlyUnlocked=$bool1 " +
                "flags=${TrustGrantFlags(int1)} message=$str1" })
    }

    fun logTrustChanged(
+6 −2
Original line number Diff line number Diff line
@@ -1193,8 +1193,12 @@ public class KeyguardIndicationController {
        }

        @Override
        public void onTrustGrantedForCurrentUser(boolean dismissKeyguard,
                @NonNull TrustGrantFlags flags, @Nullable String message) {
        public void onTrustGrantedForCurrentUser(
                boolean dismissKeyguard,
                boolean newlyUnlocked,
                @NonNull TrustGrantFlags flags,
                @Nullable String message
        ) {
            showTrustGrantedMessage(dismissKeyguard, message);
        }

Loading