Actually wait until the display is ready.

When this was rewritten to only wait for display state changes and not
brightness changes, it forgot to take into account whether a change was
already in flight when reporting whether a change was happening. Fix
that so the display appropriately reports when it's ready and when it's
blocked.

Bug: 32559368
Test: Take systrace of device wakeup, see it actually waits until the
      display is actually ready

Change-Id: Ie3bd5c48d109a0fb2628ccc8f67bb52be51fad5c
This commit is contained in:
Michael Wright
2017-06-06 22:01:20 +01:00
parent 4deefdbe7a
commit 640666fcfd

View File

@@ -369,8 +369,8 @@ final class DisplayPowerState {
mPendingBacklight = backlight;
boolean changeInProgress = mStateChangeInProgress || mBacklightChangeInProgress;
mStateChangeInProgress = stateChanged;
mBacklightChangeInProgress = backlightChanged;
mStateChangeInProgress = stateChanged || mStateChangeInProgress;
mBacklightChangeInProgress = backlightChanged || mBacklightChangeInProgress;
if (!changeInProgress) {
mLock.notifyAll();