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

Commit 4f98d3cc authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Introduce Color Fidelity sysprop

This sysprop will allow the Material team to test Color Fidelity on real
Android UI.
Instead of fixed tones, albers resolution will be performed for
resolving color tokens.

Test: adb shell setprop persist.fidelity_on_theme_variants 1
Test: go/state_of_fidelity_udc
Bug: 269658900
Change-Id: I67ea606073b6c5abd22d2f6eb553a4a855411c0e
parent f1780e12
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.monet.dynamiccolor;

import android.os.SystemProperties;

import com.android.systemui.monet.dislike.DislikeAnalyzer;
import com.android.systemui.monet.dynamiccolor.DynamicColor;
import com.android.systemui.monet.dynamiccolor.ToneDeltaConstraint;
@@ -28,7 +30,8 @@ import com.android.systemui.monet.scheme.Variant;
/** Named colors, otherwise known as tokens, or roles, in the Material Design system. */
public final class MaterialDynamicColors {
    private static final double CONTAINER_ACCENT_TONE_DELTA = 15.0;

    private static final boolean IS_FIDELITY_ON_ALL_VARIANTS = SystemProperties.getBoolean(
            "persist.fidelity_on_theme_variants", false);

    private MaterialDynamicColors() {
    }
@@ -392,6 +395,9 @@ public final class MaterialDynamicColors {
    }

    private static boolean isFidelity(DynamicScheme scheme) {
        if (IS_FIDELITY_ON_ALL_VARIANTS) {
            return scheme.variant != Variant.NEUTRAL && scheme.variant != Variant.MONOCHROME;
        }
        return scheme.variant == Variant.FIDELITY || scheme.variant == Variant.CONTENT;
    }