Use safe icon when building unavailable slices.
And move ic_a11y_generic from mipmap to drawable. IconCompat doesn't support mipmap. Bug: 118691898 Test: robotests Change-Id: I6799f3d31d2c5654319e5a97bf8ca14992e785a7
This commit is contained in:
@@ -385,7 +385,7 @@ public class SliceBuilderUtils {
|
||||
final Set<String> keywords = buildSliceKeywords(data);
|
||||
@ColorInt final int color = Utils.getColorAccentDefaultColor(context);
|
||||
final CharSequence summary = context.getText(R.string.disabled_dependent_setting_summary);
|
||||
final IconCompat icon = IconCompat.createWithResource(context, data.getIconResource());
|
||||
final IconCompat icon = getSafeIcon(context, data);
|
||||
final SliceAction primaryAction = new SliceAction(getContentPendingIntent(context, data),
|
||||
icon, title);
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ class SliceDataConverter {
|
||||
final String title = resolveInfo.loadLabel(packageManager).toString();
|
||||
int iconResource = resolveInfo.getIconResource();
|
||||
if (iconResource == 0) {
|
||||
iconResource = R.mipmap.ic_accessibility_generic;
|
||||
iconResource = R.drawable.ic_accessibility_generic;
|
||||
}
|
||||
|
||||
sliceDataBuilder.setKey(flattenedName)
|
||||
|
||||
Reference in New Issue
Block a user