Merge "Handle empty auth entry title" into udc-dev
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
package com.android.credentialmanager
|
package com.android.credentialmanager
|
||||||
|
|
||||||
import android.app.slice.Slice
|
import android.app.slice.Slice
|
||||||
import android.app.slice.SliceItem
|
|
||||||
import android.content.ComponentName
|
import android.content.ComponentName
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
@@ -336,12 +335,8 @@ class GetFlowUtils {
|
|||||||
val structuredAuthEntry =
|
val structuredAuthEntry =
|
||||||
AuthenticationAction.fromSlice(entry.slice) ?: return@forEach
|
AuthenticationAction.fromSlice(entry.slice) ?: return@forEach
|
||||||
|
|
||||||
// TODO: replace with official jetpack code.
|
val title: String =
|
||||||
val titleItem: SliceItem? = entry.slice.items.firstOrNull {
|
structuredAuthEntry.title.toString().ifEmpty { providerDisplayName }
|
||||||
it.hasHint(
|
|
||||||
"androidx.credentials.provider.authenticationAction.SLICE_HINT_TITLE")
|
|
||||||
}
|
|
||||||
val title: String = titleItem?.text?.toString() ?: providerDisplayName
|
|
||||||
|
|
||||||
result.add(AuthenticationEntryInfo(
|
result.add(AuthenticationEntryInfo(
|
||||||
providerId = providerId,
|
providerId = providerId,
|
||||||
|
|||||||
Reference in New Issue
Block a user