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:
@@ -550,7 +550,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
||||
|
||||
Drawable icon;
|
||||
if (resolveInfo.getIconResource() == 0) {
|
||||
icon = ContextCompat.getDrawable(getContext(), R.mipmap.ic_accessibility_generic);
|
||||
icon = ContextCompat.getDrawable(getContext(), R.drawable.ic_accessibility_generic);
|
||||
} else {
|
||||
icon = resolveInfo.loadIcon(getPackageManager());
|
||||
}
|
||||
|
@@ -258,7 +258,7 @@ public class ShortcutServicePickerFragment extends RadioButtonPickerFragment {
|
||||
public Drawable loadIcon() {
|
||||
final ResolveInfo resolveInfo = mServiceInfo.getResolveInfo();
|
||||
return (resolveInfo.getIconResource() == 0)
|
||||
? getContext().getDrawable(R.mipmap.ic_accessibility_generic)
|
||||
? getContext().getDrawable(R.drawable.ic_accessibility_generic)
|
||||
: resolveInfo.loadIcon(getContext().getPackageManager());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user