Merge "Do not post a change in brightness if temporary" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
da2de7c9ed
@@ -1500,6 +1500,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
// Animate the screen brightness when the screen is on or dozing.
|
// Animate the screen brightness when the screen is on or dozing.
|
||||||
// Skip the animation when the screen is off or suspended or transition to/from VR.
|
// Skip the animation when the screen is off or suspended or transition to/from VR.
|
||||||
boolean brightnessAdjusted = false;
|
boolean brightnessAdjusted = false;
|
||||||
|
final boolean brightnessIsTemporary =
|
||||||
|
mAppliedTemporaryBrightness || mAppliedTemporaryAutoBrightnessAdjustment;
|
||||||
if (!mPendingScreenOff) {
|
if (!mPendingScreenOff) {
|
||||||
if (mSkipScreenOnBrightnessRamp) {
|
if (mSkipScreenOnBrightnessRamp) {
|
||||||
if (state == Display.STATE_ON) {
|
if (state == Display.STATE_ON) {
|
||||||
@@ -1532,8 +1534,6 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
// level without it being a noticeable jump since any actual content isn't yet visible.
|
// level without it being a noticeable jump since any actual content isn't yet visible.
|
||||||
final boolean isDisplayContentVisible =
|
final boolean isDisplayContentVisible =
|
||||||
mColorFadeEnabled && mPowerState.getColorFadeLevel() == 1.0f;
|
mColorFadeEnabled && mPowerState.getColorFadeLevel() == 1.0f;
|
||||||
final boolean brightnessIsTemporary =
|
|
||||||
mAppliedTemporaryBrightness || mAppliedTemporaryAutoBrightnessAdjustment;
|
|
||||||
// We only want to animate the brightness if it is between 0.0f and 1.0f.
|
// We only want to animate the brightness if it is between 0.0f and 1.0f.
|
||||||
// brightnessState can contain the values -1.0f and NaN, which we do not want to
|
// brightnessState can contain the values -1.0f and NaN, which we do not want to
|
||||||
// animate to. To avoid this, we check the value first.
|
// animate to. To avoid this, we check the value first.
|
||||||
@@ -1605,7 +1605,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
brightnessAdjusted = saveBrightnessInfo(getScreenBrightnessSetting());
|
brightnessAdjusted = saveBrightnessInfo(getScreenBrightnessSetting());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (brightnessAdjusted) {
|
// Only notify if the brightness adjustment is not temporary (i.e. slider has been released)
|
||||||
|
if (brightnessAdjusted && !brightnessIsTemporary) {
|
||||||
postBrightnessChangeRunnable();
|
postBrightnessChangeRunnable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user