From 937bf9be71a43dbd91946ec52c1f97b1e6696733 Mon Sep 17 00:00:00 2001 From: Kevin Chyn Date: Tue, 28 Apr 2020 16:38:58 -0700 Subject: [PATCH] Check for null HAT and add logging Bug: 154364967 Test: atest com.android.server.biometrics Change-Id: I1212715828a0588adc2771fbac0b1fb68fd9e13d Merged-In: I7dfe5dd8e740eef0fc74cd2e68a19dc35eb2c49e --- .../com/android/server/biometrics/BiometricService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java index d49b590b8a4d5..70fbca5b47986 100644 --- a/services/core/java/com/android/server/biometrics/BiometricService.java +++ b/services/core/java/com/android/server/biometrics/BiometricService.java @@ -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));