Merge "Do not crash ui app upon bad provider pending intent." into udc-dev

This commit is contained in:
Treehugger Robot
2023-05-08 04:29:32 +00:00
committed by Android (Google) Code Review

View File

@@ -119,7 +119,12 @@ class CredentialSelectorViewModel(
uiState = uiState.copy(providerActivityState = ProviderActivityState.PENDING) uiState = uiState.copy(providerActivityState = ProviderActivityState.PENDING)
val intentSenderRequest = IntentSenderRequest.Builder(entry.pendingIntent) val intentSenderRequest = IntentSenderRequest.Builder(entry.pendingIntent)
.setFillInIntent(entry.fillInIntent).build() .setFillInIntent(entry.fillInIntent).build()
try {
launcher.launch(intentSenderRequest) launcher.launch(intentSenderRequest)
} catch (e: Exception) {
Log.w(Constants.LOG_TAG, "Failed to launch provider UI: $e")
onInternalError()
}
} else { } else {
Log.d(Constants.LOG_TAG, "No provider UI to launch") Log.d(Constants.LOG_TAG, "No provider UI to launch")
onInternalError() onInternalError()