[BiometricsV2] IconTouchDialog continue enroll

When user clicks "OK" in FingerprintEnrollEnrollingIconTouchDialog,
continue enrolling.

Bug: 276416053
Test: atest FingerprintEnrollEnrollingViewModelTest
      FingerprintEnrollmentActivityTest
Test: Manually check enrolling status as clicking "OK" button on
      FingerprintEnrollEnrollingIconTouchDialog after enabling
      biometrics v2 v2 through feature flag.
Change-Id: I028723acfe35e5119e43b6860022c7432fc2ae0e
This commit is contained in:
Milton Wu
2023-04-10 22:28:50 +08:00
parent 3f16621b86
commit 15267aab1f
5 changed files with 147 additions and 81 deletions

View File

@@ -60,25 +60,19 @@ public class FingerprintEnrollEnrollingViewModel extends AndroidViewModel {
*/
public static final int FINGERPRINT_ENROLL_ENROLLING_ACTION_SHOW_ICON_TOUCH_DIALOG = 1;
/**
* Icon touch dialog dismiss
*/
public static final int FINGERPRINT_ENROLL_ENROLLING_ACTION_DISMISS_ICON_TOUCH_DIALOG = 2;
/**
* Has got latest cancelled event due to user skip
*/
public static final int FINGERPRINT_ENROLL_ENROLLING_CANCELED_BECAUSE_USER_SKIP = 3;
public static final int FINGERPRINT_ENROLL_ENROLLING_CANCELED_BECAUSE_USER_SKIP = 2;
/**
* Has got latest cancelled event due to back key
*/
public static final int FINGERPRINT_ENROLL_ENROLLING_CANCELED_BECAUSE_BACK_PRESSED = 4;
public static final int FINGERPRINT_ENROLL_ENROLLING_CANCELED_BECAUSE_BACK_PRESSED = 3;
@IntDef(prefix = { "FINGERPRINT_ENROLL_ENROLLING_ACTION_" }, value = {
FINGERPRINT_ENROLL_ENROLLING_ACTION_DONE,
FINGERPRINT_ENROLL_ENROLLING_ACTION_SHOW_ICON_TOUCH_DIALOG,
FINGERPRINT_ENROLL_ENROLLING_ACTION_DISMISS_ICON_TOUCH_DIALOG,
FINGERPRINT_ENROLL_ENROLLING_CANCELED_BECAUSE_USER_SKIP,
FINGERPRINT_ENROLL_ENROLLING_CANCELED_BECAUSE_BACK_PRESSED
})
@@ -116,7 +110,6 @@ public class FingerprintEnrollEnrollingViewModel extends AndroidViewModel {
private final Vibrator mVibrator;
private final MutableLiveData<Integer> mActionLiveData = new MutableLiveData<>();
private final MutableLiveData<Integer> mIconTouchDialogLiveData = new MutableLiveData<>();
private final MutableLiveData<ErrorDialogData> mErrorDialogLiveData = new MutableLiveData<>();
private final MutableLiveData<Integer> mErrorDialogActionLiveData = new MutableLiveData<>();
@@ -233,17 +226,6 @@ public class FingerprintEnrollEnrollingViewModel extends AndroidViewModel {
mActionLiveData.postValue(action);
}
/**
* Icon touch dialog dismiss
*/
public void onIconTouchDialogDismiss() {
final int action = FINGERPRINT_ENROLL_ENROLLING_ACTION_DISMISS_ICON_TOUCH_DIALOG;
if (DEBUG) {
Log.d(TAG, "onIconTouchDialogDismiss, post action " + action);
}
mActionLiveData.postValue(action);
}
/**
* get enroll stage threshold
*/