Loading services/core/java/com/android/server/display/DisplayPowerController.java +3 −3 Original line number Diff line number Diff line Loading @@ -817,9 +817,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call mDisplayDeviceConfig = config; loadFromDisplayDeviceConfig(token, info); // Since the underlying display-device changed, we really don't know the // last command that was sent to change it's state. Lets assume it is off and we // trigger a change immediately. /// Since the underlying display-device changed, we really don't know the // last command that was sent to change it's state. Lets assume it is unknown so // that we trigger a change immediately. mPowerState.resetScreenState(); } if (mIsEnabled != isEnabled || mIsInTransition != isInTransition) { Loading services/core/java/com/android/server/display/DisplayPowerState.java +5 −11 Original line number Diff line number Diff line Loading @@ -340,20 +340,12 @@ final class DisplayPowerState { } /** * Resets the screen state to {@link Display#STATE_OFF}. Even though we do not know the last * state that was sent to the underlying display-device, we assume it is off. * * We do not set the screen state to {@link Display#STATE_UNKNOWN} to avoid getting in the state * where PhotonicModulator holds onto the lock. This happens because we currently try to keep * the mScreenState and mPendingState in sync, however if the screenState is set to * {@link Display#STATE_UNKNOWN} here, mPendingState will get progressed to this, which will * force the PhotonicModulator thread to wait onto the lock to take it out of that state. * b/262294651 for more info. * Resets the screen state to unknown. Useful when the underlying display-device changes for the * LogicalDisplay and we do not know the last state that was sent to it. */ void resetScreenState() { mScreenState = Display.STATE_OFF; mScreenState = Display.STATE_UNKNOWN; mScreenReady = false; scheduleScreenUpdate(); } private void scheduleScreenUpdate() { Loading Loading @@ -514,6 +506,8 @@ final class DisplayPowerState { boolean valid = state != Display.STATE_UNKNOWN && !Float.isNaN(brightnessState); boolean changed = stateChanged || backlightChanged; if (!valid || !changed) { mStateChangeInProgress = false; mBacklightChangeInProgress = false; try { mLock.wait(); } catch (InterruptedException ex) { Loading Loading
services/core/java/com/android/server/display/DisplayPowerController.java +3 −3 Original line number Diff line number Diff line Loading @@ -817,9 +817,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call mDisplayDeviceConfig = config; loadFromDisplayDeviceConfig(token, info); // Since the underlying display-device changed, we really don't know the // last command that was sent to change it's state. Lets assume it is off and we // trigger a change immediately. /// Since the underlying display-device changed, we really don't know the // last command that was sent to change it's state. Lets assume it is unknown so // that we trigger a change immediately. mPowerState.resetScreenState(); } if (mIsEnabled != isEnabled || mIsInTransition != isInTransition) { Loading
services/core/java/com/android/server/display/DisplayPowerState.java +5 −11 Original line number Diff line number Diff line Loading @@ -340,20 +340,12 @@ final class DisplayPowerState { } /** * Resets the screen state to {@link Display#STATE_OFF}. Even though we do not know the last * state that was sent to the underlying display-device, we assume it is off. * * We do not set the screen state to {@link Display#STATE_UNKNOWN} to avoid getting in the state * where PhotonicModulator holds onto the lock. This happens because we currently try to keep * the mScreenState and mPendingState in sync, however if the screenState is set to * {@link Display#STATE_UNKNOWN} here, mPendingState will get progressed to this, which will * force the PhotonicModulator thread to wait onto the lock to take it out of that state. * b/262294651 for more info. * Resets the screen state to unknown. Useful when the underlying display-device changes for the * LogicalDisplay and we do not know the last state that was sent to it. */ void resetScreenState() { mScreenState = Display.STATE_OFF; mScreenState = Display.STATE_UNKNOWN; mScreenReady = false; scheduleScreenUpdate(); } private void scheduleScreenUpdate() { Loading Loading @@ -514,6 +506,8 @@ final class DisplayPowerState { boolean valid = state != Display.STATE_UNKNOWN && !Float.isNaN(brightnessState); boolean changed = stateChanged || backlightChanged; if (!valid || !changed) { mStateChangeInProgress = false; mBacklightChangeInProgress = false; try { mLock.wait(); } catch (InterruptedException ex) { Loading