Merge "Postpone call to postEnroll() until we actually leave activity." into mnc-dev

This commit is contained in:
Jim Miller
2015-07-14 21:02:00 +00:00
committed by Android (Google) Code Review

View File

@@ -141,6 +141,7 @@ public class FingerprintSettings extends SubSettings {
mHandler.obtainMessage(MSG_FINGER_AUTH_SUCCESS, fingerId, 0).sendToTarget(); mHandler.obtainMessage(MSG_FINGER_AUTH_SUCCESS, fingerId, 0).sendToTarget();
} }
@Override
public void onAuthenticationFailed() { public void onAuthenticationFailed() {
mHandler.obtainMessage(MSG_FINGER_AUTH_FAIL).sendToTarget(); mHandler.obtainMessage(MSG_FINGER_AUTH_FAIL).sendToTarget();
}; };
@@ -174,6 +175,7 @@ public class FingerprintSettings extends SubSettings {
} }
}; };
private final Handler mHandler = new Handler() { private final Handler mHandler = new Handler() {
@Override
public void handleMessage(android.os.Message msg) { public void handleMessage(android.os.Message msg) {
switch (msg.what) { switch (msg.what) {
case MSG_REFRESH_FINGERPRINT_TEMPLATES: case MSG_REFRESH_FINGERPRINT_TEMPLATES:
@@ -431,8 +433,6 @@ public class FingerprintSettings extends SubSettings {
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN); ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
} }
} }
} else if (requestCode == ADD_FINGERPRINT_REQUEST) {
int result = mFingerprintManager.postEnroll();
} }
if (mToken == null) { if (mToken == null) {
@@ -441,6 +441,15 @@ 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);
}
}
private Drawable getHighlightDrawable() { private Drawable getHighlightDrawable() {
if (mHighlightDrawable == null) { if (mHighlightDrawable == null) {
final Activity activity = getActivity(); final Activity activity = getActivity();