Log the display state when number of screen bounds is inconsistent

- If the number of screen bounds a.k.a. number of displays has changed, it should be a bug from system and add a log for that

Bug: 198965093
Test: manual
Change-Id: I74612e6c0d2f3cfd52b509e43ea16adf0eec76de
This commit is contained in:
Alex Chau
2021-11-10 16:20:52 +00:00
parent 3c2298668a
commit 4f49c9ce62
@@ -261,6 +261,13 @@ public class DisplayController implements DisplayListener, ComponentCallbacks, S
PortraitSize realSize = new PortraitSize(newInfo.currentSize.x, newInfo.currentSize.y);
PortraitSize expectedSize = oldInfo.mInternalDisplays.get(
ApiWrapper.getUniqueId(display));
if (newInfo.supportedBounds.size() != oldInfo.supportedBounds.size()) {
Log.e("b/198965093",
"Inconsistent number of displays"
+ "\ndisplay state: " + display.getState()
+ "\noldInfo.supportedBounds: " + oldInfo.supportedBounds
+ "\nnewInfo.supportedBounds: " + newInfo.supportedBounds);
}
if (!realSize.equals(expectedSize) && display.getState() == Display.STATE_OFF) {
Log.e("b/198965093", "Display size changed while display is off, ignoring change");
return;