Re-add redundant tint to notification and footer button backgrounds.

This reverts commit 88e9a196f2.

Reason for revert: b/293749407
Bug: 293749407

Change-Id: I769f5259fb519492c698b1cb4d10d1d79ef77f4e
This commit is contained in:
Jeff DeCew
2023-08-03 19:55:51 +00:00
committed by Android (Google) Code Review
parent 88e9a196f2
commit 8c25ea44fd
2 changed files with 19 additions and 4 deletions

View File

@@ -321,7 +321,8 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
protected void setBackgroundTintColor(int color) {
if (color != mCurrentBackgroundTint) {
mCurrentBackgroundTint = color;
if (color == mNormalColor) {
// TODO(282173943): re-enable this tinting optimization when Resources are thread-safe
if (false && color == mNormalColor) {
// We don't need to tint a normal notification
color = 0;
}

View File

@@ -16,11 +16,15 @@
package com.android.systemui.statusbar.notification.row;
import static android.graphics.PorterDuff.Mode.SRC_ATOP;
import android.annotation.ColorInt;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.ColorFilter;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.IndentingPrintWriter;
@@ -157,10 +161,20 @@ public class FooterView extends StackScrollerDecorView {
*/
public void updateColors() {
Resources.Theme theme = mContext.getTheme();
int textColor = getResources().getColor(R.color.notif_pill_text, theme);
mClearAllButton.setBackground(theme.getDrawable(R.drawable.notif_footer_btn_background));
final @ColorInt int textColor = getResources().getColor(R.color.notif_pill_text, theme);
final Drawable clearAllBg = theme.getDrawable(R.drawable.notif_footer_btn_background);
final Drawable manageBg = theme.getDrawable(R.drawable.notif_footer_btn_background);
// TODO(b/282173943): Remove redundant tinting once Resources are thread-safe
final @ColorInt int buttonBgColor =
Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.colorSurface);
final ColorFilter bgColorFilter = new PorterDuffColorFilter(buttonBgColor, SRC_ATOP);
if (buttonBgColor != 0) {
clearAllBg.setColorFilter(bgColorFilter);
manageBg.setColorFilter(bgColorFilter);
}
mClearAllButton.setBackground(clearAllBg);
mClearAllButton.setTextColor(textColor);
mManageButton.setBackground(theme.getDrawable(R.drawable.notif_footer_btn_background));
mManageButton.setBackground(manageBg);
mManageButton.setTextColor(textColor);
final @ColorInt int labelTextColor =
Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorPrimary);