am 4d269ba3: am fb26a2c8: Merge "Don\'t animate screen brightness if there is a pending off transition" into lmp-sprout-dev

* commit '4d269ba32037485bfa5ffba4dd23f796cbf10c43':
  Don't animate screen brightness if there is a pending off transition
This commit is contained in:
Prashant Malani
2014-11-15 10:04:00 +00:00
committed by Android Git Automerger

View File

@@ -669,11 +669,13 @@ 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 (state == Display.STATE_ON || state == Display.STATE_DOZE) { if (!mPendingScreenOff) {
animateScreenBrightness(brightness, if (state == Display.STATE_ON || state == Display.STATE_DOZE) {
slowChange ? BRIGHTNESS_RAMP_RATE_SLOW : BRIGHTNESS_RAMP_RATE_FAST); animateScreenBrightness(brightness,
} else { slowChange ? BRIGHTNESS_RAMP_RATE_SLOW : BRIGHTNESS_RAMP_RATE_FAST);
animateScreenBrightness(brightness, 0); } else {
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.