We don't want the bouncer to be dismissed right under the user's finger
when typing.
Let's abort face auth after we start typing.
Test: solve challenge when face auth is running
Test: repeat for pin/pattern/password
Fixes:
136525169
Change-Id: I8f1ccbca4be9c84f5cb108618b84aefe03b74cc4
protected void onUserInput() {
if (mCallback != null) {
mCallback.userActivity();
+ mCallback.onUserInput();
}
mSecurityMessageDisplay.setMessage("");
}
@Override
public void onPatternCellAdded(List<LockPatternView.Cell> pattern) {
mCallback.userActivity();
+ mCallback.onUserInput();
}
@Override
});
if (pattern.size() > MIN_PATTERN_BEFORE_POKE_WAKELOCK) {
mCallback.userActivity();
+ mCallback.onUserInput();
}
}
default void onCancelClicked() {
// No-op
}
+
+ /**
+ * Invoked whenever users are typing their password or drawing a pattern.
+ */
+ void onUserInput();
}
}
}
+ @Override
+ public void onUserInput() {
+ mUpdateMonitor.cancelFaceAuth();
+ }
+
public void dismiss(boolean authenticated, int targetId) {
mSecurityCallback.dismiss(authenticated, targetId);
}
@Override
public void dismiss(boolean securityVerified, int targetUserId) { }
@Override
+ public void onUserInput() { }
+ @Override
public void reset() {}
};
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