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

Commit c46bd04f authored by Shuang Hao's avatar Shuang Hao
Browse files

Fix following crash when last use time is not available

java.lang.ClassCastException: java.time.Instant cannot be cast to java.lang.Integer

TESTED=Manual

Change-Id: Id6b715359678dff39286e8cfe2db434c4baf756e
parent a99411a8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import com.android.credentialmanager.CredentialSelectorUiState
import com.android.credentialmanager.CredentialSelectorUiState.Get.MultipleEntry.PerUserNameEntries
import com.android.credentialmanager.model.CredentialType
import com.android.credentialmanager.model.get.CredentialEntryInfo
import java.time.Instant

fun Request.Get.toGet(isPrimary: Boolean): CredentialSelectorUiState.Get {
    val accounts = providerInfos
@@ -67,4 +68,4 @@ fun Request.Get.toGet(isPrimary: Boolean): CredentialSelectorUiState.Get {
val comparator = compareBy<CredentialEntryInfo> { entryInfo ->
    // Passkey type always go first
    entryInfo.credentialType.let { if (it == CredentialType.PASSKEY) 0 else 1 }
}.thenByDescending { it.lastUsedTimeMillis ?: 0 }
}.thenByDescending { it.lastUsedTimeMillis ?: Instant.EPOCH }