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

Commit 245ffd4b authored by Christine Franks's avatar Christine Franks
Browse files

Add ColorDisplayServiceInternal local service

For display white balance and grayscale

Bug: 111215474
Test: atest FrameworksServicesTest:ColorDisplayServiceTest
Change-Id: I5c7b6543665e520b4e167ac8e6719f337018f172
parent ae632d2e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -60,6 +60,13 @@ public final class ColorDisplayManager {
        return context.getResources().getBoolean(R.bool.config_nightDisplayAvailable);
    }

    /**
     * Returns {@code true} if display white balance is supported by the device.
     */
    public static boolean isDisplayWhiteBalanceAvailable(Context context) {
        return context.getResources().getBoolean(R.bool.config_displayWhiteBalanceAvailable);
    }

    private static class ColorDisplayManagerInternal {

        private static ColorDisplayManagerInternal sInstance;
+11 −0
Original line number Diff line number Diff line
@@ -7956,6 +7956,15 @@ public final class Settings {
        public static final String NIGHT_DISPLAY_LAST_ACTIVATED_TIME =
                "night_display_last_activated_time";
        /**
         * Control whether display white balance is currently enabled.
         * @hide
         */
        public static final String DISPLAY_WHITE_BALANCE_ENABLED = "display_white_balance_enabled";
        private static final Validator DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR =
                BOOLEAN_VALIDATOR;
        /**
         * Names of the service components that the current user has explicitly allowed to
         * be a VR mode listener, separated by ':'.
@@ -8405,6 +8414,7 @@ public final class Settings {
            NIGHT_DISPLAY_CUSTOM_END_TIME,
            NIGHT_DISPLAY_COLOR_TEMPERATURE,
            NIGHT_DISPLAY_AUTO_MODE,
            DISPLAY_WHITE_BALANCE_ENABLED,
            SYNC_PARENT_SOUNDS,
            CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
            SWIPE_UP_TO_SWITCH_APPS_ENABLED,
@@ -8552,6 +8562,7 @@ public final class Settings {
            VALIDATORS.put(NIGHT_DISPLAY_COLOR_TEMPERATURE,
                    NIGHT_DISPLAY_COLOR_TEMPERATURE_VALIDATOR);
            VALIDATORS.put(NIGHT_DISPLAY_AUTO_MODE, NIGHT_DISPLAY_AUTO_MODE_VALIDATOR);
            VALIDATORS.put(DISPLAY_WHITE_BALANCE_ENABLED, DISPLAY_WHITE_BALANCE_ENABLED_VALIDATOR);
            VALIDATORS.put(SYNC_PARENT_SOUNDS, SYNC_PARENT_SOUNDS_VALIDATOR);
            VALIDATORS.put(CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
                    CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED_VALIDATOR);
+3 −0
Original line number Diff line number Diff line
@@ -929,6 +929,9 @@
         in hardware. -->
    <bool name="config_setColorTransformAccelerated">false</bool>

    <!-- Boolean indicating whether display white balance is supported. -->
    <bool name="config_displayWhiteBalanceAvailable">false</bool>

    <!-- Control whether Night display is available. This should only be enabled on devices
         that have a HWC implementation that can apply the matrix passed to setColorTransform
         without impacting power, performance, and app compatibility (e.g. protected content). -->
+1 −0
Original line number Diff line number Diff line
@@ -3028,6 +3028,7 @@
  <java-symbol type="drawable" name="ic_doc_generic" />

  <java-symbol type="bool" name="config_setColorTransformAccelerated" />
  <java-symbol type="bool" name="config_displayWhiteBalanceAvailable" />
  <java-symbol type="bool" name="config_nightDisplayAvailable" />
  <java-symbol type="bool" name="config_allowDisablingAssistDisclosure" />
  <java-symbol type="integer" name="config_defaultNightDisplayAutoMode" />
+277 −97

File changed.

Preview size limit exceeded, changes collapsed.

Loading