Merge "Set min, max, and default RBC strength values" into sc-dev am: b60de846d4

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13991017

Change-Id: I440633f5344f26ff2f9228fe6e5d0e78e8e555f5
This commit is contained in:
Sally Yuen
2021-03-30 18:27:49 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 5 deletions

View File

@@ -830,13 +830,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>

View File

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