Make createOptionsInfo sorted by the lastUsedTimeMillis

screenshot: https://screenshot.googleplex.com/5M96kcjaoobYuyR (The
createInfo changed to work account as it's lastUsedTime is larger
Test: deployed locally

Bug: 253157211
Change-Id: Ic56b076831303e135c010e66a5497ae622685c22
This commit is contained in:
Qinmei Du
2022-11-04 22:10:16 +00:00
parent 3472c79777
commit 0b4698840e
2 changed files with 3 additions and 2 deletions

View File

@@ -123,7 +123,8 @@ class CredentialManagerRepo(
providerList as List<CreateCredentialProviderData>, context)
var hasDefault = false
var defaultProvider: ProviderInfo = providerList.first()
providerList.forEach{providerInfo ->
providerList.forEach{providerInfo -> providerInfo.createOptions =
providerInfo.createOptions.sortedWith(compareBy { it.lastUsedTimeMillis }).reversed()
if (providerInfo.isDefault) {hasDefault = true; defaultProvider = providerInfo} }
// TODO: covert from real requestInfo
val requestDisplayInfo = RequestDisplayInfo(

View File

@@ -22,7 +22,7 @@ data class ProviderInfo(
val icon: Drawable,
val name: String,
val displayName: String,
val createOptions: List<CreateOptionInfo>,
var createOptions: List<CreateOptionInfo>,
val isDefault: Boolean,
)