OSDN Git Service

Fix fingerprint enrolling bug.
authorJim Miller <jaggies@google.com>
Fri, 31 Jul 2015 21:05:25 +0000 (14:05 -0700)
committerJim Miller <jaggies@google.com>
Fri, 31 Jul 2015 23:17:24 +0000 (23:17 +0000)
This fixes a bug where rotating the device would call post_enroll()
too early, thus invalidating the current session.

Fixes bug 22708390

Change-Id: Ib4a334b50c16630b4fe4b451f6019d41225b2011

src/com/android/settings/fingerprint/FingerprintSettings.java

index d40dc50..a5c9963 100644 (file)
@@ -451,9 +451,11 @@ public class FingerprintSettings extends SubSettings {
         @Override
         public void onDestroy() {
             super.onDestroy();
-            int result = mFingerprintManager.postEnroll();
-            if (result < 0) {
-                Log.w(TAG, "postEnroll failed: result = " + result);
+            if (getActivity().isFinishing()) {
+                int result = mFingerprintManager.postEnroll();
+                if (result < 0) {
+                    Log.w(TAG, "postEnroll failed: result = " + result);
+                }
             }
         }