Loading packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,16 @@ flag { bug: "307288824" } flag { name: "notification_background_tint_optimization" namespace: "systemui" description: "Re-enable the codepath that removed tinting of notifications when the" " standard background color is desired. This was the behavior before we discovered" " a resources threading issue, which we worked around by tinting the notification" " backgrounds and footer buttons." bug: "294347738" } flag { name: "scene_container" namespace: "systemui" Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java +10 −7 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.systemui.statusbar.notification.footer.ui.view; import static android.graphics.PorterDuff.Mode.SRC_ATOP; import static com.android.systemui.Flags.notificationBackgroundTintOptimization; import android.annotation.ColorInt; import android.annotation.DrawableRes; import android.annotation.StringRes; Loading Loading @@ -313,16 +315,17 @@ public class FooterView extends StackScrollerDecorView { Resources.Theme theme = mContext.getTheme(); final @ColorInt int onSurface = Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.materialColorOnSurface); final @ColorInt int scHigh = Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.materialColorSurfaceContainerHigh); 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 ColorFilter bgColorFilter = new PorterDuffColorFilter(scHigh, SRC_ATOP); if (!notificationBackgroundTintOptimization()) { final @ColorInt int scHigh = Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.materialColorSurfaceContainerHigh); if (scHigh != 0) { final ColorFilter bgColorFilter = new PorterDuffColorFilter(scHigh, SRC_ATOP); clearAllBg.setColorFilter(bgColorFilter); manageBg.setColorFilter(bgColorFilter); } } mClearAllButton.setBackground(clearAllBg); mClearAllButton.setTextColor(onSurface); mManageButton.setBackground(manageBg); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.row; import static com.android.systemui.Flags.notificationBackgroundTintOptimization; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; Loading Loading @@ -309,8 +311,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 (notificationBackgroundTintOptimization() && color == mNormalColor) { // We don't need to tint a normal notification color = 0; } Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,16 @@ flag { bug: "307288824" } flag { name: "notification_background_tint_optimization" namespace: "systemui" description: "Re-enable the codepath that removed tinting of notifications when the" " standard background color is desired. This was the behavior before we discovered" " a resources threading issue, which we worked around by tinting the notification" " backgrounds and footer buttons." bug: "294347738" } flag { name: "scene_container" namespace: "systemui" Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java +10 −7 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.systemui.statusbar.notification.footer.ui.view; import static android.graphics.PorterDuff.Mode.SRC_ATOP; import static com.android.systemui.Flags.notificationBackgroundTintOptimization; import android.annotation.ColorInt; import android.annotation.DrawableRes; import android.annotation.StringRes; Loading Loading @@ -313,16 +315,17 @@ public class FooterView extends StackScrollerDecorView { Resources.Theme theme = mContext.getTheme(); final @ColorInt int onSurface = Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.materialColorOnSurface); final @ColorInt int scHigh = Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.materialColorSurfaceContainerHigh); 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 ColorFilter bgColorFilter = new PorterDuffColorFilter(scHigh, SRC_ATOP); if (!notificationBackgroundTintOptimization()) { final @ColorInt int scHigh = Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.materialColorSurfaceContainerHigh); if (scHigh != 0) { final ColorFilter bgColorFilter = new PorterDuffColorFilter(scHigh, SRC_ATOP); clearAllBg.setColorFilter(bgColorFilter); manageBg.setColorFilter(bgColorFilter); } } mClearAllButton.setBackground(clearAllBg); mClearAllButton.setTextColor(onSurface); mManageButton.setBackground(manageBg); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.row; import static com.android.systemui.Flags.notificationBackgroundTintOptimization; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; Loading Loading @@ -309,8 +311,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 (notificationBackgroundTintOptimization() && color == mNormalColor) { // We don't need to tint a normal notification color = 0; } Loading