Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -133,6 +133,7 @@ private fun getCredentialOptionInfoList( ...@@ -133,6 +133,7 @@ private fun getCredentialOptionInfoList(
lastUsedTimeMillis = credentialEntry.lastUsedTime, lastUsedTimeMillis = credentialEntry.lastUsedTime,
isAutoSelectable = credentialEntry.isAutoSelectAllowed && isAutoSelectable = credentialEntry.isAutoSelectAllowed &&
credentialEntry.isAutoSelectAllowedFromOption, credentialEntry.isAutoSelectAllowedFromOption,
entryGroupId = credentialEntry.entryGroupId.toString(),
) )
) )
} }
...@@ -156,6 +157,7 @@ private fun getCredentialOptionInfoList( ...@@ -156,6 +157,7 @@ private fun getCredentialOptionInfoList(
lastUsedTimeMillis = credentialEntry.lastUsedTime, lastUsedTimeMillis = credentialEntry.lastUsedTime,
isAutoSelectable = credentialEntry.isAutoSelectAllowed && isAutoSelectable = credentialEntry.isAutoSelectAllowed &&
credentialEntry.isAutoSelectAllowedFromOption, credentialEntry.isAutoSelectAllowedFromOption,
entryGroupId = credentialEntry.entryGroupId.toString(),
) )
) )
} }
...@@ -178,6 +180,7 @@ private fun getCredentialOptionInfoList( ...@@ -178,6 +180,7 @@ private fun getCredentialOptionInfoList(
lastUsedTimeMillis = credentialEntry.lastUsedTime, lastUsedTimeMillis = credentialEntry.lastUsedTime,
isAutoSelectable = credentialEntry.isAutoSelectAllowed && isAutoSelectable = credentialEntry.isAutoSelectAllowed &&
credentialEntry.isAutoSelectAllowedFromOption, credentialEntry.isAutoSelectAllowedFromOption,
entryGroupId = credentialEntry.entryGroupId.toString(),
) )
) )
} }
......
...@@ -40,6 +40,8 @@ class CredentialEntryInfo( ...@@ -40,6 +40,8 @@ class CredentialEntryInfo(
val shouldTintIcon: Boolean, val shouldTintIcon: Boolean,
val lastUsedTimeMillis: Instant?, val lastUsedTimeMillis: Instant?,
val isAutoSelectable: Boolean, 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( ) : EntryInfo(
providerId, providerId,
entryKey, entryKey,
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.android.credentialmanager.getflow package com.android.credentialmanager.getflow
import android.credentials.flags.Flags.selectorUiImprovementsEnabled
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import com.android.credentialmanager.model.get.ProviderInfo import com.android.credentialmanager.model.get.ProviderInfo
import com.android.credentialmanager.model.EntryInfo import com.android.credentialmanager.model.EntryInfo
...@@ -133,7 +134,7 @@ fun toProviderDisplayInfo( ...@@ -133,7 +134,7 @@ fun toProviderDisplayInfo(
providerInfo.credentialEntryList.forEach { providerInfo.credentialEntryList.forEach {
userNameToCredentialEntryMap.compute( userNameToCredentialEntryMap.compute(
it.userName if (selectorUiImprovementsEnabled()) it.entryGroupId else it.userName
) { _, v -> ) { _, v ->
if (v == null) { if (v == null) {
mutableListOf(it) mutableListOf(it)
......
...@@ -146,7 +146,8 @@ class GetCredScreenshotTest(emulationSpec: DeviceEmulationSpec) { ...@@ -146,7 +146,8 @@ class GetCredScreenshotTest(emulationSpec: DeviceEmulationSpec) {
icon = null, icon = null,
shouldTintIcon = true, shouldTintIcon = true,
lastUsedTimeMillis = null, lastUsedTimeMillis = null,
isAutoSelectable = false isAutoSelectable = false,
entryGroupId = "username",
) )
), ),
authenticationEntryList = emptyList(), authenticationEntryList = emptyList(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment