Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c48cf39 authored by Steve Elliott's avatar Steve Elliott
Browse files

Avoid clobbering SBIV colors in NIC

NotificationIconContainer#setAnimationsEnabled can apply a stale cached
icon color to its child StatusBarIconViews, causing incorrectly colored
notification icons in the status bar.

This specific color application is only relevent to the
NotificationShelf; a check is added such that it will not be invoked
for the status bar or AOD icons.

Flag: ACONFIG com.android.systemui.notifications_icon_container_refactor STAGING
Test: atest SystemUITests
Bug: 318460865
Change-Id: I8d4e6777f45bfe2a8f14a1061d86aebb96db15b8
parent e8c4c3b0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -645,6 +645,10 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
                + "slot='" + mSlot + "' alpha=" + getAlpha() + " icon=" + mIcon
                + " visibleState=" + getVisibleStateString(getVisibleState())
                + " iconColor=#" + Integer.toHexString(mIconColor)
                + " staticDrawableColor=#" + Integer.toHexString(mDrawableColor)
                + " decorColor=#" + Integer.toHexString(mDecorColor)
                + " animationStartColor=#" + Integer.toHexString(mAnimationStartColor)
                + " currentSetColor=#" + Integer.toHexString(mCurrentSetColor)
                + " notification=" + mNotification + ')';
    }

+9 −2
Original line number Diff line number Diff line
@@ -918,8 +918,15 @@ public class NotificationIconContainer extends ViewGroup {
                    }
                }
                icon.setVisibleState(visibleState, animationsAllowed);
                if (NotificationIconContainerRefactor.isEnabled()) {
                    if (mOverrideIconColor) {
                        icon.setIconColor(mThemedTextColorPrimary,
                                /* animate= */ needsCannedAnimation && animationsAllowed);
                    }
                } else {
                    icon.setIconColor(mOverrideIconColor ? mThemedTextColorPrimary : iconColor,
                            needsCannedAnimation && animationsAllowed);
                }
                if (animate) {
                    animateTo(icon, animationProperties);
                } else {