Check for null HAT and add logging

Bug: 154364967

Test: atest com.android.server.biometrics
Change-Id: I1212715828a0588adc2771fbac0b1fb68fd9e13d
Merged-In: I7dfe5dd8e740eef0fc74cd2e68a19dc35eb2c49e
This commit is contained in:
Kevin Chyn
2020-04-28 16:38:58 -07:00
parent 04369a9429
commit 937bf9be71

View File

@@ -1504,11 +1504,17 @@ public class BiometricService extends SystemService {
try {
switch (reason) {
case BiometricPrompt.DISMISSED_REASON_CREDENTIAL_CONFIRMED:
mKeyStore.addAuthToken(credentialAttestation);
if (credentialAttestation != null) {
mKeyStore.addAuthToken(credentialAttestation);
} else {
Slog.e(TAG, "Credential confirmed but attestation is null");
}
case BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRMED:
case BiometricPrompt.DISMISSED_REASON_BIOMETRIC_CONFIRM_NOT_REQUIRED:
if (mCurrentAuthSession.mTokenEscrow != null) {
mKeyStore.addAuthToken(mCurrentAuthSession.mTokenEscrow);
} else {
Slog.e(TAG, "mTokenEscrow is null");
}
mCurrentAuthSession.mClientReceiver.onAuthenticationSucceeded(
Utils.getAuthenticationTypeForResult(reason));