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

Commit 74e8d43b authored by Jeff DeCew's avatar Jeff DeCew
Browse files

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

Bug: 282173943
Bug: 294347738
Flag: ACONFIG com.android.systemui.Flags.notification_background_tint_optimization DEVELOPMENT
Test: manual
Change-Id: I14a9d8cab2c875086cedf64db1ffb89778a4cb72
parent 05a2e365
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;
            }