From b74ecfefafcf54f191215108f637a4cadd6d76c5 Mon Sep 17 00:00:00 2001 From: Helen Qin Date: Wed, 22 Mar 2023 19:07:58 +0000 Subject: [PATCH] [CredMan] Fixes for the new credentials lib drop. Bug: 274780212 Test: manual Change-Id: I061a5dc00682751fc4ba003bacb08d974143c790 --- .../credentialmanager/DataConverter.kt | 2 +- .../android/credentialmanager/TestUtils.kt | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/CredentialManager/src/com/android/credentialmanager/DataConverter.kt b/packages/CredentialManager/src/com/android/credentialmanager/DataConverter.kt index b5c8989de6182..bd0b4cc31a74c 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/DataConverter.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/DataConverter.kt @@ -29,7 +29,6 @@ import android.credentials.ui.Entry import android.credentials.ui.GetCredentialProviderData import android.credentials.ui.RequestInfo import android.graphics.drawable.Drawable -import android.service.credentials.CredentialEntry import android.text.TextUtils import android.util.Log import com.android.credentialmanager.common.Constants @@ -57,6 +56,7 @@ import androidx.credentials.PublicKeyCredential.Companion.TYPE_PUBLIC_KEY_CREDEN import androidx.credentials.provider.Action import androidx.credentials.provider.AuthenticationAction import androidx.credentials.provider.CreateEntry +import androidx.credentials.provider.CredentialEntry import androidx.credentials.provider.CustomCredentialEntry import androidx.credentials.provider.PasswordCredentialEntry import androidx.credentials.provider.PublicKeyCredentialEntry diff --git a/packages/CredentialManager/src/com/android/credentialmanager/TestUtils.kt b/packages/CredentialManager/src/com/android/credentialmanager/TestUtils.kt index 26aadd9d5deed..1f99500a3ea77 100644 --- a/packages/CredentialManager/src/com/android/credentialmanager/TestUtils.kt +++ b/packages/CredentialManager/src/com/android/credentialmanager/TestUtils.kt @@ -84,7 +84,7 @@ class GetTestUtils { return Entry( key, subkey, - RemoteEntry(pendingIntent).slice + RemoteEntry.toSlice(RemoteEntry(pendingIntent)) ) } @@ -219,12 +219,16 @@ class CreateTestUtils { key, subkey, CreateEntry.toSlice( - providerUserDisplayName, - null, - footerDescription, - lastUsedTime, - credCountMap, - pendingIntent + CreateEntry( + accountName = providerUserDisplayName, + pendingIntent = pendingIntent, + description = footerDescription, + lastUsedTime = lastUsedTime, + icon = null, + passwordCredentialCount = passwordCount, + publicKeyCredentialCount = passkeyCount, + totalCredentialCount = totalCredentialCount, + ) ), Intent() ) @@ -241,7 +245,7 @@ class CreateTestUtils { return Entry( key, subkey, - RemoteEntry(pendingIntent).slice + RemoteEntry.toSlice(RemoteEntry(pendingIntent)) ) } }