Only honor preferUiBrandingComponentName with permission

preferUiBrandingComponentName should only be honored if the caller app
has the permission
android.permission.CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS.

Bug: 281599707
Test: manual
Change-Id: I8e9db2b89b37f05515f05fc5e8c64d27cd5b9e51
This commit is contained in:
Helen Qin
2023-05-09 03:38:59 +00:00
parent fcdac40e64
commit d7d9d4892c

View File

@@ -201,7 +201,8 @@ class GetFlowUtils {
ComponentName::class.java
)
val preferTopBrandingContent: TopBrandingContent? =
if (preferUiBrandingComponentName == null) null
if (!requestInfo.hasPermissionToOverrideDefault() ||
preferUiBrandingComponentName == null) null
else {
val (displayName, icon) = getServiceLabelAndIcon(
context.packageManager, preferUiBrandingComponentName.flattenToString())