Check icon tintable flag of the Suggestion.

- instead of checking the icon resource package, check the icon tintable
flag to see if we should tint the suggestion icon.

Bug: 72330968
Test: make RunSettingsRoboTests
Change-Id: I4767df05bebf815774dbd8e528c7ac0f5b902d44
This commit is contained in:
Doris Ling
2018-01-31 16:55:10 -08:00
parent b832f737c3
commit 0e96107ddc
2 changed files with 8 additions and 11 deletions

View File

@@ -116,7 +116,7 @@ public class SuggestionAdapter extends RecyclerView.Adapter<DashboardItemHolder>
mConfig.setCardLayout(holder, suggestionCount, position);
final Icon icon = suggestion.getIcon();
final Drawable drawable = mCache.getIcon(icon);
if (drawable != null && TextUtils.equals(icon.getResPackage(), mContext.getPackageName())) {
if ((suggestion.getFlags() & Suggestion.FLAG_ICON_TINTABLE) != 0) {
drawable.setTint(Utils.getColorAccent(mContext));
}
holder.icon.setImageDrawable(drawable);