Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1d462fb authored by Reema Bajwa's avatar Reema Bajwa
Browse files

Add auto-select bit to provider's pending intent

Bug: 285390594
Test: Built & deployed locally

Change-Id: I7bf43827585b3f4d49284ed93cfa666aa27ee367
parent cf2e7655
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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) {
+2 −1
Original line number Diff line number Diff line
@@ -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"
    }
}