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

Commit d76e83d6 authored by Helen Qin's avatar Helen Qin
Browse files

[CredManUi] Show provider name in get flow.

Also change the separator from " - " to "•" according to the spec.

Bug: 267814761
Test: manual (see screenshot in bug)
Change-Id: I26596afca23c9ab16bbf74b8da40b11a563bef83
parent 279661f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@
  <!-- This is a label for a button that takes user to the next screen. [CHAR LIMIT=20] -->
  <string name="get_dialog_button_label_continue">Continue</string>
  <!-- Separator for sign-in type and username in a sign-in entry. -->
  <string name="get_dialog_sign_in_type_username_separator" translatable="false">" - "</string>
  <string name="get_dialog_sign_in_type_username_separator" translatable="false">"  "</string>
  <!-- This text is followed by a list of one or more options. [CHAR LIMIT=80] -->
  <string name="get_dialog_title_sign_in_options">Sign-in options</string>
  <!-- Column heading for displaying sign-ins for a specific username. [CHAR LIMIT=80] -->
+8 −1
Original line number Diff line number Diff line
@@ -149,7 +149,10 @@ class GetFlowUtils {
                        icon = providerIcon,
                        displayName = providerLabel,
                        credentialEntryList = getCredentialOptionInfoList(
                            it.providerFlattenedComponentName, it.credentialEntries, context
                            providerId = it.providerFlattenedComponentName,
                            providerLabel = providerLabel,
                            credentialEntries = it.credentialEntries,
                            context = context
                        ),
                        authenticationEntryList = getAuthenticationEntryList(
                            it.providerFlattenedComponentName,
@@ -202,6 +205,7 @@ class GetFlowUtils {
         */
        private fun getCredentialOptionInfoList(
            providerId: String,
            providerLabel: String,
            credentialEntries: List<Entry>,
            context: Context,
        ): List<CredentialEntryInfo> {
@@ -212,6 +216,7 @@ class GetFlowUtils {
                    is PasswordCredentialEntry -> {
                        result.add(CredentialEntryInfo(
                            providerId = providerId,
                            providerDisplayName = providerLabel,
                            entryKey = it.key,
                            entrySubkey = it.subkey,
                            pendingIntent = credentialEntry.pendingIntent,
@@ -227,6 +232,7 @@ class GetFlowUtils {
                    is PublicKeyCredentialEntry -> {
                        result.add(CredentialEntryInfo(
                            providerId = providerId,
                            providerDisplayName = providerLabel,
                            entryKey = it.key,
                            entrySubkey = it.subkey,
                            pendingIntent = credentialEntry.pendingIntent,
@@ -242,6 +248,7 @@ class GetFlowUtils {
                    is CustomCredentialEntry -> {
                        result.add(CredentialEntryInfo(
                            providerId = providerId,
                            providerDisplayName = providerLabel,
                            entryKey = it.key,
                            entrySubkey = it.subkey,
                            pendingIntent = credentialEntry.pendingIntent,
+9 −8
Original line number Diff line number Diff line
@@ -415,14 +415,15 @@ fun CredentialEntryRow(
            credentialEntryInfo.credentialType == CredentialType.PASSWORD) {
            "••••••••••••"
        } else {
            if (TextUtils.isEmpty(credentialEntryInfo.displayName))
                credentialEntryInfo.credentialTypeDisplayName
            else
                credentialEntryInfo.credentialTypeDisplayName +
                    stringResource(
                        R.string.get_dialog_sign_in_type_username_separator
                    ) +
                    credentialEntryInfo.displayName
            val itemsToDisplay = listOf(
                credentialEntryInfo.displayName,
                credentialEntryInfo.credentialTypeDisplayName,
                credentialEntryInfo.providerDisplayName
            ).filterNot(TextUtils::isEmpty)
            if (itemsToDisplay.isEmpty()) null
            else itemsToDisplay.joinToString(
                separator = stringResource(R.string.get_dialog_sign_in_type_username_separator)
            )
        },
    )
}
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ class CredentialEntryInfo(
    val credentialType: CredentialType,
    /** Localized type value of this credential used for display purpose. */
    val credentialTypeDisplayName: String,
    val providerDisplayName: String,
    val userName: String,
    val displayName: String?,
    val icon: Drawable?,