Loading services/core/java/com/android/server/display/DisplayManagerService.java +7 −8 Original line number Diff line number Diff line Loading @@ -1128,7 +1128,7 @@ public final class DisplayManagerService extends SystemService { recordTopInsetLocked(display); } addDisplayPowerControllerLocked(display); mDisplayStates.append(displayId, Display.STATE_OFF); mDisplayStates.append(displayId, Display.STATE_UNKNOWN); mDisplayBrightnesses.append(displayId, display.getDisplayInfoLocked().brightnessDefault); DisplayManagerGlobal.invalidateLocalDisplayInfoCaches(); Loading Loading @@ -1204,17 +1204,16 @@ public final class DisplayManagerService extends SystemService { DisplayDeviceInfo info = device.getDisplayDeviceInfoLocked(); if ((info.flags & DisplayDeviceInfo.FLAG_NEVER_BLANK) == 0) { final LogicalDisplay display = mLogicalDisplayMapper.getDisplayLocked(device); final int state; final int displayId = display.getDisplayIdLocked(); final int state = mDisplayStates.get(displayId); if (display.isEnabled()) { state = mDisplayStates.get(displayId); } else { state = Display.STATE_OFF; } // Only send a request for display state if the display state has already been // initialized by DisplayPowercontroller. if (state != Display.STATE_UNKNOWN) { final float brightness = mDisplayBrightnesses.get(displayId); return device.requestDisplayStateLocked(state, brightness); } } return null; } Loading services/core/java/com/android/server/display/DisplayPowerController.java +2 −1 Original line number Diff line number Diff line Loading @@ -982,7 +982,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call mWaitingForNegativeProximity = false; mIgnoreProximityUntilChanged = false; } if (mScreenOffBecauseOfProximity) { if (!mLogicalDisplay.isEnabled() || mScreenOffBecauseOfProximity) { state = Display.STATE_OFF; } Loading services/core/java/com/android/server/display/LocalDisplayAdapter.java +4 −1 Original line number Diff line number Diff line Loading @@ -682,7 +682,10 @@ final class LocalDisplayAdapter extends DisplayAdapter { || oldState == Display.STATE_ON_SUSPEND) { setDisplayState(Display.STATE_ON); currentState = Display.STATE_ON; } else { // If UNKNOWN, we still want to set the initial display state, // otherwise, return early. } else if (oldState != Display.STATE_UNKNOWN) { return; // old state and new state is off } } Loading Loading
services/core/java/com/android/server/display/DisplayManagerService.java +7 −8 Original line number Diff line number Diff line Loading @@ -1128,7 +1128,7 @@ public final class DisplayManagerService extends SystemService { recordTopInsetLocked(display); } addDisplayPowerControllerLocked(display); mDisplayStates.append(displayId, Display.STATE_OFF); mDisplayStates.append(displayId, Display.STATE_UNKNOWN); mDisplayBrightnesses.append(displayId, display.getDisplayInfoLocked().brightnessDefault); DisplayManagerGlobal.invalidateLocalDisplayInfoCaches(); Loading Loading @@ -1204,17 +1204,16 @@ public final class DisplayManagerService extends SystemService { DisplayDeviceInfo info = device.getDisplayDeviceInfoLocked(); if ((info.flags & DisplayDeviceInfo.FLAG_NEVER_BLANK) == 0) { final LogicalDisplay display = mLogicalDisplayMapper.getDisplayLocked(device); final int state; final int displayId = display.getDisplayIdLocked(); final int state = mDisplayStates.get(displayId); if (display.isEnabled()) { state = mDisplayStates.get(displayId); } else { state = Display.STATE_OFF; } // Only send a request for display state if the display state has already been // initialized by DisplayPowercontroller. if (state != Display.STATE_UNKNOWN) { final float brightness = mDisplayBrightnesses.get(displayId); return device.requestDisplayStateLocked(state, brightness); } } return null; } Loading
services/core/java/com/android/server/display/DisplayPowerController.java +2 −1 Original line number Diff line number Diff line Loading @@ -982,7 +982,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call mWaitingForNegativeProximity = false; mIgnoreProximityUntilChanged = false; } if (mScreenOffBecauseOfProximity) { if (!mLogicalDisplay.isEnabled() || mScreenOffBecauseOfProximity) { state = Display.STATE_OFF; } Loading
services/core/java/com/android/server/display/LocalDisplayAdapter.java +4 −1 Original line number Diff line number Diff line Loading @@ -682,7 +682,10 @@ final class LocalDisplayAdapter extends DisplayAdapter { || oldState == Display.STATE_ON_SUSPEND) { setDisplayState(Display.STATE_ON); currentState = Display.STATE_ON; } else { // If UNKNOWN, we still want to set the initial display state, // otherwise, return early. } else if (oldState != Display.STATE_UNKNOWN) { return; // old state and new state is off } } Loading