Merge "Don't monitor private displays"
This commit is contained in:
@@ -99,13 +99,17 @@ public class DisplayWindowController {
|
||||
if (mDisplays.get(displayId) != null) {
|
||||
return;
|
||||
}
|
||||
Display display = getDisplay(displayId);
|
||||
if (display == null) {
|
||||
// It's likely that the display is private to some app and thus not
|
||||
// accessible by system-ui.
|
||||
return;
|
||||
}
|
||||
DisplayRecord record = new DisplayRecord();
|
||||
record.mDisplayId = displayId;
|
||||
// TODO(b/146566787): disabled for MultiDisplayActivityLaunchTests
|
||||
// Display display = getDisplay(displayId);
|
||||
// record.mContext = (displayId == Display.DEFAULT_DISPLAY) ? mContext
|
||||
// : mContext.createDisplayContext(display);
|
||||
// record.mDisplayLayout = new DisplayLayout(record.mContext, display);
|
||||
record.mContext = (displayId == Display.DEFAULT_DISPLAY) ? mContext
|
||||
: mContext.createDisplayContext(display);
|
||||
record.mDisplayLayout = new DisplayLayout(record.mContext, display);
|
||||
mDisplays.put(displayId, record);
|
||||
for (int i = 0; i < mDisplayChangedListeners.size(); ++i) {
|
||||
mDisplayChangedListeners.get(i).onDisplayAdded(displayId);
|
||||
@@ -124,14 +128,13 @@ public class DisplayWindowController {
|
||||
+ " display.");
|
||||
return;
|
||||
}
|
||||
// TODO(b/146566787): disabled for MultiDisplaySystemDecorationTests
|
||||
// Display display = getDisplay(displayId);
|
||||
// Context perDisplayContext = mContext;
|
||||
// if (displayId != Display.DEFAULT_DISPLAY) {
|
||||
// perDisplayContext = mContext.createDisplayContext(display);
|
||||
// }
|
||||
// dr.mContext = perDisplayContext.createConfigurationContext(newConfig);
|
||||
// dr.mDisplayLayout = new DisplayLayout(dr.mContext, display);
|
||||
Display display = getDisplay(displayId);
|
||||
Context perDisplayContext = mContext;
|
||||
if (displayId != Display.DEFAULT_DISPLAY) {
|
||||
perDisplayContext = mContext.createDisplayContext(display);
|
||||
}
|
||||
dr.mContext = perDisplayContext.createConfigurationContext(newConfig);
|
||||
dr.mDisplayLayout = new DisplayLayout(dr.mContext, display);
|
||||
for (int i = 0; i < mDisplayChangedListeners.size(); ++i) {
|
||||
mDisplayChangedListeners.get(i).onDisplayConfigurationChanged(
|
||||
displayId, newConfig);
|
||||
@@ -144,6 +147,9 @@ public class DisplayWindowController {
|
||||
public void onDisplayRemoved(int displayId) {
|
||||
mHandler.post(() -> {
|
||||
synchronized (mDisplays) {
|
||||
if (mDisplays.get(displayId) == null) {
|
||||
return;
|
||||
}
|
||||
for (int i = mDisplayChangedListeners.size() - 1; i >= 0; --i) {
|
||||
mDisplayChangedListeners.get(i).onDisplayRemoved(displayId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user