use of android.hardware.fingerprint.FingerprintManager.EnrollmentCallback in project android_packages_apps_Settings by crdroidandroid.
the class FingerprintEnrollFindSensorTest method enrollFingerprint_shouldProceed.
@Test
public void enrollFingerprint_shouldProceed() {
EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
enrollmentCallback.onEnrollmentProgress(123);
enrollmentCallback.onEnrollmentError(FingerprintManager.FINGERPRINT_ERROR_CANCELED, "test");
ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity).named("Next activity 1").isNotNull();
assertThat(startedActivity.intent.getComponent()).isEqualTo(new ComponentName(application, FingerprintEnrollEnrolling.class));
}
use of android.hardware.fingerprint.FingerprintManager.EnrollmentCallback in project android_packages_apps_Settings by crdroidandroid.
the class FingerprintEnrollFindSensorTest method enrollFingerprintTwice_shouldStartOneEnrolling.
@Test
public void enrollFingerprintTwice_shouldStartOneEnrolling() {
EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
enrollmentCallback.onEnrollmentProgress(123);
// A second enroll should be a no-op
enrollmentCallback.onEnrollmentProgress(123);
ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity).named("Next activity 1").isNotNull();
assertThat(startedActivity.intent.getComponent()).isEqualTo(new ComponentName(application, FingerprintEnrollEnrolling.class));
// Should only start one next activity
assertThat(shadowActivity.getNextStartedActivityForResult()).named("Next activity 2").isNull();
}
use of android.hardware.fingerprint.FingerprintManager.EnrollmentCallback in project android_packages_apps_Settings by SudaMod.
the class FingerprintEnrollFindSensorTest method enrollFingerprintTwice_shouldStartOneEnrolling.
@Test
public void enrollFingerprintTwice_shouldStartOneEnrolling() {
EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
enrollmentCallback.onEnrollmentProgress(123);
// A second enroll should be a no-op
enrollmentCallback.onEnrollmentProgress(123);
ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity).named("Next activity 1").isNotNull();
assertThat(startedActivity.intent.getComponent()).isEqualTo(new ComponentName(application, FingerprintEnrollEnrolling.class));
// Should only start one next activity
assertThat(shadowActivity.getNextStartedActivityForResult()).named("Next activity 2").isNull();
}
use of android.hardware.fingerprint.FingerprintManager.EnrollmentCallback in project android_packages_apps_Settings by SudaMod.
the class FingerprintEnrollFindSensorTest method enrollFingerprint_shouldProceed.
@Test
public void enrollFingerprint_shouldProceed() {
EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
enrollmentCallback.onEnrollmentProgress(123);
enrollmentCallback.onEnrollmentError(FingerprintManager.FINGERPRINT_ERROR_CANCELED, "test");
ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity).named("Next activity 1").isNotNull();
assertThat(startedActivity.intent.getComponent()).isEqualTo(new ComponentName(application, FingerprintEnrollEnrolling.class));
}
use of android.hardware.fingerprint.FingerprintManager.EnrollmentCallback in project android_packages_apps_Settings by SudaMod.
the class FingerprintEnrollFindSensorTest method layoutWithoutAnimation_shouldNotCrash.
// Use a non-default resource qualifier to load the test layout in
// robotests/res/layout-mcc999/fingerprint_enroll_find_sensor. This layout is a copy of the
// regular find sensor layout, with the animation removed.
@Config(qualifiers = "mcc999")
@Test
public void layoutWithoutAnimation_shouldNotCrash() {
EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
enrollmentCallback.onEnrollmentProgress(123);
enrollmentCallback.onEnrollmentError(FingerprintManager.FINGERPRINT_ERROR_CANCELED, "test");
ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity).named("Next activity").isNotNull();
assertThat(startedActivity.intent.getComponent()).isEqualTo(new ComponentName(application, FingerprintEnrollEnrolling.class));
}
Aggregations