Fix back navigation in biometric enrollment.

Using the back buttons can cause a crash in at least two cases. Skipping
face enrollment and then starting/stopping any enrollment can lead to
an invalid token and failed HAT request. Backing out of the activity and
restarting it can also lead to using a stale token that fails.

Fix: 179336333
Test: manual on device
Change-Id: I0c1133e4c3d9c97997043ddc9374aa3cfc4f1c97
This commit is contained in:
Joe Bolinger
2021-05-04 10:35:24 -07:00
parent cc28a0826e
commit 43d978bd7b
5 changed files with 16 additions and 14 deletions

View File

@@ -77,12 +77,14 @@ public class MultiBiometricEnrollHelper {
if (mRequestEnrollFingerprint) {
// Give FaceEnroll a pendingIntent pointing to fingerprint enrollment, so that it
// can be started when user skips or finishes face enrollment.
// can be started when user skips or finishes face enrollment. FLAG_UPDATE_CURRENT
// ensures it is launched with the most recent values.
final Intent fpIntent = BiometricUtils.getFingerprintIntroIntent(mActivity,
mActivity.getIntent());
fpIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_GK_PW_HANDLE, mGkPwHandle);
final PendingIntent fpAfterFaceIntent = PendingIntent.getActivity(mActivity,
0 /* requestCode */, fpIntent, PendingIntent.FLAG_IMMUTABLE);
0 /* requestCode */, fpIntent,
PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
faceIntent.putExtra(EXTRA_ENROLL_AFTER_FACE, fpAfterFaceIntent);
}