Merge "Set min, max, and default RBC strength values" into sc-dev
This commit is contained in:
@@ -830,13 +830,13 @@
|
|||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- Default strength, in percentage, of bright color reduction when activated. -->
|
<!-- 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. -->
|
<!-- 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. -->
|
<!-- 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. -->
|
<!-- Boolean indicating whether display white balance is supported. -->
|
||||||
<bool name="config_displayWhiteBalanceAvailable">false</bool>
|
<bool name="config_displayWhiteBalanceAvailable">false</bool>
|
||||||
|
|||||||
@@ -630,8 +630,12 @@ public final class ColorDisplayService extends SystemService {
|
|||||||
if (mCurrentUser == UserHandle.USER_NULL) {
|
if (mCurrentUser == UserHandle.USER_NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final int strength = Secure.getIntForUser(getContext().getContentResolver(),
|
int strength = Secure.getIntForUser(getContext().getContentResolver(),
|
||||||
Secure.REDUCE_BRIGHT_COLORS_LEVEL, 0, mCurrentUser);
|
Secure.REDUCE_BRIGHT_COLORS_LEVEL, NOT_SET, mCurrentUser);
|
||||||
|
if (strength == NOT_SET) {
|
||||||
|
strength = getContext().getResources().getInteger(
|
||||||
|
R.integer.config_reduceBrightColorsStrengthDefault);
|
||||||
|
}
|
||||||
mReduceBrightColorsTintController.setMatrix(strength);
|
mReduceBrightColorsTintController.setMatrix(strength);
|
||||||
if (mReduceBrightColorsListener != null) {
|
if (mReduceBrightColorsListener != null) {
|
||||||
mReduceBrightColorsListener.onReduceBrightColorsStrengthChanged(strength);
|
mReduceBrightColorsListener.onReduceBrightColorsStrengthChanged(strength);
|
||||||
|
|||||||
Reference in New Issue
Block a user