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

Commit 92a79033 authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Send newlyUnlocked information to KeyguardUpdateMontiorCallbacks" into tm-qpr-dev

parents 099cdc6e 57e7c16e
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