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

Commit 04ebfba6 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

Prevent RONs from using foreground color spans

Bug: 411096572
Test: Presubmit and Post a RON with ProgressStyle app and see no color in content
Flag: android.app.ui_rich_ongoing
Change-Id: I6626db0f64f231f7540e956a9be353f34729bede
parent 7e8e08a4
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -7143,9 +7143,7 @@ public class Notification implements Parcelable
            if (isLowPriority) {
                params.highlightExpander(false);
            }
            if (!mN.isPromotedOngoing()) {
            params.disallowColorization();
            }
            view = makeNotificationHeader(params);
            view.setBoolean(R.id.notification_header, "setExpandOnlyOnButton", true);
            mN.extras = savedBundle;
@@ -7383,8 +7381,7 @@ public class Notification implements Parcelable
        public CharSequence ensureColorSpanContrastOrStripStyling(CharSequence cs,
                int buttonFillColor) {
            // Ongoing promoted notifications are allowed to have styling.
            final boolean isPromotedOngoing = mN.isPromotedOngoing();
            if (!isPromotedOngoing && Flags.cleanUpSpansAndNewLines()) {
            if (Flags.cleanUpSpansAndNewLines()) {
                return stripStyling(cs);
            }
@@ -8992,8 +8989,7 @@ public class Notification implements Parcelable
            // Replace the text with the big text, but only if the big text is not empty.
            CharSequence bigTextText = mBuilder.processLegacyText(mBigText);
            // Ongoing promoted notifications are allowed to have styling.
            final boolean isPromotedOngoing = mBuilder.mN.isPromotedOngoing();
            if (!isPromotedOngoing && Flags.cleanUpSpansAndNewLines()) {
            if (Flags.cleanUpSpansAndNewLines()) {
                bigTextText = normalizeBigText(stripStyling(bigTextText));
            }
            if (!TextUtils.isEmpty(bigTextText)) {