From 4f49c9ce628990e7b374dbc554964f744a875b66 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Wed, 10 Nov 2021 16:20:52 +0000 Subject: [PATCH] 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 --- src/com/android/launcher3/util/DisplayController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java index 2068c296dd..c050c6ca87 100644 --- a/src/com/android/launcher3/util/DisplayController.java +++ b/src/com/android/launcher3/util/DisplayController.java @@ -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;