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

@@ -205,7 +205,7 @@ public class FaceSettings extends DashboardFragment {
// Generate challenge in onResume instead of onCreate, since FaceSettings can be
// created while Keyguard is showing, in which case the resetLockout revokeChallenge
// will invalidate the too-early created challenge here.
final long challenge = mFaceManager.generateChallenge();
final long challenge = mFaceManager.generateChallengeBlocking();
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
mConfirmingPassword = true;
@@ -266,10 +266,7 @@ public class FaceSettings extends DashboardFragment {
&& !mConfirmingPassword) {
// Revoke challenge and finish
if (mToken != null) {
final int result = mFaceManager.revokeChallenge();
if (result < 0) {
Log.w(TAG, "revokeChallenge failed, result: " + result);
}
mFaceManager.revokeChallenge();
mToken = null;
}
finish();