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

Commit 0b469884 authored by Qinmei Du's avatar Qinmei Du
Browse files

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
parent 3472c797
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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(
+1 −1
Original line number Diff line number Diff line
@@ -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,
)