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

Commit 5364c5c4 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Stop face auth requests when users are typing" into qt-qpr1-dev

parents 22331640 ccf6721e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -253,6 +253,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
    protected void onUserInput() {
        if (mCallback != null) {
            mCallback.userActivity();
            mCallback.onUserInput();
        }
        mSecurityMessageDisplay.setMessage("");
    }
+2 −0
Original line number Diff line number Diff line
@@ -274,6 +274,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
        @Override
        public void onPatternCellAdded(List<LockPatternView.Cell> pattern) {
            mCallback.userActivity();
            mCallback.onUserInput();
        }

        @Override
@@ -336,6 +337,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
                    });
            if (pattern.size() > MIN_PATTERN_BEFORE_POKE_WAKELOCK) {
                mCallback.userActivity();
                mCallback.onUserInput();
            }
        }

+5 −0
Original line number Diff line number Diff line
@@ -55,4 +55,9 @@ public interface KeyguardSecurityCallback {
    default void onCancelClicked() {
        // No-op
    }

    /**
     * Invoked whenever users are typing their password or drawing a pattern.
     */
    void onUserInput();
}
+7 −0
Original line number Diff line number Diff line
@@ -596,6 +596,11 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
            }
        }

        @Override
        public void onUserInput() {
            mUpdateMonitor.cancelFaceAuth();
        }

        public void dismiss(boolean authenticated, int targetId) {
            mSecurityCallback.dismiss(authenticated, targetId);
        }
@@ -640,6 +645,8 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
        @Override
        public void dismiss(boolean securityVerified, int targetUserId) { }
        @Override
        public void onUserInput() { }
        @Override
        public void reset() {}
    };

+7 −0
Original line number Diff line number Diff line
@@ -1641,6 +1641,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        updateFaceListeningState();
    }

    /**
     * In case face auth is running, cancel it.
     */
    public void cancelFaceAuth() {
        stopListeningForFace();
    }

    private void updateFaceListeningState() {
        // If this message exists, we should not authenticate again until this message is
        // consumed by the handler