3/n: Move task stack listener to SystemUI
Simplifies the dismissal of the dialog, and allows for better
synchronization of when the client should receive the error. The only time
that BiometricService should dismiss the dialog is when authentication
is canceled due to another client, which is almost always due to
allowed-but-weird app behavior.
Bug: 135082347
Test: atest BiometricServiceTest
Test: atest BiometricDialogImplTest
Test: atest CommandQueueTest
Change-Id: I10daa798115e51af8a854759e30033c28e6636ba
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/DialogViewCallback.java b/packages/SystemUI/src/com/android/systemui/biometrics/DialogViewCallback.java
index acad62a..b65d1e8 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/DialogViewCallback.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/DialogViewCallback.java
@@ -16,6 +16,8 @@
package com.android.systemui.biometrics;
+import android.annotation.IntDef;
+
/**
* Callback interface for dialog views. These should be implemented by the controller (e.g.
* FingerprintDialogImpl) and passed into their views (e.g. FingerprintDialogView).
@@ -28,12 +30,21 @@
int DISMISSED_AUTHENTICATED = 4;
int DISMISSED_ERROR = 5;
+ int DISMISSED_BY_SYSTEM_SERVER = 6;
+
+ @IntDef({DISMISSED_USER_CANCELED,
+ DISMISSED_BUTTON_NEGATIVE,
+ DISMISSED_BUTTON_POSITIVE,
+ DISMISSED_AUTHENTICATED,
+ DISMISSED_ERROR,
+ DISMISSED_BY_SYSTEM_SERVER})
+ @interface DismissedReason {}
/**
* Invoked when the dialog is dismissed
* @param reason
*/
- void onDismissed(int reason);
+ void onDismissed(@DismissedReason int reason);
/**
* Invoked when the "try again" button is clicked