diff options
author | Alexander Martinz <eviscerationls@gmail.com> | 2016-01-27 23:11:49 +0100 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2016-01-28 14:12:57 -0800 |
commit | c5ff8dfbac6136ebee6672a6b0729b320937ab5c (patch) | |
tree | e4830f2b7d6e291496e9fc21b206f6c210183ea4 /src/com/android/settings/fingerprint | |
parent | de00b259e09ef9c1c6b79082776f6163dd148e6d (diff) | |
download | packages_apps_Settings-c5ff8dfbac6136ebee6672a6b0729b320937ab5c.tar.gz packages_apps_Settings-c5ff8dfbac6136ebee6672a6b0729b320937ab5c.tar.bz2 packages_apps_Settings-c5ff8dfbac6136ebee6672a6b0729b320937ab5c.zip |
Fingerprint: do not error out when stopping to listen
* when stopListening gets called, we cancel via the cancellation signal,
which calls the onAuthenticationError callback.
* detect if we are canceling and do not execute the error code
* fixes the finger print icon hiding when closing the LockPatternActivity,
which causes the lock pattern to resize
TICKET: RM-208
Change-Id: I5bb62064f885b67836bd78af854cca950c3401fa
Signed-off-by: Alexander Martinz <eviscerationls@gmail.com>
Diffstat (limited to 'src/com/android/settings/fingerprint')
-rw-r--r-- | src/com/android/settings/fingerprint/FingerprintUiHelper.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/settings/fingerprint/FingerprintUiHelper.java b/src/com/android/settings/fingerprint/FingerprintUiHelper.java index 07776f785..7c519fea5 100644 --- a/src/com/android/settings/fingerprint/FingerprintUiHelper.java +++ b/src/com/android/settings/fingerprint/FingerprintUiHelper.java @@ -42,6 +42,8 @@ public class FingerprintUiHelper extends FingerprintManager.AuthenticationCallba private boolean mDark; private String mIdleText; + private boolean mCanceledBySelf; + public FingerprintUiHelper(ImageView icon, TextView errorTextView, Callback callback) { mFingerprintManager = icon.getContext().getSystemService(FingerprintManager.class); mIcon = icon; @@ -52,6 +54,7 @@ public class FingerprintUiHelper extends FingerprintManager.AuthenticationCallba public void startListening() { if (mFingerprintManager.getEnrolledFingerprints().size() > 0) { + mCanceledBySelf = false; mCancellationSignal = new CancellationSignal(); mFingerprintManager.authenticate(null, mCancellationSignal, 0 /* flags */, this, null); setFingerprintIconVisibility(true); @@ -61,6 +64,7 @@ public class FingerprintUiHelper extends FingerprintManager.AuthenticationCallba } public void stopListening() { + mCanceledBySelf = true; if (mCancellationSignal != null) { mCancellationSignal.cancel(); mCancellationSignal = null; @@ -86,8 +90,10 @@ public class FingerprintUiHelper extends FingerprintManager.AuthenticationCallba @Override public void onAuthenticationError(int errMsgId, CharSequence errString) { - showError(errString); - setFingerprintIconVisibility(false); + if (!mCanceledBySelf) { + showError(errString); + setFingerprintIconVisibility(false); + } } @Override |