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

Commit 455fce97 authored by Helen Qin's avatar Helen Qin Committed by Android (Google) Code Review
Browse files

Merge "Deduplicate & group entries based on a designated dedup id (entryGroupId)" into main

parents 708711e2 d07055dd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ private fun getCredentialOptionInfoList(
                    lastUsedTimeMillis = credentialEntry.lastUsedTime,
                    isAutoSelectable = credentialEntry.isAutoSelectAllowed &&
                            credentialEntry.isAutoSelectAllowedFromOption,
                    entryGroupId = credentialEntry.entryGroupId.toString(),
                )
                )
            }
@@ -156,6 +157,7 @@ private fun getCredentialOptionInfoList(
                    lastUsedTimeMillis = credentialEntry.lastUsedTime,
                    isAutoSelectable = credentialEntry.isAutoSelectAllowed &&
                            credentialEntry.isAutoSelectAllowedFromOption,
                    entryGroupId = credentialEntry.entryGroupId.toString(),
                )
                )
            }
@@ -178,6 +180,7 @@ private fun getCredentialOptionInfoList(
                    lastUsedTimeMillis = credentialEntry.lastUsedTime,
                    isAutoSelectable = credentialEntry.isAutoSelectAllowed &&
                            credentialEntry.isAutoSelectAllowedFromOption,
                    entryGroupId = credentialEntry.entryGroupId.toString(),
                )
                )
            }
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ class CredentialEntryInfo(
    val shouldTintIcon: Boolean,
    val lastUsedTimeMillis: Instant?,
    val isAutoSelectable: Boolean,
    val entryGroupId: String, // Used for deduplication, and displayed as the grouping title
                              // "For <value-of-entryGroupId>" on the more-option screen.
) : EntryInfo(
    providerId,
    entryKey,
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.credentialmanager.getflow

import android.credentials.flags.Flags.selectorUiImprovementsEnabled
import android.graphics.drawable.Drawable
import com.android.credentialmanager.model.get.ProviderInfo
import com.android.credentialmanager.model.EntryInfo
@@ -133,7 +134,7 @@ fun toProviderDisplayInfo(

        providerInfo.credentialEntryList.forEach {
            userNameToCredentialEntryMap.compute(
                it.userName
                if (selectorUiImprovementsEnabled()) it.entryGroupId else it.userName
            ) { _, v ->
                if (v == null) {
                    mutableListOf(it)
+2 −1
Original line number Diff line number Diff line
@@ -146,7 +146,8 @@ class GetCredScreenshotTest(emulationSpec: DeviceEmulationSpec) {
                                icon = null,
                                shouldTintIcon = true,
                                lastUsedTimeMillis = null,
                                isAutoSelectable = false
                                isAutoSelectable = false,
                                entryGroupId = "username",
                        )
                ),
                authenticationEntryList = emptyList(),