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

Commit b014b0c1 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Flag the tint optimization so that we can run other tests with it re-enabled" into main

parents e1d00b6b 74e8d43b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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"
+10 −7
Original line number Diff line number Diff line
@@ -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;
@@ -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);
+3 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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;
            }