Bug fixes for the create flow auto select.

1. Create flow auto select should trigger regardless of remote entry's presence
2. Parsing of the password & passkey requires a jetpack update. For this
   current release, will manually parse.

Test: manual (see bug for recording)
Bug: 281726583
Change-Id: I69d57f7ae38eb6f7dc3ba914ddc739888e83ef1e
This commit is contained in:
Helen Qin
2023-05-10 01:46:52 +00:00
parent 030bd47ce9
commit 8e7b11c5db
3 changed files with 10 additions and 3 deletions

View File

@@ -483,7 +483,10 @@ class CreateFlowUtils {
createCredentialRequestJetpack.preferImmediatelyAvailableCredentials,
appPreferredDefaultProviderId = appPreferredDefaultProviderId,
userSetDefaultProviderIds = requestInfo.defaultProviderIds.toSet(),
isAutoSelectRequest = createCredentialRequestJetpack.isAutoSelectAllowed,
// The jetpack library requires a fix to parse this value correctly for
// the password type. For now, directly parse it ourselves.
isAutoSelectRequest = createCredentialRequest.credentialData.getBoolean(
Constants.BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS, false),
)
is CreatePublicKeyCredentialRequest -> {
newRequestDisplayInfoFromPasskeyJson(
@@ -494,7 +497,10 @@ class CreateFlowUtils {
createCredentialRequestJetpack.preferImmediatelyAvailableCredentials,
appPreferredDefaultProviderId = appPreferredDefaultProviderId,
userSetDefaultProviderIds = requestInfo.defaultProviderIds.toSet(),
isAutoSelectRequest = createCredentialRequestJetpack.isAutoSelectAllowed,
// The jetpack library requires a fix to parse this value correctly for
// the passkey type. For now, directly parse it ourselves.
isAutoSelectRequest = createCredentialRequest.credentialData.getBoolean(
Constants.BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS, false),
)
}
is CreateCustomCredentialRequest -> {

View File

@@ -19,5 +19,7 @@ package com.android.credentialmanager.common
class Constants {
companion object Constants {
const val LOG_TAG = "CredentialSelector"
const val BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS =
"androidx.credentials.BUNDLE_KEY_IS_AUTO_SELECT_ALLOWED"
}
}

View File

@@ -42,7 +42,6 @@ internal fun isFlowAutoSelectable(
// applicable.
uiState.currentScreenState != CreateScreenState.PASSKEY_INTRO &&
uiState.currentScreenState != CreateScreenState.MORE_ABOUT_PASSKEYS_INTRO &&
uiState.remoteEntry == null &&
uiState.sortedCreateOptionsPairs.size == 1 &&
uiState.activeEntry?.activeEntryInfo?.let {
it is CreateOptionInfo && it.allowAutoSelect