1/n: Update BiometricDialog (SystemUI side) with cleaner lifecycle
1) Clean up BiometricDialogImpl. As a side-effect of 2, which cleans up
the dialog lifecycle, we no longer need to have a handler here. This
greatly simplifies the code here.
2) Clean up interface between BiometricDialogImpl and the UI
(BiometricDialogView).
3) Clean up interface between BimetricService and BiometricDialogImpl.
SystemUI is now responsible for dismissing the dialog.
Test: atest BiometricDialogImplTest
Bug: 138628043
Change-Id: Ic1fea4c05c27dfc7eb6fc661f517f0380b9fff99
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/DialogViewCallback.java b/packages/SystemUI/src/com/android/systemui/biometrics/DialogViewCallback.java
index 24fd22e..acad62a 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/DialogViewCallback.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/DialogViewCallback.java
@@ -21,31 +21,22 @@
* FingerprintDialogImpl) and passed into their views (e.g. FingerprintDialogView).
*/
public interface DialogViewCallback {
- /**
- * Invoked when the user cancels authentication by tapping outside the prompt, etc. The dialog
- * should be dismissed.
- */
- void onUserCanceled();
+
+ int DISMISSED_USER_CANCELED = 1;
+ int DISMISSED_BUTTON_NEGATIVE = 2;
+ int DISMISSED_BUTTON_POSITIVE = 3;
+
+ int DISMISSED_AUTHENTICATED = 4;
+ int DISMISSED_ERROR = 5;
/**
- * Invoked when an error is shown. The dialog should be dismissed after a set amount of time.
+ * Invoked when the dialog is dismissed
+ * @param reason
*/
- void onErrorShown();
+ void onDismissed(int reason);
/**
- * Invoked when the negative button is pressed. The client should be notified and the dialog
- * should be dismissed.
- */
- void onNegativePressed();
-
- /**
- * Invoked when the positive button is pressed. The client should be notified and the dialog
- * should be dismissed.
- */
- void onPositivePressed();
-
- /**
- * Invoked when the "try again" button is pressed.
+ * Invoked when the "try again" button is clicked
*/
void onTryAgainPressed();
}