Fix pinned stack frame computation.

We want to compute the frames for pinned like we do for freeform
as we are not constraining layout to the suggested display area by the
PhoneWindowManager. Also update applyGravityAndUpdateFrame
to not clip frames to the display for child windows. In the case
of computeFrameLw this would not be a problem as we would then
go on to overwrite mFrame anyway, but in the case of repositionChild
it could create issues (where we have applyGravityAndUpdateframe without
compute frame).

Bug: 26454664
Change-Id: I6fd4c9f37060d51003d041566368edd2b9eb7afd
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index c7b5599..f097eb2 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -19,6 +19,7 @@
 import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
 import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
 import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
+import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
 import static android.app.ActivityManager.StackId.HOME_STACK_ID;
 import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE;
 import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
@@ -685,6 +686,10 @@
                 && mStack != null && StackId.isTaskResizeableByDockedStack(mStack.mStackId);
     }
 
+    boolean isFloating() {
+        return StackId.tasksAreFloating(mStack.mStackId);
+    }
+
     /**
      * Whether the task should be treated as if it's docked. Returns true if the task
      * is currently in docked workspace, or it's side-by-side to a docked task.