AOD: Fix icon color when updating on AOD
Fixes a bug where notification shelf icons
would become colorful when they update while
in AOD.
Change-Id: I6e1d98bc75a2119eb32b55a40a66a9b3bcee8737
Fixes: 37156783
Test: Turn off device, receive notification, receive update to that notification, trigger ambient display
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 92bfae9..ec15d10 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -499,12 +499,18 @@
}
private void setColorInternal(int color) {
- if (color != NO_COLOR) {
- setImageTintList(ColorStateList.valueOf(color));
+ mCurrentSetColor = color;
+ updateIconColor();
+ }
+
+ private void updateIconColor() {
+ if (mCurrentSetColor != NO_COLOR) {
+ setImageTintList(ColorStateList.valueOf(NotificationUtils.interpolateColors(
+ mCurrentSetColor, Color.WHITE, mDarkAmount)));
} else {
setImageTintList(null);
+ mDozer.updateGrayscale(this, mDarkAmount);
}
- mCurrentSetColor = color;
}
public void setIconColor(int iconColor, boolean animate) {
@@ -669,10 +675,10 @@
}
public void setDark(boolean dark, boolean fade, long delay) {
- mDozer.setImageDark(this, dark, fade, delay, mIconColor == NO_COLOR);
mDozer.setIntensityDark(f -> {
mDarkAmount = f;
updateDecorColor();
+ updateIconColor();
}, dark, fade, delay);
}