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

Commit c943ce1a authored by sallyyuen's avatar sallyyuen Committed by Sally Yuen
Browse files

Set min, max, and default RBC strength values

Test: Manual testing, adb shell commands
atest FrameworksServicesTests:ReduceBrightColorsTintControllerTest
and atest FrameworksServicesTests:ColorDisplayServiceTest
Bug: 179805222
Change-Id: I4b182d9f46c42fc18594519200443e9fce8d5469
parent 2cea467f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -828,13 +828,13 @@
    </string-array>

    <!-- Default strength, in percentage, of bright color reduction when activated. -->
    <integer name="config_reduceBrightColorsStrengthDefault">0</integer>
    <integer name="config_reduceBrightColorsStrengthDefault">50</integer>

    <!-- Minimum strength, in percentage, supported by bright color reduction. -->
    <integer name="config_reduceBrightColorsStrengthMin">0</integer>
    <integer name="config_reduceBrightColorsStrengthMin">25</integer>

    <!-- Maximum strength, in percentage, supported by bright color reduction. -->
    <integer name="config_reduceBrightColorsStrengthMax">100</integer>
    <integer name="config_reduceBrightColorsStrengthMax">90</integer>

    <!-- Boolean indicating whether display white balance is supported. -->
    <bool name="config_displayWhiteBalanceAvailable">false</bool>
+6 −2
Original line number Diff line number Diff line
@@ -630,8 +630,12 @@ public final class ColorDisplayService extends SystemService {
        if (mCurrentUser == UserHandle.USER_NULL) {
            return;
        }
        final int strength = Secure.getIntForUser(getContext().getContentResolver(),
                Secure.REDUCE_BRIGHT_COLORS_LEVEL, 0, mCurrentUser);
        int strength = Secure.getIntForUser(getContext().getContentResolver(),
                Secure.REDUCE_BRIGHT_COLORS_LEVEL, NOT_SET, mCurrentUser);
        if (strength == NOT_SET) {
            strength = getContext().getResources().getInteger(
                    R.integer.config_reduceBrightColorsStrengthDefault);
        }
        mReduceBrightColorsTintController.setMatrix(strength);
        if (mReduceBrightColorsListener != null) {
            mReduceBrightColorsListener.onReduceBrightColorsStrengthChanged(strength);