diff options
author | Maurice Lam <yukl@google.com> | 2015-07-22 16:03:32 -0700 |
---|---|---|
committer | Maurice Lam <yukl@google.com> | 2015-07-22 16:51:47 -0700 |
commit | 5f8d7dbe52a7fe93fd8c8a224776914b56e12707 (patch) | |
tree | 19d8a91a7733fae837969e2c399d10e456fd9cb7 /src/com/android/settings | |
parent | 32b96646eec917987fdd38208c6b11a9bc8832d3 (diff) | |
download | packages_apps_Settings-5f8d7dbe52a7fe93fd8c8a224776914b56e12707.zip packages_apps_Settings-5f8d7dbe52a7fe93fd8c8a224776914b56e12707.tar.gz packages_apps_Settings-5f8d7dbe52a7fe93fd8c8a224776914b56e12707.tar.bz2 |
[Fingerprint] Show skip button during SUW
Show a skip button during enrolling in case the user entered the flow
accidentally. The skip button will send the result code RESULT_SKIP,
which is equal to RESULT_FIRST_USER + 1, back to the starting
activity.
Bug: 22666389
Change-Id: I230b04e5150214c31536ac282d56b7b490c85ac1
Diffstat (limited to 'src/com/android/settings')
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(); } } |