Loading core/java/android/app/Notification.java +51 −47 Original line number Diff line number Diff line Loading @@ -3747,7 +3747,6 @@ public class Notification implements Parcelable private boolean mRebuildStyledRemoteViews; private boolean mTintActionButtons; private boolean mTintWithThemeAccent; private boolean mInNightMode; /** Loading Loading @@ -3783,7 +3782,6 @@ public class Notification implements Parcelable mContext = context; Resources res = mContext.getResources(); mTintActionButtons = res.getBoolean(R.bool.config_tintNotificationActionButtons); mTintWithThemeAccent = res.getBoolean(R.bool.config_tintNotificationsWithTheme); if (res.getBoolean(R.bool.config_enableNightMode)) { Configuration currentConfig = res.getConfiguration(); Loading Loading @@ -5208,15 +5206,21 @@ public class Notification implements Parcelable || mSecondaryTextColor == COLOR_INVALID || mTextColorsAreForBackground != backgroundColor) { mTextColorsAreForBackground = backgroundColor; mPrimaryTextColor = ContrastColorUtil.resolvePrimaryColor(mContext, int defaultPrimaryTextColor = ContrastColorUtil.resolvePrimaryColor(mContext, backgroundColor, mInNightMode); mSecondaryTextColor = ContrastColorUtil.resolveSecondaryColor(mContext, int defaultSecondaryTextColor = ContrastColorUtil.resolveSecondaryColor(mContext, backgroundColor, mInNightMode); if (backgroundColor != COLOR_DEFAULT && isColorized(p)) { boolean colorized = backgroundColor != COLOR_DEFAULT; if (colorized) { mPrimaryTextColor = ContrastColorUtil.findAlphaToMeetContrast( mPrimaryTextColor, backgroundColor, 4.5); defaultPrimaryTextColor, backgroundColor, 4.5); mSecondaryTextColor = ContrastColorUtil.findAlphaToMeetContrast( mSecondaryTextColor, backgroundColor, 4.5); defaultSecondaryTextColor, backgroundColor, 4.5); } else { mPrimaryTextColor = obtainThemeColor(R.attr.textColorPrimary, defaultPrimaryTextColor); mSecondaryTextColor = obtainThemeColor(R.attr.textColorSecondary, defaultSecondaryTextColor); } } } Loading @@ -5243,11 +5247,9 @@ public class Notification implements Parcelable contentView.setProgressBar(R.id.progress, max, progress, ind); contentView.setProgressBackgroundTintList(R.id.progress, mContext.getColorStateList(R.color.notification_progress_background_color)); if (mTintWithThemeAccent || getRawColor(p) != COLOR_DEFAULT) { ColorStateList progressTint = ColorStateList.valueOf(getAccentColor(p)); contentView.setProgressTintList(R.id.progress, progressTint); contentView.setProgressIndeterminateTintList(R.id.progress, progressTint); } return true; } else { contentView.setViewVisibility(R.id.progress, View.GONE); Loading Loading @@ -6083,8 +6085,7 @@ public class Notification implements Parcelable background = outResultColor[0].getDefaultColor(); textColor = ContrastColorUtil.resolvePrimaryColor(mContext, background, mInNightMode); } else if (mTintActionButtons && !mInNightMode && getRawColor(p) != COLOR_DEFAULT && !isColorized(p)) { } else if (mTintActionButtons && !mInNightMode && !isColorized(p)) { textColor = getAccentColor(p); } else { textColor = getPrimaryTextColor(p); Loading Loading @@ -6262,7 +6263,7 @@ public class Notification implements Parcelable * is the primary text color, otherwise it's the contrast-adjusted app-provided color. */ private @ColorInt int getSmallIconColor(StandardTemplateParams p) { return isColorized(p) ? getPrimaryTextColor(p) : getContrastColor(p); return getContrastColor(p); } /** Loading @@ -6274,12 +6275,10 @@ public class Notification implements Parcelable if (isColorized(p)) { return getPrimaryTextColor(p); } if (mTintWithThemeAccent) { int color = obtainThemeColor(R.attr.colorAccent, COLOR_INVALID); if (color != COLOR_INVALID) { return color; } } return getContrastColor(p); } Loading @@ -6288,7 +6287,7 @@ public class Notification implements Parcelable * color when colorized, or when not using theme color tints. */ private @ColorInt int getProtectionColor(StandardTemplateParams p) { if (mTintWithThemeAccent && !isColorized(p)) { if (!isColorized(p)) { int color = obtainThemeColor(R.attr.colorBackgroundFloating, COLOR_INVALID); if (color != COLOR_INVALID) { return color; Loading @@ -6307,13 +6306,11 @@ public class Notification implements Parcelable if (isColorized(p)) { return getPrimaryTextColor(p); } if (mTintWithThemeAccent) { int color = obtainThemeColor(com.android.internal.R.attr.colorAccentTertiary, COLOR_INVALID); if (color != COLOR_INVALID) { return color; } } return getContrastColor(p); } Loading Loading @@ -6342,6 +6339,9 @@ public class Notification implements Parcelable * Gets the contrast-adjusted version of the color provided by the app. */ private @ColorInt int getContrastColor(StandardTemplateParams p) { if (isColorized(p)) { return getPrimaryTextColor(p); } int rawColor = getRawColor(p); if (mCachedContrastColorIsFor == rawColor && mCachedContrastColor != COLOR_INVALID) { return mCachedContrastColor; Loading @@ -6352,9 +6352,10 @@ public class Notification implements Parcelable int background = getDefaultBackgroundColor(); if (rawColor == COLOR_DEFAULT) { ensureColors(p); color = ContrastColorUtil.resolveDefaultColor(mContext, background, mInNightMode); if (mTintWithThemeAccent) { color = obtainThemeColor(R.attr.colorAccent, color); color = obtainThemeColor(R.attr.colorAccent, COLOR_INVALID); if (color == COLOR_INVALID) { color = ContrastColorUtil.resolveDefaultColor(mContext, background, mInNightMode); } } else { color = ContrastColorUtil.resolveContrastColor(mContext, rawColor, Loading @@ -6375,11 +6376,6 @@ public class Notification implements Parcelable * @param p the template params to inflate this with */ private @ColorInt int getRawColor(StandardTemplateParams p) { // When notifications are theme-tinted, the raw color is only used for the icon, so go // ahead and keep that color instead of changing the color for minimized notifs. if (p.mReduceHighlights && !mTintWithThemeAccent) { return COLOR_DEFAULT; } return mN.color; } Loading Loading @@ -6486,6 +6482,7 @@ public class Notification implements Parcelable + " notification: " + mN.mShortcutId + " vs bubble: " + mN.mBubbleMetadata.getShortcutId()); } validateColorizedHasColor(); // first, add any extras from the calling code if (mUserExtras != null) { Loading Loading @@ -6539,6 +6536,21 @@ public class Notification implements Parcelable return mN; } // This code is executed on behalf of other apps' notifications, sometimes even by 3p apps, // a use case that is not supported by the Compat Framework library. @SuppressWarnings("AndroidFrameworkCompatChange") private void validateColorizedHasColor() { if (mN.color == COLOR_DEFAULT && mN.extras.getBoolean(EXTRA_COLORIZED)) { if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.S) { throw new IllegalArgumentException( "Colorized notifications must set a color (other than COLOR_DEFAULT)."); } else { Log.w(TAG, "Colorized notifications must set a color (other than " + "COLOR_DEFAULT). This is required for apps targeting S."); } } } /** * Returns the color for the given Theme.DeviceDefault.DayNight attribute, or * defValue if that could not be completed Loading @@ -6551,13 +6563,9 @@ public class Notification implements Parcelable } theme = new ContextThemeWrapper(mContext, R.style.Theme_DeviceDefault_DayNight) .getTheme(); TypedArray ta = theme.obtainStyledAttributes(new int[]{attrRes}); if (ta == null) { return defaultColor; try (TypedArray ta = theme.obtainStyledAttributes(new int[]{attrRes})) { return ta.getColor(0, defaultColor); } int background = ta.getColor(0, defaultColor); ta.recycle(); return background; } /** Loading Loading @@ -6671,11 +6679,7 @@ public class Notification implements Parcelable * which must be resolved by the caller before being used. */ private @ColorInt int getUnresolvedBackgroundColor(StandardTemplateParams p) { if (isColorized(p)) { return getRawColor(p); } else { return COLOR_DEFAULT; } return isColorized(p) ? getRawColor(p) : COLOR_DEFAULT; } /** Loading Loading @@ -6878,7 +6882,7 @@ public class Notification implements Parcelable * @hide */ public boolean isColorized() { return extras.getBoolean(EXTRA_COLORIZED) return color != COLOR_DEFAULT && extras.getBoolean(EXTRA_COLORIZED) && (hasColorizedPermission() || isForegroundService()); } Loading core/res/res/values/config.xml +0 −4 Original line number Diff line number Diff line Loading @@ -3939,10 +3939,6 @@ color supplied by the Notification.Builder if present. --> <bool name="config_tintNotificationActionButtons">true</bool> <!-- Flag indicating that tinted items (actions, expander, etc) are to be tinted using the theme color, rather than the notification color. --> <bool name="config_tintNotificationsWithTheme">true</bool> <!-- Show area update info settings in CellBroadcastReceiver and information in SIM status in Settings app --> <bool name="config_showAreaUpdateInfoSettings">false</bool> Loading core/res/res/values/symbols.xml +0 −1 Original line number Diff line number Diff line Loading @@ -1889,7 +1889,6 @@ <java-symbol type="bool" name="config_notificationHeaderClickableForExpand" /> <java-symbol type="bool" name="config_enableNightMode" /> <java-symbol type="bool" name="config_tintNotificationActionButtons" /> <java-symbol type="bool" name="config_tintNotificationsWithTheme" /> <java-symbol type="bool" name="config_dozeAfterScreenOffByDefault" /> <java-symbol type="bool" name="config_enableActivityRecognitionHardwareOverlay" /> <java-symbol type="bool" name="config_enableFusedLocationOverlay" /> Loading core/tests/coretests/src/android/app/NotificationTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.content.Context; import android.content.Intent; import android.content.LocusId; import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.drawable.Icon; import android.media.session.MediaSession; import android.os.Build; Loading Loading @@ -60,7 +61,7 @@ public class NotificationTest { public void testColorizedByPermission() { Notification n = new Notification.Builder(mContext, "test") .setFlag(Notification.FLAG_CAN_COLORIZE, true) .setColorized(true) .setColorized(true).setColor(Color.WHITE) .build(); assertTrue(n.isColorized()); Loading @@ -71,7 +72,7 @@ public class NotificationTest { n = new Notification.Builder(mContext, "test") .setFlag(Notification.FLAG_CAN_COLORIZE, false) .setColorized(true) .setColorized(true).setColor(Color.WHITE) .build(); assertFalse(n.isColorized()); } Loading @@ -80,7 +81,7 @@ public class NotificationTest { public void testColorizedByForeground() { Notification n = new Notification.Builder(mContext, "test") .setFlag(Notification.FLAG_FOREGROUND_SERVICE, true) .setColorized(true) .setColorized(true).setColor(Color.WHITE) .build(); assertTrue(n.isColorized()); Loading @@ -91,7 +92,7 @@ public class NotificationTest { n = new Notification.Builder(mContext, "test") .setFlag(Notification.FLAG_FOREGROUND_SERVICE, false) .setColorized(true) .setColorized(true).setColor(Color.WHITE) .build(); assertFalse(n.isColorized()); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java +4 −10 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ public class NotificationChildrenContainer extends ViewGroup { private ViewGroup mCurrentHeader; private boolean mIsConversation; private boolean mTintWithThemeAccent; private boolean mShowGroupCountInExpander; private boolean mShowDividersWhenExpanded; private boolean mHideDividersDuringExpand; Loading Loading @@ -149,8 +148,6 @@ public class NotificationChildrenContainer extends ViewGroup { com.android.internal.R.dimen.notification_content_margin); mEnableShadowOnChildNotifications = res.getBoolean(R.bool.config_enableShadowOnChildNotifications); mTintWithThemeAccent = res.getBoolean(com.android.internal.R.bool.config_tintNotificationsWithTheme); mShowGroupCountInExpander = res.getBoolean(R.bool.config_showNotificationGroupCountInExpander); mShowDividersWhenExpanded = Loading Loading @@ -1223,14 +1220,11 @@ public class NotificationChildrenContainer extends ViewGroup { return; } int color = mContainingNotification.getNotificationColor(); if (mTintWithThemeAccent) { // We're using the theme accent, color with the accent color instead of the notif color Resources.Theme theme = new ContextThemeWrapper(mContext, com.android.internal.R.style.Theme_DeviceDefault_DayNight).getTheme(); TypedArray ta = theme.obtainStyledAttributes( new int[]{com.android.internal.R.attr.colorAccent}); try (TypedArray ta = theme.obtainStyledAttributes( new int[]{com.android.internal.R.attr.colorAccent})) { color = ta.getColor(0, color); ta.recycle(); } mHybridGroupManager.setOverflowNumberColor(mOverflowNumber, color); } Loading Loading
core/java/android/app/Notification.java +51 −47 Original line number Diff line number Diff line Loading @@ -3747,7 +3747,6 @@ public class Notification implements Parcelable private boolean mRebuildStyledRemoteViews; private boolean mTintActionButtons; private boolean mTintWithThemeAccent; private boolean mInNightMode; /** Loading Loading @@ -3783,7 +3782,6 @@ public class Notification implements Parcelable mContext = context; Resources res = mContext.getResources(); mTintActionButtons = res.getBoolean(R.bool.config_tintNotificationActionButtons); mTintWithThemeAccent = res.getBoolean(R.bool.config_tintNotificationsWithTheme); if (res.getBoolean(R.bool.config_enableNightMode)) { Configuration currentConfig = res.getConfiguration(); Loading Loading @@ -5208,15 +5206,21 @@ public class Notification implements Parcelable || mSecondaryTextColor == COLOR_INVALID || mTextColorsAreForBackground != backgroundColor) { mTextColorsAreForBackground = backgroundColor; mPrimaryTextColor = ContrastColorUtil.resolvePrimaryColor(mContext, int defaultPrimaryTextColor = ContrastColorUtil.resolvePrimaryColor(mContext, backgroundColor, mInNightMode); mSecondaryTextColor = ContrastColorUtil.resolveSecondaryColor(mContext, int defaultSecondaryTextColor = ContrastColorUtil.resolveSecondaryColor(mContext, backgroundColor, mInNightMode); if (backgroundColor != COLOR_DEFAULT && isColorized(p)) { boolean colorized = backgroundColor != COLOR_DEFAULT; if (colorized) { mPrimaryTextColor = ContrastColorUtil.findAlphaToMeetContrast( mPrimaryTextColor, backgroundColor, 4.5); defaultPrimaryTextColor, backgroundColor, 4.5); mSecondaryTextColor = ContrastColorUtil.findAlphaToMeetContrast( mSecondaryTextColor, backgroundColor, 4.5); defaultSecondaryTextColor, backgroundColor, 4.5); } else { mPrimaryTextColor = obtainThemeColor(R.attr.textColorPrimary, defaultPrimaryTextColor); mSecondaryTextColor = obtainThemeColor(R.attr.textColorSecondary, defaultSecondaryTextColor); } } } Loading @@ -5243,11 +5247,9 @@ public class Notification implements Parcelable contentView.setProgressBar(R.id.progress, max, progress, ind); contentView.setProgressBackgroundTintList(R.id.progress, mContext.getColorStateList(R.color.notification_progress_background_color)); if (mTintWithThemeAccent || getRawColor(p) != COLOR_DEFAULT) { ColorStateList progressTint = ColorStateList.valueOf(getAccentColor(p)); contentView.setProgressTintList(R.id.progress, progressTint); contentView.setProgressIndeterminateTintList(R.id.progress, progressTint); } return true; } else { contentView.setViewVisibility(R.id.progress, View.GONE); Loading Loading @@ -6083,8 +6085,7 @@ public class Notification implements Parcelable background = outResultColor[0].getDefaultColor(); textColor = ContrastColorUtil.resolvePrimaryColor(mContext, background, mInNightMode); } else if (mTintActionButtons && !mInNightMode && getRawColor(p) != COLOR_DEFAULT && !isColorized(p)) { } else if (mTintActionButtons && !mInNightMode && !isColorized(p)) { textColor = getAccentColor(p); } else { textColor = getPrimaryTextColor(p); Loading Loading @@ -6262,7 +6263,7 @@ public class Notification implements Parcelable * is the primary text color, otherwise it's the contrast-adjusted app-provided color. */ private @ColorInt int getSmallIconColor(StandardTemplateParams p) { return isColorized(p) ? getPrimaryTextColor(p) : getContrastColor(p); return getContrastColor(p); } /** Loading @@ -6274,12 +6275,10 @@ public class Notification implements Parcelable if (isColorized(p)) { return getPrimaryTextColor(p); } if (mTintWithThemeAccent) { int color = obtainThemeColor(R.attr.colorAccent, COLOR_INVALID); if (color != COLOR_INVALID) { return color; } } return getContrastColor(p); } Loading @@ -6288,7 +6287,7 @@ public class Notification implements Parcelable * color when colorized, or when not using theme color tints. */ private @ColorInt int getProtectionColor(StandardTemplateParams p) { if (mTintWithThemeAccent && !isColorized(p)) { if (!isColorized(p)) { int color = obtainThemeColor(R.attr.colorBackgroundFloating, COLOR_INVALID); if (color != COLOR_INVALID) { return color; Loading @@ -6307,13 +6306,11 @@ public class Notification implements Parcelable if (isColorized(p)) { return getPrimaryTextColor(p); } if (mTintWithThemeAccent) { int color = obtainThemeColor(com.android.internal.R.attr.colorAccentTertiary, COLOR_INVALID); if (color != COLOR_INVALID) { return color; } } return getContrastColor(p); } Loading Loading @@ -6342,6 +6339,9 @@ public class Notification implements Parcelable * Gets the contrast-adjusted version of the color provided by the app. */ private @ColorInt int getContrastColor(StandardTemplateParams p) { if (isColorized(p)) { return getPrimaryTextColor(p); } int rawColor = getRawColor(p); if (mCachedContrastColorIsFor == rawColor && mCachedContrastColor != COLOR_INVALID) { return mCachedContrastColor; Loading @@ -6352,9 +6352,10 @@ public class Notification implements Parcelable int background = getDefaultBackgroundColor(); if (rawColor == COLOR_DEFAULT) { ensureColors(p); color = ContrastColorUtil.resolveDefaultColor(mContext, background, mInNightMode); if (mTintWithThemeAccent) { color = obtainThemeColor(R.attr.colorAccent, color); color = obtainThemeColor(R.attr.colorAccent, COLOR_INVALID); if (color == COLOR_INVALID) { color = ContrastColorUtil.resolveDefaultColor(mContext, background, mInNightMode); } } else { color = ContrastColorUtil.resolveContrastColor(mContext, rawColor, Loading @@ -6375,11 +6376,6 @@ public class Notification implements Parcelable * @param p the template params to inflate this with */ private @ColorInt int getRawColor(StandardTemplateParams p) { // When notifications are theme-tinted, the raw color is only used for the icon, so go // ahead and keep that color instead of changing the color for minimized notifs. if (p.mReduceHighlights && !mTintWithThemeAccent) { return COLOR_DEFAULT; } return mN.color; } Loading Loading @@ -6486,6 +6482,7 @@ public class Notification implements Parcelable + " notification: " + mN.mShortcutId + " vs bubble: " + mN.mBubbleMetadata.getShortcutId()); } validateColorizedHasColor(); // first, add any extras from the calling code if (mUserExtras != null) { Loading Loading @@ -6539,6 +6536,21 @@ public class Notification implements Parcelable return mN; } // This code is executed on behalf of other apps' notifications, sometimes even by 3p apps, // a use case that is not supported by the Compat Framework library. @SuppressWarnings("AndroidFrameworkCompatChange") private void validateColorizedHasColor() { if (mN.color == COLOR_DEFAULT && mN.extras.getBoolean(EXTRA_COLORIZED)) { if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.S) { throw new IllegalArgumentException( "Colorized notifications must set a color (other than COLOR_DEFAULT)."); } else { Log.w(TAG, "Colorized notifications must set a color (other than " + "COLOR_DEFAULT). This is required for apps targeting S."); } } } /** * Returns the color for the given Theme.DeviceDefault.DayNight attribute, or * defValue if that could not be completed Loading @@ -6551,13 +6563,9 @@ public class Notification implements Parcelable } theme = new ContextThemeWrapper(mContext, R.style.Theme_DeviceDefault_DayNight) .getTheme(); TypedArray ta = theme.obtainStyledAttributes(new int[]{attrRes}); if (ta == null) { return defaultColor; try (TypedArray ta = theme.obtainStyledAttributes(new int[]{attrRes})) { return ta.getColor(0, defaultColor); } int background = ta.getColor(0, defaultColor); ta.recycle(); return background; } /** Loading Loading @@ -6671,11 +6679,7 @@ public class Notification implements Parcelable * which must be resolved by the caller before being used. */ private @ColorInt int getUnresolvedBackgroundColor(StandardTemplateParams p) { if (isColorized(p)) { return getRawColor(p); } else { return COLOR_DEFAULT; } return isColorized(p) ? getRawColor(p) : COLOR_DEFAULT; } /** Loading Loading @@ -6878,7 +6882,7 @@ public class Notification implements Parcelable * @hide */ public boolean isColorized() { return extras.getBoolean(EXTRA_COLORIZED) return color != COLOR_DEFAULT && extras.getBoolean(EXTRA_COLORIZED) && (hasColorizedPermission() || isForegroundService()); } Loading
core/res/res/values/config.xml +0 −4 Original line number Diff line number Diff line Loading @@ -3939,10 +3939,6 @@ color supplied by the Notification.Builder if present. --> <bool name="config_tintNotificationActionButtons">true</bool> <!-- Flag indicating that tinted items (actions, expander, etc) are to be tinted using the theme color, rather than the notification color. --> <bool name="config_tintNotificationsWithTheme">true</bool> <!-- Show area update info settings in CellBroadcastReceiver and information in SIM status in Settings app --> <bool name="config_showAreaUpdateInfoSettings">false</bool> Loading
core/res/res/values/symbols.xml +0 −1 Original line number Diff line number Diff line Loading @@ -1889,7 +1889,6 @@ <java-symbol type="bool" name="config_notificationHeaderClickableForExpand" /> <java-symbol type="bool" name="config_enableNightMode" /> <java-symbol type="bool" name="config_tintNotificationActionButtons" /> <java-symbol type="bool" name="config_tintNotificationsWithTheme" /> <java-symbol type="bool" name="config_dozeAfterScreenOffByDefault" /> <java-symbol type="bool" name="config_enableActivityRecognitionHardwareOverlay" /> <java-symbol type="bool" name="config_enableFusedLocationOverlay" /> Loading
core/tests/coretests/src/android/app/NotificationTest.java +5 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.content.Context; import android.content.Intent; import android.content.LocusId; import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.drawable.Icon; import android.media.session.MediaSession; import android.os.Build; Loading Loading @@ -60,7 +61,7 @@ public class NotificationTest { public void testColorizedByPermission() { Notification n = new Notification.Builder(mContext, "test") .setFlag(Notification.FLAG_CAN_COLORIZE, true) .setColorized(true) .setColorized(true).setColor(Color.WHITE) .build(); assertTrue(n.isColorized()); Loading @@ -71,7 +72,7 @@ public class NotificationTest { n = new Notification.Builder(mContext, "test") .setFlag(Notification.FLAG_CAN_COLORIZE, false) .setColorized(true) .setColorized(true).setColor(Color.WHITE) .build(); assertFalse(n.isColorized()); } Loading @@ -80,7 +81,7 @@ public class NotificationTest { public void testColorizedByForeground() { Notification n = new Notification.Builder(mContext, "test") .setFlag(Notification.FLAG_FOREGROUND_SERVICE, true) .setColorized(true) .setColorized(true).setColor(Color.WHITE) .build(); assertTrue(n.isColorized()); Loading @@ -91,7 +92,7 @@ public class NotificationTest { n = new Notification.Builder(mContext, "test") .setFlag(Notification.FLAG_FOREGROUND_SERVICE, false) .setColorized(true) .setColorized(true).setColor(Color.WHITE) .build(); assertFalse(n.isColorized()); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java +4 −10 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ public class NotificationChildrenContainer extends ViewGroup { private ViewGroup mCurrentHeader; private boolean mIsConversation; private boolean mTintWithThemeAccent; private boolean mShowGroupCountInExpander; private boolean mShowDividersWhenExpanded; private boolean mHideDividersDuringExpand; Loading Loading @@ -149,8 +148,6 @@ public class NotificationChildrenContainer extends ViewGroup { com.android.internal.R.dimen.notification_content_margin); mEnableShadowOnChildNotifications = res.getBoolean(R.bool.config_enableShadowOnChildNotifications); mTintWithThemeAccent = res.getBoolean(com.android.internal.R.bool.config_tintNotificationsWithTheme); mShowGroupCountInExpander = res.getBoolean(R.bool.config_showNotificationGroupCountInExpander); mShowDividersWhenExpanded = Loading Loading @@ -1223,14 +1220,11 @@ public class NotificationChildrenContainer extends ViewGroup { return; } int color = mContainingNotification.getNotificationColor(); if (mTintWithThemeAccent) { // We're using the theme accent, color with the accent color instead of the notif color Resources.Theme theme = new ContextThemeWrapper(mContext, com.android.internal.R.style.Theme_DeviceDefault_DayNight).getTheme(); TypedArray ta = theme.obtainStyledAttributes( new int[]{com.android.internal.R.attr.colorAccent}); try (TypedArray ta = theme.obtainStyledAttributes( new int[]{com.android.internal.R.attr.colorAccent})) { color = ta.getColor(0, color); ta.recycle(); } mHybridGroupManager.setOverflowNumberColor(mOverflowNumber, color); } Loading