Loading packages/CredentialManager/src/com/android/credentialmanager/common/BiometricHandler.kt +13 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.content.Context import android.graphics.Bitmap import android.hardware.biometrics.BiometricManager import android.hardware.biometrics.BiometricPrompt import android.hardware.biometrics.CryptoObject import android.os.CancellationSignal import android.util.Log import androidx.core.content.ContextCompat.getMainExecutor Loading Loading @@ -221,13 +222,24 @@ private fun runBiometricFlow( val executor = getMainExecutor(context) try { val cryptoOpId = getCryptoOpId(biometricDisplayInfo) if (cryptoOpId != null) { biometricPrompt.authenticate( BiometricPrompt.CryptoObject(cryptoOpId.toLong()), cancellationSignal, executor, callback) } else { biometricPrompt.authenticate(cancellationSignal, executor, callback) } } catch (e: IllegalArgumentException) { Log.w(TAG, "Calling the biometric prompt API failed with: /n${e.localizedMessage}\n") onBiometricFailureFallback(biometricFlowType) } } private fun getCryptoOpId(biometricDisplayInfo: BiometricDisplayInfo): Int? { return biometricDisplayInfo.biometricRequestInfo.opId } /** * Sets up the biometric prompt with the UI specific bits. * // TODO(b/333445112) : Pass in opId once dependency is confirmed via CryptoObject Loading Loading
packages/CredentialManager/src/com/android/credentialmanager/common/BiometricHandler.kt +13 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.content.Context import android.graphics.Bitmap import android.hardware.biometrics.BiometricManager import android.hardware.biometrics.BiometricPrompt import android.hardware.biometrics.CryptoObject import android.os.CancellationSignal import android.util.Log import androidx.core.content.ContextCompat.getMainExecutor Loading Loading @@ -221,13 +222,24 @@ private fun runBiometricFlow( val executor = getMainExecutor(context) try { val cryptoOpId = getCryptoOpId(biometricDisplayInfo) if (cryptoOpId != null) { biometricPrompt.authenticate( BiometricPrompt.CryptoObject(cryptoOpId.toLong()), cancellationSignal, executor, callback) } else { biometricPrompt.authenticate(cancellationSignal, executor, callback) } } catch (e: IllegalArgumentException) { Log.w(TAG, "Calling the biometric prompt API failed with: /n${e.localizedMessage}\n") onBiometricFailureFallback(biometricFlowType) } } private fun getCryptoOpId(biometricDisplayInfo: BiometricDisplayInfo): Int? { return biometricDisplayInfo.biometricRequestInfo.opId } /** * Sets up the biometric prompt with the UI specific bits. * // TODO(b/333445112) : Pass in opId once dependency is confirmed via CryptoObject Loading