DO NOT MERGE ANYWHERE: Make slow brightness display ramp rate configurable.
Add overlay setting with current default value. Bug: 30085530 Change-Id: Ib5d2448b88cfb66a97febcdf06e2118c84b16cd0
This commit is contained in:
@@ -538,9 +538,12 @@
|
|||||||
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
|
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
|
||||||
<bool name="config_automatic_brightness_available">false</bool>
|
<bool name="config_automatic_brightness_available">false</bool>
|
||||||
|
|
||||||
<!-- Fast brightness animation ramp rate -->
|
<!-- Fast brightness animation ramp rate in brightness units per second-->
|
||||||
<integer translatable="false" name="config_brightness_ramp_rate_fast">200</integer>
|
<integer translatable="false" name="config_brightness_ramp_rate_fast">200</integer>
|
||||||
|
|
||||||
|
<!-- Slow brightness animation ramp rate in brightness units per second-->
|
||||||
|
<integer translatable="false" name="config_brightness_ramp_rate_slow">40</integer>
|
||||||
|
|
||||||
<!-- Don't name config resources like this. It should look like config_annoyDianne -->
|
<!-- Don't name config resources like this. It should look like config_annoyDianne -->
|
||||||
<bool name="config_annoy_dianne">true</bool>
|
<bool name="config_annoy_dianne">true</bool>
|
||||||
|
|
||||||
|
|||||||
@@ -1722,6 +1722,7 @@
|
|||||||
<java-symbol type="integer" name="config_undockedHdmiRotation" />
|
<java-symbol type="integer" name="config_undockedHdmiRotation" />
|
||||||
<java-symbol type="integer" name="config_virtualKeyQuietTimeMillis" />
|
<java-symbol type="integer" name="config_virtualKeyQuietTimeMillis" />
|
||||||
<java-symbol type="integer" name="config_brightness_ramp_rate_fast" />
|
<java-symbol type="integer" name="config_brightness_ramp_rate_fast" />
|
||||||
|
<java-symbol type="integer" name="config_brightness_ramp_rate_slow" />
|
||||||
<java-symbol type="layout" name="am_compat_mode_dialog" />
|
<java-symbol type="layout" name="am_compat_mode_dialog" />
|
||||||
<java-symbol type="layout" name="launch_warning" />
|
<java-symbol type="layout" name="launch_warning" />
|
||||||
<java-symbol type="layout" name="safe_mode" />
|
<java-symbol type="layout" name="safe_mode" />
|
||||||
|
|||||||
@@ -102,9 +102,6 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
// Trigger proximity if distance is less than 5 cm.
|
// Trigger proximity if distance is less than 5 cm.
|
||||||
private static final float TYPICAL_PROXIMITY_THRESHOLD = 5.0f;
|
private static final float TYPICAL_PROXIMITY_THRESHOLD = 5.0f;
|
||||||
|
|
||||||
// Brightness animation ramp rate in brightness units per second.
|
|
||||||
private static final int BRIGHTNESS_RAMP_RATE_SLOW = 40;
|
|
||||||
|
|
||||||
private static final int REPORTED_TO_POLICY_SCREEN_OFF = 0;
|
private static final int REPORTED_TO_POLICY_SCREEN_OFF = 0;
|
||||||
private static final int REPORTED_TO_POLICY_SCREEN_TURNING_ON = 1;
|
private static final int REPORTED_TO_POLICY_SCREEN_TURNING_ON = 1;
|
||||||
private static final int REPORTED_TO_POLICY_SCREEN_ON = 2;
|
private static final int REPORTED_TO_POLICY_SCREEN_ON = 2;
|
||||||
@@ -243,8 +240,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
private boolean mAppliedDimming;
|
private boolean mAppliedDimming;
|
||||||
private boolean mAppliedLowPower;
|
private boolean mAppliedLowPower;
|
||||||
|
|
||||||
// Brightness ramp rate fast.
|
// Brightness animation ramp rates in brightness units per second
|
||||||
private final int mBrightnessRampRateFast;
|
private final int mBrightnessRampRateFast;
|
||||||
|
private final int mBrightnessRampRateSlow;
|
||||||
|
|
||||||
// The controller for the automatic brightness level.
|
// The controller for the automatic brightness level.
|
||||||
private AutomaticBrightnessController mAutomaticBrightnessController;
|
private AutomaticBrightnessController mAutomaticBrightnessController;
|
||||||
@@ -307,6 +305,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
|
|
||||||
mBrightnessRampRateFast = resources.getInteger(
|
mBrightnessRampRateFast = resources.getInteger(
|
||||||
com.android.internal.R.integer.config_brightness_ramp_rate_fast);
|
com.android.internal.R.integer.config_brightness_ramp_rate_fast);
|
||||||
|
mBrightnessRampRateSlow = resources.getInteger(
|
||||||
|
com.android.internal.R.integer.config_brightness_ramp_rate_slow);
|
||||||
|
|
||||||
int lightSensorRate = resources.getInteger(
|
int lightSensorRate = resources.getInteger(
|
||||||
com.android.internal.R.integer.config_autoBrightnessLightSensorRate);
|
com.android.internal.R.integer.config_autoBrightnessLightSensorRate);
|
||||||
@@ -691,7 +691,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
if (!mPendingScreenOff) {
|
if (!mPendingScreenOff) {
|
||||||
if (state == Display.STATE_ON || state == Display.STATE_DOZE) {
|
if (state == Display.STATE_ON || state == Display.STATE_DOZE) {
|
||||||
animateScreenBrightness(brightness,
|
animateScreenBrightness(brightness,
|
||||||
slowChange ? BRIGHTNESS_RAMP_RATE_SLOW : mBrightnessRampRateFast);
|
slowChange ? mBrightnessRampRateSlow : mBrightnessRampRateFast);
|
||||||
} else {
|
} else {
|
||||||
animateScreenBrightness(brightness, 0);
|
animateScreenBrightness(brightness, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user