Merge "Add config value for a11y color mode" into qt-dev

This commit is contained in:
Christine Franks
2019-05-13 14:47:21 +00:00
committed by Android (Google) Code Review
3 changed files with 10 additions and 4 deletions

View File

@@ -1110,6 +1110,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.

View File

@@ -3186,6 +3186,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" />

View File

@@ -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;
}
}