Skip to content

Commit 645b05a

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "Blank all displays including Wifi Display when screen is off." into jb-mr1-dev
2 parents fe3376b + 8ec0943 commit 645b05a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

services/java/com/android/server/display/DisplayManagerService.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ public void blankAllDisplaysFromPowerManager() {
305305
DisplayDevice device = mDisplayDevices.get(i);
306306
device.blankLocked();
307307
}
308+
309+
scheduleTraversalLocked(false);
308310
}
309311
}
310312
}
@@ -322,6 +324,8 @@ public void unblankAllDisplaysFromPowerManager() {
322324
DisplayDevice device = mDisplayDevices.get(i);
323325
device.unblankLocked();
324326
}
327+
328+
scheduleTraversalLocked(false);
325329
}
326330
}
327331
}
@@ -755,7 +759,9 @@ private void configureDisplayInTransactionLocked(DisplayDevice device) {
755759
+ device.getDisplayDeviceInfoLocked());
756760
return;
757761
} else {
758-
display.configureDisplayInTransactionLocked(device);
762+
boolean isBlanked = (mAllDisplayBlankStateFromPowerManager
763+
== DISPLAY_BLANK_STATE_BLANKED);
764+
display.configureDisplayInTransactionLocked(device, isBlanked);
759765
}
760766

761767
// Update the viewports if needed.

services/java/com/android/server/display/LogicalDisplay.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
final class LogicalDisplay {
5656
private final DisplayInfo mBaseDisplayInfo = new DisplayInfo();
5757

58+
// The layer stack we use when the display has been blanked to prevent any
59+
// of its content from appearing.
60+
private static final int BLANK_LAYER_STACK = -1;
61+
5862
private final int mDisplayId;
5963
private final int mLayerStack;
6064
private DisplayInfo mOverrideDisplayInfo; // set by the window manager
@@ -217,13 +221,15 @@ public void updateLocked(List<DisplayDevice> devices) {
217221
* where the display is being mirrored.
218222
*
219223
* @param device The display device to modify.
224+
* @param isBlanked True if the device is being blanked.
220225
*/
221-
public void configureDisplayInTransactionLocked(DisplayDevice device) {
226+
public void configureDisplayInTransactionLocked(DisplayDevice device,
227+
boolean isBlanked) {
222228
final DisplayInfo displayInfo = getDisplayInfoLocked();
223229
final DisplayDeviceInfo displayDeviceInfo = device.getDisplayDeviceInfoLocked();
224230

225231
// Set the layer stack.
226-
device.setLayerStackInTransactionLocked(mLayerStack);
232+
device.setLayerStackInTransactionLocked(isBlanked ? BLANK_LAYER_STACK : mLayerStack);
227233

228234
// Set the viewport.
229235
// This is the area of the logical display that we intend to show on the

0 commit comments

Comments
 (0)