From f8b8e45cb2f1e61e04dd44f6d02e70578fd119f7 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Mon, 29 Mar 2021 15:13:56 -0400 Subject: [PATCH] Fix the text color in the highlighted expander Bug: 183710694 Test: manual Change-Id: Ib95fbb4409e98004f0ea57befec3923508577cce --- core/java/android/app/Notification.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 420ec0846fda1..62704a2a389af 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -5284,6 +5284,11 @@ public class Notification implements Parcelable // Use different highlighted colors except when low-priority mode prevents that if (!p.mReduceHighlights) { pillColor = getAccentTertiaryColor(p); + // TODO(b/183710694): The accent tertiary is currently too bright in dark mode, so + // we need to pick a contrasting color. + textColor = ColorUtils.setAlphaComponent( + ContrastColorUtil.resolvePrimaryColor(mContext, pillColor, mInNightMode), + 0xFF); } contentView.setInt(R.id.expand_button, "setHighlightTextColor", textColor); contentView.setInt(R.id.expand_button, "setHighlightPillColor", pillColor);