diff options
4 files changed, 16 insertions, 4 deletions
diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollBase.java b/src/com/android/settings/fingerprint/FingerprintEnrollBase.java index 233f774..430f220 100644 --- a/src/com/android/settings/fingerprint/FingerprintEnrollBase.java +++ b/src/com/android/settings/fingerprint/FingerprintEnrollBase.java @@ -48,6 +48,12 @@ public class FingerprintEnrollBase extends Activity implements View.OnClickListe */ protected static final int RESULT_FINISHED = RESULT_FIRST_USER; + /** + * Used by the enrolling screen during setup wizard to skip over setting up fingerprint, which + * will be useful if the user accidentally entered this flow. + */ + protected static final int RESULT_SKIP = RESULT_FIRST_USER + 1; + protected byte[] mToken; @Override diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java b/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java index 1d9d1c5..bbed42c 100644 --- a/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java +++ b/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java @@ -76,6 +76,9 @@ public class FingerprintEnrollFindSensor extends FingerprintEnrollBase { if (resultCode == RESULT_FINISHED) { setResult(RESULT_FINISHED); finish(); + } else if (resultCode == RESULT_SKIP) { + setResult(RESULT_SKIP); + finish(); } else { FingerprintManager fpm = getSystemService(FingerprintManager.class); int enrolled = fpm.getEnrolledFingerprints().size(); diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollFinish.java b/src/com/android/settings/fingerprint/FingerprintEnrollFinish.java index 7ce340d..29f14d7 100644 --- a/src/com/android/settings/fingerprint/FingerprintEnrollFinish.java +++ b/src/com/android/settings/fingerprint/FingerprintEnrollFinish.java @@ -17,6 +17,7 @@ package com.android.settings.fingerprint; import android.content.Context; +import android.content.Intent; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.FingerprintManager; import android.os.Bundle; @@ -62,7 +63,9 @@ public class FingerprintEnrollFinish extends FingerprintEnrollBase { @Override public void onClick(View v) { if (v.getId() == R.id.add_another_button) { - startActivity(getEnrollingIntent()); + final Intent intent = getEnrollingIntent(); + intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT); + startActivity(intent); finish(); } super.onClick(v); diff --git a/src/com/android/settings/fingerprint/SetupFingerprintEnrollEnrolling.java b/src/com/android/settings/fingerprint/SetupFingerprintEnrollEnrolling.java index 37c13e8..0de1718 100644 --- a/src/com/android/settings/fingerprint/SetupFingerprintEnrollEnrolling.java +++ b/src/com/android/settings/fingerprint/SetupFingerprintEnrollEnrolling.java @@ -52,8 +52,7 @@ public class SetupFingerprintEnrollEnrolling extends FingerprintEnrollEnrolling final NavigationBar navigationBar = getNavigationBar(); navigationBar.setNavigationBarListener(this); - // Enrolling screen auto-advances once the fingerprint is added - navigationBar.getNextButton().setEnabled(false); + navigationBar.getNextButton().setText(R.string.skip_label); } @Override @@ -68,6 +67,7 @@ public class SetupFingerprintEnrollEnrolling extends FingerprintEnrollEnrolling @Override public void onNavigateNext() { - onNextButtonClick(); + setResult(RESULT_SKIP); + finish(); } } |