Loading packages/CredentialManager/src/com/android/credentialmanager/common/BiometricHandler.kt +13 −7 Original line number Diff line number Diff line Loading @@ -98,7 +98,8 @@ fun runBiometricFlow( context: Context, openMoreOptionsPage: () -> Unit, sendDataToProvider: (EntryInfo, BiometricPrompt.AuthenticationResult) -> Unit, onCancelFlowAndFinish: (String) -> Unit, onCancelFlowAndFinish: () -> Unit, onIllegalStateAndFinish: (String) -> Unit, getRequestDisplayInfo: RequestDisplayInfo? = null, getProviderInfoList: List<ProviderInfo>? = null, getProviderDisplayInfo: ProviderDisplayInfo? = null, Loading Loading @@ -131,7 +132,7 @@ fun runBiometricFlow( val callback: BiometricPrompt.AuthenticationCallback = setupBiometricAuthenticationCallback(sendDataToProvider, biometricEntry, onCancelFlowAndFinish) onCancelFlowAndFinish, onIllegalStateAndFinish) val cancellationSignal = CancellationSignal() cancellationSignal.setOnCancelListener { Loading Loading @@ -211,7 +212,8 @@ private fun removeDeviceCredential(requestAllowedAuthenticators: Int): Int { private fun setupBiometricAuthenticationCallback( sendDataToProvider: (EntryInfo, BiometricPrompt.AuthenticationResult) -> Unit, selectedEntry: EntryInfo, onCancelFlowAndFinish: (String) -> Unit onCancelFlowAndFinish: () -> Unit, onIllegalStateAndFinish: (String) -> Unit, ): BiometricPrompt.AuthenticationCallback { val callback: BiometricPrompt.AuthenticationCallback = object : BiometricPrompt.AuthenticationCallback() { Loading @@ -224,14 +226,12 @@ private fun setupBiometricAuthenticationCallback( if (authResult != null) { sendDataToProvider(selectedEntry, authResult) } else { onCancelFlowAndFinish("The biometric flow succeeded but unexpectedly " + onIllegalStateAndFinish("The biometric flow succeeded but unexpectedly " + "returned a null value.") // TODO(b/326243754) : Propagate to provider } } catch (e: Exception) { onCancelFlowAndFinish("The biometric flow succeeded but failed on handling " + onIllegalStateAndFinish("The biometric flow succeeded but failed on handling " + "the result. See: \n$e\n") // TODO(b/326243754) : Propagate to provider } } Loading @@ -245,6 +245,12 @@ private fun setupBiometricAuthenticationCallback( override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) { super.onAuthenticationError(errorCode, errString) Log.d(TAG, "Authentication error-ed out: $errorCode and $errString") if (errorCode == BiometricPrompt.BIOMETRIC_ERROR_USER_CANCELED) { // Note that because the biometric prompt is imbued directly // into the selector, parity applies to the selector's cancellation instead // of the provider's biometric prompt cancellation. onCancelFlowAndFinish() } // TODO(b/326243754) : Propagate to provider } Loading packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt +5 −2 Original line number Diff line number Diff line Loading @@ -148,7 +148,8 @@ fun GetCredentialScreen( // activeEntry will always be what represents the single tap flow biometricEntry = getCredentialUiState.activeEntry, onMoreOptionSelected = viewModel::getFlowOnMoreOptionSelected, onCancelFlowAndFinish = viewModel::onIllegalUiState, onCancelFlowAndFinish = viewModel::onUserCancel, onIllegalStateAndFinish = viewModel::onIllegalUiState, requestDisplayInfo = getCredentialUiState.requestDisplayInfo, providerInfoList = getCredentialUiState.providerInfoList, providerDisplayInfo = getCredentialUiState.providerDisplayInfo, Loading Loading @@ -212,7 +213,8 @@ fun GetCredentialScreen( @Composable internal fun BiometricSelectionPage( biometricEntry: EntryInfo?, onCancelFlowAndFinish: (String) -> Unit, onCancelFlowAndFinish: () -> Unit, onIllegalStateAndFinish: (String) -> Unit, onMoreOptionSelected: () -> Unit, requestDisplayInfo: RequestDisplayInfo, providerInfoList: List<ProviderInfo>, Loading @@ -230,6 +232,7 @@ internal fun BiometricSelectionPage( openMoreOptionsPage = onMoreOptionSelected, sendDataToProvider = onBiometricEntrySelected, onCancelFlowAndFinish = onCancelFlowAndFinish, onIllegalStateAndFinish = onIllegalStateAndFinish, getRequestDisplayInfo = requestDisplayInfo, getProviderInfoList = providerInfoList, getProviderDisplayInfo = providerDisplayInfo, Loading Loading
packages/CredentialManager/src/com/android/credentialmanager/common/BiometricHandler.kt +13 −7 Original line number Diff line number Diff line Loading @@ -98,7 +98,8 @@ fun runBiometricFlow( context: Context, openMoreOptionsPage: () -> Unit, sendDataToProvider: (EntryInfo, BiometricPrompt.AuthenticationResult) -> Unit, onCancelFlowAndFinish: (String) -> Unit, onCancelFlowAndFinish: () -> Unit, onIllegalStateAndFinish: (String) -> Unit, getRequestDisplayInfo: RequestDisplayInfo? = null, getProviderInfoList: List<ProviderInfo>? = null, getProviderDisplayInfo: ProviderDisplayInfo? = null, Loading Loading @@ -131,7 +132,7 @@ fun runBiometricFlow( val callback: BiometricPrompt.AuthenticationCallback = setupBiometricAuthenticationCallback(sendDataToProvider, biometricEntry, onCancelFlowAndFinish) onCancelFlowAndFinish, onIllegalStateAndFinish) val cancellationSignal = CancellationSignal() cancellationSignal.setOnCancelListener { Loading Loading @@ -211,7 +212,8 @@ private fun removeDeviceCredential(requestAllowedAuthenticators: Int): Int { private fun setupBiometricAuthenticationCallback( sendDataToProvider: (EntryInfo, BiometricPrompt.AuthenticationResult) -> Unit, selectedEntry: EntryInfo, onCancelFlowAndFinish: (String) -> Unit onCancelFlowAndFinish: () -> Unit, onIllegalStateAndFinish: (String) -> Unit, ): BiometricPrompt.AuthenticationCallback { val callback: BiometricPrompt.AuthenticationCallback = object : BiometricPrompt.AuthenticationCallback() { Loading @@ -224,14 +226,12 @@ private fun setupBiometricAuthenticationCallback( if (authResult != null) { sendDataToProvider(selectedEntry, authResult) } else { onCancelFlowAndFinish("The biometric flow succeeded but unexpectedly " + onIllegalStateAndFinish("The biometric flow succeeded but unexpectedly " + "returned a null value.") // TODO(b/326243754) : Propagate to provider } } catch (e: Exception) { onCancelFlowAndFinish("The biometric flow succeeded but failed on handling " + onIllegalStateAndFinish("The biometric flow succeeded but failed on handling " + "the result. See: \n$e\n") // TODO(b/326243754) : Propagate to provider } } Loading @@ -245,6 +245,12 @@ private fun setupBiometricAuthenticationCallback( override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) { super.onAuthenticationError(errorCode, errString) Log.d(TAG, "Authentication error-ed out: $errorCode and $errString") if (errorCode == BiometricPrompt.BIOMETRIC_ERROR_USER_CANCELED) { // Note that because the biometric prompt is imbued directly // into the selector, parity applies to the selector's cancellation instead // of the provider's biometric prompt cancellation. onCancelFlowAndFinish() } // TODO(b/326243754) : Propagate to provider } Loading
packages/CredentialManager/src/com/android/credentialmanager/getflow/GetCredentialComponents.kt +5 −2 Original line number Diff line number Diff line Loading @@ -148,7 +148,8 @@ fun GetCredentialScreen( // activeEntry will always be what represents the single tap flow biometricEntry = getCredentialUiState.activeEntry, onMoreOptionSelected = viewModel::getFlowOnMoreOptionSelected, onCancelFlowAndFinish = viewModel::onIllegalUiState, onCancelFlowAndFinish = viewModel::onUserCancel, onIllegalStateAndFinish = viewModel::onIllegalUiState, requestDisplayInfo = getCredentialUiState.requestDisplayInfo, providerInfoList = getCredentialUiState.providerInfoList, providerDisplayInfo = getCredentialUiState.providerDisplayInfo, Loading Loading @@ -212,7 +213,8 @@ fun GetCredentialScreen( @Composable internal fun BiometricSelectionPage( biometricEntry: EntryInfo?, onCancelFlowAndFinish: (String) -> Unit, onCancelFlowAndFinish: () -> Unit, onIllegalStateAndFinish: (String) -> Unit, onMoreOptionSelected: () -> Unit, requestDisplayInfo: RequestDisplayInfo, providerInfoList: List<ProviderInfo>, Loading @@ -230,6 +232,7 @@ internal fun BiometricSelectionPage( openMoreOptionsPage = onMoreOptionSelected, sendDataToProvider = onBiometricEntrySelected, onCancelFlowAndFinish = onCancelFlowAndFinish, onIllegalStateAndFinish = onIllegalStateAndFinish, getRequestDisplayInfo = requestDisplayInfo, getProviderInfoList = providerInfoList, getProviderDisplayInfo = providerDisplayInfo, Loading