Loading core/java/android/app/Notification.java +17 −6 Original line number Diff line number Diff line Loading @@ -14818,12 +14818,23 @@ public class Notification implements Parcelable } else { mBackgroundColor = rawColor; } if (Flags.uiRichOngoing()) { boolean isBgDark = Notification.Builder.isColorDark(mBackgroundColor); int onSurfaceColorExtreme = isBgDark ? Color.WHITE : Color.BLACK; mPrimaryTextColor = ContrastColorUtil.ensureContrast( ColorUtils.blendARGB(mBackgroundColor, onSurfaceColorExtreme, 0.9f), mBackgroundColor, isBgDark, 4.5); mSecondaryTextColor = ContrastColorUtil.ensureContrast( ColorUtils.blendARGB(mBackgroundColor, onSurfaceColorExtreme, 0.8f), mBackgroundColor, isBgDark, 4.5); } else { mPrimaryTextColor = ContrastColorUtil.findAlphaToMeetContrast( ContrastColorUtil.resolvePrimaryColor(ctx, mBackgroundColor, nightMode), mBackgroundColor, 4.5); mSecondaryTextColor = ContrastColorUtil.findAlphaToMeetContrast( ContrastColorUtil.resolveSecondaryColor(ctx, mBackgroundColor, nightMode), mBackgroundColor, 4.5); ContrastColorUtil.resolveSecondaryColor(ctx, mBackgroundColor, nightMode), mBackgroundColor, 4.5); } mContrastColor = mPrimaryTextColor; mPrimaryAccentColor = mPrimaryTextColor; mSecondaryAccentColor = mSecondaryTextColor; Loading
core/java/android/app/Notification.java +17 −6 Original line number Diff line number Diff line Loading @@ -14818,12 +14818,23 @@ public class Notification implements Parcelable } else { mBackgroundColor = rawColor; } if (Flags.uiRichOngoing()) { boolean isBgDark = Notification.Builder.isColorDark(mBackgroundColor); int onSurfaceColorExtreme = isBgDark ? Color.WHITE : Color.BLACK; mPrimaryTextColor = ContrastColorUtil.ensureContrast( ColorUtils.blendARGB(mBackgroundColor, onSurfaceColorExtreme, 0.9f), mBackgroundColor, isBgDark, 4.5); mSecondaryTextColor = ContrastColorUtil.ensureContrast( ColorUtils.blendARGB(mBackgroundColor, onSurfaceColorExtreme, 0.8f), mBackgroundColor, isBgDark, 4.5); } else { mPrimaryTextColor = ContrastColorUtil.findAlphaToMeetContrast( ContrastColorUtil.resolvePrimaryColor(ctx, mBackgroundColor, nightMode), mBackgroundColor, 4.5); mSecondaryTextColor = ContrastColorUtil.findAlphaToMeetContrast( ContrastColorUtil.resolveSecondaryColor(ctx, mBackgroundColor, nightMode), mBackgroundColor, 4.5); ContrastColorUtil.resolveSecondaryColor(ctx, mBackgroundColor, nightMode), mBackgroundColor, 4.5); } mContrastColor = mPrimaryTextColor; mPrimaryAccentColor = mPrimaryTextColor; mSecondaryAccentColor = mSecondaryTextColor;