Merge "Don't crash the notification bind if the icon fails to resolve." into sc-dev am: ccb14ac813
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15017666 Change-Id: I248eabea1ae476fe35fec0778758425ee440bc7e
This commit is contained in:
@@ -257,7 +257,7 @@ public class CachingIconView extends ImageView {
|
|||||||
boolean hasColor = color != ColoredIconHelper.COLOR_INVALID;
|
boolean hasColor = color != ColoredIconHelper.COLOR_INVALID;
|
||||||
if (background == null) {
|
if (background == null) {
|
||||||
// This is the pre-S style -- colored icon with no background.
|
// This is the pre-S style -- colored icon with no background.
|
||||||
if (hasColor) {
|
if (hasColor && icon != null) {
|
||||||
icon.mutate().setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
|
icon.mutate().setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -265,7 +265,9 @@ public class CachingIconView extends ImageView {
|
|||||||
// colorize the icon itself with the background color, creating an inverted effect.
|
// colorize the icon itself with the background color, creating an inverted effect.
|
||||||
if (hasColor) {
|
if (hasColor) {
|
||||||
background.mutate().setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
|
background.mutate().setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
|
||||||
icon.mutate().setColorFilter(mBackgroundColor, PorterDuff.Mode.SRC_ATOP);
|
if (icon != null) {
|
||||||
|
icon.mutate().setColorFilter(mBackgroundColor, PorterDuff.Mode.SRC_ATOP);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
background.mutate().setColorFilter(mBackgroundColor, PorterDuff.Mode.SRC_ATOP);
|
background.mutate().setColorFilter(mBackgroundColor, PorterDuff.Mode.SRC_ATOP);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user