diff options
| author | 2021-02-24 10:14:13 -0800 | |
|---|---|---|
| committer | 2021-02-24 13:58:49 -0800 | |
| commit | 57733d9be8d492e369dd9f9ab247402725d65a3d (patch) | |
| tree | 2ebd6345aea2603ad302704889890cb7f19477d5 | |
| parent | 1f21265785954fb3e9a5e9de204999bb80602c27 (diff) | |
Add configurable strength values for Reduce Bright Colors
Test: atest FrameworkServicesTests:ReduceBrightColorsTintControllerTest,
atest FrameworksServicesTests:ColorDisplayServiceTest
Bug: b/179805222
Change-Id: I70bfedd9d2226abac2a2cb6952ffb835ea8891d5
| -rw-r--r-- | core/java/android/hardware/display/ColorDisplayManager.java | 20 | ||||
| -rw-r--r-- | core/res/res/values/config.xml | 9 | ||||
| -rw-r--r-- | core/res/res/values/symbols.xml | 3 |
3 files changed, 32 insertions, 0 deletions
diff --git a/core/java/android/hardware/display/ColorDisplayManager.java b/core/java/android/hardware/display/ColorDisplayManager.java index e247df320115..aafa7d520632 100644 --- a/core/java/android/hardware/display/ColorDisplayManager.java +++ b/core/java/android/hardware/display/ColorDisplayManager.java @@ -537,6 +537,26 @@ public final class ColorDisplayManager { } /** + * Returns the minimum allowed brightness reduction strength in percentage when activated. + * + * @hide + */ + public static int getMinimumReduceBrightColorsStrength(Context context) { + return context.getResources() + .getInteger(R.integer.config_reduceBrightColorsStrengthMin); + } + + /** + * Returns the maximum allowed brightness reduction strength in percentage when activated. + * + * @hide + */ + public static int getMaximumReduceBrightColorsStrength(Context context) { + return context.getResources() + .getInteger(R.integer.config_reduceBrightColorsStrengthMax); + } + + /** * Check if the color transforms are color accelerated. Some transforms are experimental only * on non-accelerated platforms due to the performance implications. * diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 9a917b72a5fd..a9b681a5529b 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -848,6 +848,15 @@ <!-- y-intercept --> <item>1.000000000000000</item> </string-array> + <!-- Default strength, in percentage, of bright color reduction when activated. --> + <integer name="config_reduceBrightColorsStrengthDefault">0</integer> + + <!-- Minimum strength, in percentage, supported by bright color reduction. --> + <integer name="config_reduceBrightColorsStrengthMin">0</integer> + + <!-- Maximum strength, in percentage, supported by bright color reduction. --> + <integer name="config_reduceBrightColorsStrengthMax">100</integer> + <!-- Boolean indicating whether display white balance is supported. --> <bool name="config_displayWhiteBalanceAvailable">false</bool> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index b5af5240b843..e560d823a79c 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3223,6 +3223,9 @@ <java-symbol type="bool" name="config_reduceBrightColorsAvailable" /> <java-symbol type="array" name="config_reduceBrightColorsCoefficients" /> <java-symbol type="array" name="config_reduceBrightColorsCoefficientsNonlinear" /> + <java-symbol type="integer" name="config_reduceBrightColorsStrengthDefault" /> + <java-symbol type="integer" name="config_reduceBrightColorsStrengthMin" /> + <java-symbol type="integer" name="config_reduceBrightColorsStrengthMax" /> <java-symbol type="array" name="config_availableColorModes" /> <java-symbol type="array" name="config_mappedColorModes" /> <java-symbol type="string" name="config_vendorColorModesRestoreHint" /> |