Merge "Add auto-select bit to provider's pending intent" into udc-dev

This commit is contained in:
Reema Bajwa
2023-06-02 16:38:47 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 2 deletions

View File

@@ -118,8 +118,10 @@ class CredentialSelectorViewModel(
if (entry != null && entry.pendingIntent != null) {
Log.d(Constants.LOG_TAG, "Launching provider activity")
uiState = uiState.copy(providerActivityState = ProviderActivityState.PENDING)
val entryIntent = entry.fillInIntent
entryIntent?.putExtra(Constants.IS_AUTO_SELECTED_KEY, uiState.isAutoSelectFlow)
val intentSenderRequest = IntentSenderRequest.Builder(entry.pendingIntent)
.setFillInIntent(entry.fillInIntent).build()
.setFillInIntent(entryIntent).build()
try {
launcher.launch(intentSenderRequest)
} catch (e: Exception) {

View File

@@ -21,5 +21,6 @@ class Constants {
const val LOG_TAG = "CredentialSelector"
const val BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS =
"androidx.credentials.BUNDLE_KEY_IS_AUTO_SELECT_ALLOWED"
const val IS_AUTO_SELECTED_KEY = "IS_AUTO_SELECTED"
}
}
}