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
2021-09-30 11:39:37 -07:00
parent 9c871ae7b6
commit 807de418e9
2 changed files with 9 additions and 11 deletions

View File

@@ -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) {