Several fixes for docking non-resizeable tasks

- Keep track of original task bounds and scrolled bounds separately,
  so that we can reset the scrolling when the it's no longer in effect.

- Calculate the vertical offset for the toast on top half using the
  content rect. The original toast position was relative to the bottom
  of the content rect, not the display rect.

- Move toast display to prepareSurfaceLocked, as performShowLocked() may
  not be called if the app surface is already shown.

related-to: b/26451625
related-to: b/26447921

Change-Id: I82113683c9e3c3beb4938dbd0829d0abf491efd9
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index a9025bd..0c429e5 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -222,6 +222,10 @@
         out.set(left, top, left + width, top + height);
     }
 
+    void getContentRect(Rect out) {
+        out.set(mContentRect);
+    }
+
     /** Refer to {@link WindowManagerService#attachStack(int, int, boolean)} */
     void attachStack(TaskStack stack, boolean onTop) {
         if (stack.mStackId == HOME_STACK_ID) {