Merge "Add new config to tell us whether brightness is bucketed or continuous" into oc-dr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c541380f91
@@ -1853,6 +1853,9 @@
|
|||||||
<!-- Whether the display blanks itself when transitioning from a doze to a non-doze state -->
|
<!-- Whether the display blanks itself when transitioning from a doze to a non-doze state -->
|
||||||
<bool name="config_displayBlanksAfterDoze">false</bool>
|
<bool name="config_displayBlanksAfterDoze">false</bool>
|
||||||
|
|
||||||
|
<!-- True if the display hardware only has brightness buckets rather than a full range of
|
||||||
|
backlight values -->
|
||||||
|
<bool name="config_displayBrightnessBucketsInDoze">false</bool>
|
||||||
|
|
||||||
<!-- Power Management: Specifies whether to decouple the auto-suspend state of the
|
<!-- Power Management: Specifies whether to decouple the auto-suspend state of the
|
||||||
device from the display on/off state.
|
device from the display on/off state.
|
||||||
|
|||||||
@@ -3051,6 +3051,7 @@
|
|||||||
<java-symbol type="integer" name="config_inCallNotificationVolumeRelative" />
|
<java-symbol type="integer" name="config_inCallNotificationVolumeRelative" />
|
||||||
<java-symbol type="bool" name="config_dozeAlwaysOnDisplayAvailable" />
|
<java-symbol type="bool" name="config_dozeAlwaysOnDisplayAvailable" />
|
||||||
<java-symbol type="bool" name="config_displayBlanksAfterDoze" />
|
<java-symbol type="bool" name="config_displayBlanksAfterDoze" />
|
||||||
|
<java-symbol type="bool" name="config_displayBrightnessBucketsInDoze" />
|
||||||
<java-symbol type="integer" name="config_storageManagerDaystoRetainDefault" />
|
<java-symbol type="integer" name="config_storageManagerDaystoRetainDefault" />
|
||||||
<java-symbol type="string" name="config_headlineFontFamily" />
|
<java-symbol type="string" name="config_headlineFontFamily" />
|
||||||
<java-symbol type="string" name="config_headlineFontFamilyLight" />
|
<java-symbol type="string" name="config_headlineFontFamilyLight" />
|
||||||
|
|||||||
@@ -171,6 +171,12 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
// blank itself and begin an appropriate power on animation.
|
// blank itself and begin an appropriate power on animation.
|
||||||
private boolean mDisplayBlanksAfterDozeConfig;
|
private boolean mDisplayBlanksAfterDozeConfig;
|
||||||
|
|
||||||
|
// True if there are only buckets of brightness values when the display is in the doze state,
|
||||||
|
// rather than a full range of values. If this is true, then we'll avoid animating the screen
|
||||||
|
// brightness since it'd likely be multiple jarring brightness transitions instead of just one
|
||||||
|
// to reach the final state.
|
||||||
|
private boolean mBrightnessBucketsInDozeConfig;
|
||||||
|
|
||||||
// The pending power request.
|
// The pending power request.
|
||||||
// Initially null until the first call to requestPowerState.
|
// Initially null until the first call to requestPowerState.
|
||||||
// Guarded by mLock.
|
// Guarded by mLock.
|
||||||
@@ -419,6 +425,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
mDisplayBlanksAfterDozeConfig = resources.getBoolean(
|
mDisplayBlanksAfterDozeConfig = resources.getBoolean(
|
||||||
com.android.internal.R.bool.config_displayBlanksAfterDoze);
|
com.android.internal.R.bool.config_displayBlanksAfterDoze);
|
||||||
|
|
||||||
|
mBrightnessBucketsInDozeConfig = resources.getBoolean(
|
||||||
|
com.android.internal.R.bool.config_displayBrightnessBucketsInDoze);
|
||||||
|
|
||||||
if (!DEBUG_PRETEND_PROXIMITY_SENSOR_ABSENT) {
|
if (!DEBUG_PRETEND_PROXIMITY_SENSOR_ABSENT) {
|
||||||
mProximitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
|
mProximitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
|
||||||
if (mProximitySensor != null) {
|
if (mProximitySensor != null) {
|
||||||
@@ -780,7 +789,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
boolean wasOrWillBeInVr = (state == Display.STATE_VR || oldState == Display.STATE_VR);
|
boolean wasOrWillBeInVr = (state == Display.STATE_VR || oldState == Display.STATE_VR);
|
||||||
if ((state == Display.STATE_ON
|
if ((state == Display.STATE_ON
|
||||||
&& mSkipRampState == RAMP_STATE_SKIP_NONE
|
&& mSkipRampState == RAMP_STATE_SKIP_NONE
|
||||||
|| state == Display.STATE_DOZE)
|
|| state == Display.STATE_DOZE && !mBrightnessBucketsInDozeConfig)
|
||||||
&& !wasOrWillBeInVr) {
|
&& !wasOrWillBeInVr) {
|
||||||
animateScreenBrightness(brightness,
|
animateScreenBrightness(brightness,
|
||||||
slowChange ? mBrightnessRampRateSlow : mBrightnessRampRateFast);
|
slowChange ? mBrightnessRampRateSlow : mBrightnessRampRateFast);
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ final class DisplayPowerState {
|
|||||||
if (mColorFadePrepared) {
|
if (mColorFadePrepared) {
|
||||||
mColorFade.draw(mColorFadeLevel);
|
mColorFade.draw(mColorFadeLevel);
|
||||||
Trace.traceCounter(Trace.TRACE_TAG_POWER,
|
Trace.traceCounter(Trace.TRACE_TAG_POWER,
|
||||||
COUNTER_COLOR_FADE, Math.round(mColorFadeLevel* 100));
|
COUNTER_COLOR_FADE, Math.round(mColorFadeLevel * 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
mColorFadeReady = true;
|
mColorFadeReady = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user