Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f49c9ce authored by Alex Chau's avatar Alex Chau
Browse files

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
parent 3c229866
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;