Merge "Use displayId to determine CHANGE_ACTIVE_SCREEN" into sc-v2-dev am: 5d2309285c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16005915

Change-Id: I8d760ec6d739d7374b3c4255a515760a4feec867
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 931ecb8..2068c29 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -243,7 +243,7 @@
         }
 
         int change = 0;
-        if (!newInfo.mScreenSizeDp.equals(oldInfo.mScreenSizeDp)) {
+        if (!newInfo.displayId.equals(oldInfo.displayId)) {
             change |= CHANGE_ACTIVE_SCREEN;
         }
         if (newInfo.rotation != oldInfo.rotation) {
@@ -296,6 +296,7 @@
 
         public final Point currentSize;
 
+        public String displayId;
         public final Set<WindowBounds> supportedBounds = new ArraySet<>();
         private final Map<String, Set<WindowBounds>> mPerDisplayBounds = new ArrayMap<>();
         private final ArrayMap<String, PortraitSize> mInternalDisplays;
@@ -319,17 +320,17 @@
             currentSize = new Point();
             display.getRealSize(currentSize);
 
-            String myDisplayId = ApiWrapper.getUniqueId(display);
+            displayId = ApiWrapper.getUniqueId(display);
             Set<WindowBounds> currentSupportedBounds =
                     getSupportedBoundsForDisplay(display, currentSize);
-            mPerDisplayBounds.put(myDisplayId, currentSupportedBounds);
+            mPerDisplayBounds.put(displayId, currentSupportedBounds);
             supportedBounds.addAll(currentSupportedBounds);
 
             if (ApiWrapper.isInternalDisplay(display) && internalDisplays.size() > 1) {
                 int displayCount = internalDisplays.size();
                 for (int i = 0; i < displayCount; i++) {
                     String displayKey = internalDisplays.keyAt(i);
-                    if (TextUtils.equals(myDisplayId, displayKey)) {
+                    if (TextUtils.equals(displayId, displayKey)) {
                         continue;
                     }