Make UI pending intent unique, and make credential entry icon optional
Test: Built & deployed locally Bug: 253155431 Change-Id: Ia748349b75ab6f06197b09b809018c46eb766860
This commit is contained in:
@@ -100,7 +100,7 @@ class GetFlowUtils {
|
||||
userName = credentialEntryUi.userName.toString(),
|
||||
displayName = credentialEntryUi.userDisplayName?.toString(),
|
||||
// TODO: proper fallback
|
||||
icon = credentialEntryUi.entryIcon.loadDrawable(context)
|
||||
icon = credentialEntryUi.entryIcon?.loadDrawable(context)
|
||||
?: context.getDrawable(R.drawable.ic_passkey)!!,
|
||||
lastUsedTimeMillis = credentialEntryUi.lastUsedTimeMillis,
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ class CredentialEntryUi(
|
||||
val credentialTypeDisplayName: CharSequence,
|
||||
val userName: CharSequence,
|
||||
val userDisplayName: CharSequence?,
|
||||
val entryIcon: Icon,
|
||||
val entryIcon: Icon?,
|
||||
val lastUsedTimeMillis: Long?,
|
||||
val note: CharSequence?,
|
||||
) {
|
||||
@@ -62,7 +62,7 @@ class CredentialEntryUi(
|
||||
}
|
||||
|
||||
return CredentialEntryUi(
|
||||
credentialType, credentialTypeDisplayName!!, userName!!, userDisplayName, entryIcon!!,
|
||||
credentialType, credentialTypeDisplayName!!, userName!!, userDisplayName, entryIcon,
|
||||
lastUsedTimeMillis, note,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.util.Log;
|
||||
import android.util.Slog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
/** Initiates the Credential Manager UI and receives results. */
|
||||
public class CredentialManagerUi {
|
||||
@@ -89,7 +90,8 @@ public class CredentialManagerUi {
|
||||
RequestInfo requestInfo, ArrayList<ProviderData> providerDataList) {
|
||||
Log.i(TAG, "In createPendingIntent");
|
||||
Intent intent = IntentFactory.newIntent(requestInfo, providerDataList, new ArrayList<>(),
|
||||
mResultReceiver).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mResultReceiver)
|
||||
.setAction(UUID.randomUUID().toString());
|
||||
//TODO: Determine if a specific request code is needed
|
||||
return PendingIntent.getActivity(
|
||||
mContext, /*requestCode=*/0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
|
||||
Reference in New Issue
Block a user