[BiometricsV2] Fix fingerprintSettings not shown

Fix "Fingerprint Unlock" page not show when 1st fingerprint is added
through biometrics v2 enrollment on a device w/ faceunlock

Do no check bundle is null or not during check activity result because
it may be null if callee activity doesn't need to pass anything back to
previous caller activity.

Bug: 286993437
Test: test this scenario on a fingerprint only device w/o v2
Test: test this scenario on a faceunlock device w/o v2
Test: test this scenario on a fingerprint only device w/ v2
Test: test this scenario on a faceunlock device w/ v2
Change-Id: Ic6168e73de378ecc1555808d4f0969f4c490a38d
This commit is contained in:
Milton Wu
2023-06-13 16:09:21 +08:00
parent c817df185e
commit 78e0f9de8a

View File

@@ -920,7 +920,7 @@ public class FingerprintSettings extends SubSettings {
activity.finish();
}
} else if (requestCode == AUTO_ADD_FIRST_FINGERPRINT_REQUEST) {
if (resultCode != RESULT_FINISHED || data == null) {
if (resultCode != RESULT_FINISHED) {
Log.d(TAG, "Add first fingerprint, fail or null data, result:" + resultCode);
if (resultCode == BiometricEnrollBase.RESULT_TIMEOUT) {
// If "Fingerprint Unlock" is closed because of timeout, notify result code
@@ -932,14 +932,19 @@ public class FingerprintSettings extends SubSettings {
return;
}
mToken = data.getByteArrayExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
if (mToken == null && data != null) {
mToken = data.getByteArrayExtra(
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
}
if (mToken == null) {
Log.w(TAG, "Add first fingerprint, null token");
finish();
return;
}
mChallenge = data.getLongExtra(EXTRA_KEY_CHALLENGE, -1L);
if (mChallenge == -1L && data != null) {
mChallenge = data.getLongExtra(EXTRA_KEY_CHALLENGE, -1L);
}
if (mChallenge == -1L) {
Log.w(TAG, "Add first fingerprint, invalid challenge");
finish();