Ignoring display size change when display is off

Bug: 198965093
Test: Verified with the script provided on the bug
Change-Id: I0efaa5a9b7be94f406a9c283219c715a6c430256
This commit is contained in:
Sunny Goyal committed 2021-09-30 11:43:26 -07:00
1 parent 9c871ae7b6
commit 807de418e9
2 files changed
+9 -11

No files matched your search

@@ -257,6 +257,14 @@ public class DisplayController implements DisplayListener, ComponentCallbacks, S
}
if (!newInfo.supportedBounds.equals(oldInfo.supportedBounds)) {
change |= CHANGE_SUPPORTED_BOUNDS;
PortraitSize realSize = new PortraitSize(newInfo.currentSize.x, newInfo.currentSize.y);
PortraitSize expectedSize = oldInfo.mInternalDisplays.get(
ApiWrapper.getUniqueId(display));
if (!realSize.equals(expectedSize) && display.getState() == Display.STATE_OFF) {
Log.e("b/198965093", "Display size changed while display is off, ignoring change");
return;
}
}
if (change != 0) {