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

Commit 8e7b11c5 authored by Helen Qin's avatar Helen Qin
Browse files

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
parent 030bd47c
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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 -> {
+2 −0
Original line number Diff line number Diff line
@@ -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"
    }
}
 No newline at end of file
+0 −1
Original line number Diff line number Diff line
@@ -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