Handle fp enrollment errors more gracefully

- When finger can't be analyzed for enrollment
(FINGERPRINT_ERROR_UNABLE_TO_PROCESS), tell the user
to try again or use a different finger.
- When timeout is reached (FINGERPRINT_ERROR_TIMEOUT),
stop enrollment and ask the user to try again.

Fixes bug 23546104
Fixes bug 22708384

Change-Id: I879874b53dd0d928093fab1c92d0d4d68d73be28
This commit is contained in:
Jim Miller
2015-09-02 14:00:50 -07:00
parent b83cbe202b
commit 457904634c
6 changed files with 104 additions and 23 deletions

View File

@@ -70,8 +70,9 @@ import java.util.List;
* Settings screen for fingerprints
*/
public class FingerprintSettings extends SubSettings {
/**
* Used by the FP settings wizard to indicate the wizard is
* Used by the choose fingerprint wizard to indicate the wizard is
* finished, and each activity in the wizard should finish.
* <p>
* Previously, each activity in the wizard would finish itself after
@@ -79,7 +80,21 @@ public class FingerprintSettings extends SubSettings {
* behavior. So, now an activity does not finish itself until it gets this
* result.
*/
static final int RESULT_FINISHED = RESULT_FIRST_USER;
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;
/**
* Like {@link #RESULT_FINISHED} except this one indicates enrollment failed because the
* device was left idle. This is used to clear the credential token to require the user to
* re-enter their pin/pattern/password before continuing.
*/
protected static final int RESULT_TIMEOUT = RESULT_FIRST_USER + 2;
private static final long LOCKOUT_DURATION = 30000; // time we have to wait for fp to reset, ms
@Override
@@ -441,6 +456,12 @@ public class FingerprintSettings extends SubSettings {
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
}
}
} else if (requestCode == ADD_FINGERPRINT_REQUEST) {
if (resultCode == RESULT_TIMEOUT) {
Activity activity = getActivity();
activity.setResult(RESULT_TIMEOUT);
activity.finish();
}
}
if (mToken == null) {