From 88e9a196f25a675d6f5846a002ea7fbd5fde5f0a Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Thu, 15 Jun 2023 13:44:40 +0000 Subject: [PATCH] Revert "Add redundant tint to notification and footer button backgrounds." This reverts commit 881635995c539aceaf181d63d225a0292486f890. Reason for revert: Underlying issue has been resolved. Fixes: 282173943 Change-Id: Ibc785e26bf1fca4b7612de06f11cd7b6aff0430f --- .../row/ActivatableNotificationView.java | 3 +-- .../notification/row/FooterView.java | 20 +++---------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java index 417d4acccf4e5..8af488ea443d5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java @@ -321,8 +321,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView protected void setBackgroundTintColor(int color) { if (color != mCurrentBackgroundTint) { mCurrentBackgroundTint = color; - // TODO(282173943): re-enable this tinting optimization when Resources are thread-safe - if (false && color == mNormalColor) { + if (color == mNormalColor) { // We don't need to tint a normal notification color = 0; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java index 0989df61a5e35..6bbeebfdb431a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java @@ -16,15 +16,11 @@ 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; @@ -161,20 +157,10 @@ public class FooterView extends StackScrollerDecorView { */ public void updateColors() { Resources.Theme theme = mContext.getTheme(); - 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); + int textColor = getResources().getColor(R.color.notif_pill_text, theme); + mClearAllButton.setBackground(theme.getDrawable(R.drawable.notif_footer_btn_background)); mClearAllButton.setTextColor(textColor); - mManageButton.setBackground(manageBg); + mManageButton.setBackground(theme.getDrawable(R.drawable.notif_footer_btn_background)); mManageButton.setTextColor(textColor); final @ColorInt int labelTextColor = Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorPrimary);