Merge "Don't animate screen brightness if there is a pending off transition" into lmp-sprout-dev

This commit is contained in:
Prashant Malani
2014-11-15 09:46:32 +00:00
committed by Android (Google) Code Review

View File

@@ -654,12 +654,14 @@ 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. // Skip the animation when the screen is off or suspended.
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 : BRIGHTNESS_RAMP_RATE_FAST); slowChange ? BRIGHTNESS_RAMP_RATE_SLOW : BRIGHTNESS_RAMP_RATE_FAST);
} else { } else {
animateScreenBrightness(brightness, 0); animateScreenBrightness(brightness, 0);
} }
}
// Determine whether the display is ready for use in the newly requested state. // Determine whether the display is ready for use in the newly requested state.
// Note that we do not wait for the brightness ramp animation to complete before // Note that we do not wait for the brightness ramp animation to complete before