Fix contrast levels of outline and outline_variant

Downstreamed MCU to fix contrast levels of outline and outline_variant.

Test: flash, switch themes
Test: atest SystemPaletteTest
Fixes: 284426073
Bug: 284421298
Change-Id: I68ea14f473b41c053235fc534844f8d07c1b5eb1
This commit is contained in:
Lucas Dupin
2023-05-26 02:33:00 -07:00
parent 8aede728ac
commit 35fff40d1b
3 changed files with 538 additions and 484 deletions

View File

@@ -18,10 +18,11 @@ package com.android.systemui.theme
import android.util.Pair
import com.android.systemui.monet.dynamiccolor.DynamicColor
import com.android.systemui.monet.dynamiccolor.MaterialDynamicColors as MDC
import com.android.systemui.monet.dynamiccolor.MaterialDynamicColors
class DynamicColors {
companion object {
private val MDC = MaterialDynamicColors()
@JvmField
val ALL_DYNAMIC_COLORS_MAPPED: List<Pair<String, DynamicColor>> =
arrayListOf(

View File

@@ -659,6 +659,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
Resources res = userHandle.isSystem()
? mResources : mContext.createContextAsUser(userHandle, 0).getResources();
Resources.Theme theme = mContext.getTheme();
MaterialDynamicColors dynamicColors = new MaterialDynamicColors();
if (!(res.getColor(android.R.color.system_accent1_500, theme)
== mColorScheme.getAccent1().getS500()
&& res.getColor(android.R.color.system_accent2_500, theme)
@@ -670,15 +671,15 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
&& res.getColor(android.R.color.system_neutral2_500, theme)
== mColorScheme.getNeutral2().getS500()
&& res.getColor(android.R.color.system_outline_variant_dark, theme)
== MaterialDynamicColors.outlineVariant().getArgb(mDynamicSchemeDark)
== dynamicColors.outlineVariant().getArgb(mDynamicSchemeDark)
&& res.getColor(android.R.color.system_outline_variant_light, theme)
== MaterialDynamicColors.outlineVariant().getArgb(mDynamicSchemeLight)
== dynamicColors.outlineVariant().getArgb(mDynamicSchemeLight)
&& res.getColor(android.R.color.system_primary_container_dark, theme)
== MaterialDynamicColors.primaryContainer().getArgb(mDynamicSchemeDark)
== dynamicColors.primaryContainer().getArgb(mDynamicSchemeDark)
&& res.getColor(android.R.color.system_primary_container_light, theme)
== MaterialDynamicColors.primaryContainer().getArgb(mDynamicSchemeLight)
== dynamicColors.primaryContainer().getArgb(mDynamicSchemeLight)
&& res.getColor(android.R.color.system_primary_fixed, theme)
== MaterialDynamicColors.primaryFixed().getArgb(mDynamicSchemeLight))) {
== dynamicColors.primaryFixed().getArgb(mDynamicSchemeLight))) {
return false;
}
}