Update Settings together with generateChallenge/revokeChallenge

The internal implementation of generate/revoke in system_server is now
asynchronous. To keep existing clients working, the manager classes
introduce a blocking version of the generateChallenge calls. This change
updates Settings to use the backward-compatible blocking calls.

Bug: 157790417

Test: Enroll fingerprint/face
Test: After enrollment, toggle setFeature or do subsequent enrollment
      in face/fingerprint settings
Change-Id: Ib4dfdc5f12530b938ab9b1745f5a19cd9e2eceee
This commit is contained in:
Kevin Chyn
2020-06-24 17:58:03 -07:00
parent 602b8573f3
commit cbe32ed1cf
8 changed files with 16 additions and 20 deletions

View File

@@ -594,10 +594,7 @@ public class FingerprintSettings extends SubSettings {
public void onDestroy() {
super.onDestroy();
if (getActivity().isFinishing()) {
int result = mFingerprintManager.postEnroll();
if (result < 0) {
Log.w(TAG, "postEnroll failed: result = " + result);
}
mFingerprintManager.revokeChallenge();
}
}
@@ -638,7 +635,7 @@ public class FingerprintSettings extends SubSettings {
private void launchChooseOrConfirmLock() {
Intent intent = new Intent();
long challenge = mFingerprintManager.preEnroll();
long challenge = mFingerprintManager.generateChallengeBlocking();
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
if (!helper.launchConfirmationActivity(CONFIRM_REQUEST,
getString(R.string.security_settings_fingerprint_preference_title),