Use device insets for multiwindow, else use thumbnail insets

This is consistent with what we do for the right/bottom clipped
insets already, and fixes cases where the device insets don't
match the thumbnail insets (e.g. for fullscreen apps).

Bug: 157097544
Change-Id: I630bb115cab571f3439bfbe8ded5affd924f7e64
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java
index e3c1b42..78ac1cc 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java
@@ -444,7 +444,6 @@
             int thumbnailRotation = thumbnailData.rotation;
             int deltaRotate = getRotationDelta(currentRotation, thumbnailRotation);
 
-            Rect deviceInsets = dp.getInsets();
             // Landscape vs portrait change
             boolean windowingModeSupportsRotation = !dp.isMultiWindowMode
                     && thumbnailData.windowingMode == WINDOWING_MODE_FULLSCREEN;
@@ -463,9 +462,16 @@
                         : canvasWidth / thumbnailWidth;
             }
 
+            Rect splitScreenInsets = dp.getInsets();
             if (!isRotated) {
                 // No Rotation
-                mClippedInsets.offsetTo(deviceInsets.left * scale, deviceInsets.top * scale);
+                if (dp.isMultiWindowMode) {
+                    mClippedInsets.offsetTo(splitScreenInsets.left * scale,
+                            splitScreenInsets.top * scale);
+                } else {
+                    mClippedInsets.offsetTo(thumbnailInsets.left * scale,
+                            thumbnailInsets.top * scale);
+                }
                 mMatrix.setTranslate(
                         -thumbnailInsets.left * scale,
                         -thumbnailInsets.top * scale);
@@ -486,8 +492,8 @@
             mClippedInsets.top *= thumbnailScale;
 
             if (dp.isMultiWindowMode) {
-                mClippedInsets.right = deviceInsets.right * scale * thumbnailScale;
-                mClippedInsets.bottom = deviceInsets.bottom * scale * thumbnailScale;
+                mClippedInsets.right = splitScreenInsets.right * scale * thumbnailScale;
+                mClippedInsets.bottom = splitScreenInsets.bottom * scale * thumbnailScale;
             } else {
                 mClippedInsets.right = Math.max(0,
                         widthWithInsets - mClippedInsets.left - canvasWidth);