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

Commit b8d03a54 authored by Christine Franks's avatar Christine Franks
Browse files

Add config value for a11y color mode

Accessibility transforms require a specific color mode that is not
always available for the user to select.

Bug: 130376719
Test: atest com.google.android.config.pts
Change-Id: If331e663ec50e5507c1e5602e827999ccb6f4dbc
parent a8a18f6d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1094,6 +1094,11 @@
        -->
    </integer-array>

    <!-- Color mode to use when accessibility transforms are enabled. This color mode must be
         supported by the device, but not necessarily appear in config_availableColorModes. The
         regularly selected color mode will be used if this value is negative. -->
    <integer name="config_accessibilityColorMode">-1</integer>

    <!-- Indicate whether to allow the device to suspend when the screen is off
         due to the proximity sensor.  This resource should only be set to true
         if the sensor HAL correctly handles the proximity sensor as a wake-up source.
+1 −0
Original line number Diff line number Diff line
@@ -3185,6 +3185,7 @@
  <java-symbol type="array" name="config_nightDisplayColorTemperatureCoefficients" />
  <java-symbol type="array" name="config_nightDisplayColorTemperatureCoefficientsNative" />
  <java-symbol type="array" name="config_availableColorModes" />
  <java-symbol type="integer" name="config_accessibilityColorMode" />
  <java-symbol type="bool" name="config_displayWhiteBalanceAvailable" />
  <java-symbol type="bool" name="config_displayWhiteBalanceEnabledDefault" />
  <java-symbol type="integer" name="config_displayWhiteBalanceColorTemperatureMin" />
+4 −4
Original line number Diff line number Diff line
@@ -775,10 +775,10 @@ public final class ColorDisplayService extends SystemService {
        final ContentResolver cr = getContext().getContentResolver();
        if (isAccessibilityEnabled()) {
            // There are restrictions on the available color modes combined with a11y transforms.
            if (isColorModeAvailable(COLOR_MODE_SATURATED)) {
                return COLOR_MODE_SATURATED;
            } else if (isColorModeAvailable(COLOR_MODE_AUTOMATIC)) {
                return COLOR_MODE_AUTOMATIC;
            final int a11yColorMode = getContext().getResources().getInteger(
                    R.integer.config_accessibilityColorMode);
            if (a11yColorMode >= 0) {
                return a11yColorMode;
            }
        }