Fix freeform window can't resize

The WindowState touch region would be cropped by task bounds, but in
free form window mode, we could has some extra space outside the window
content in order to resize window, we should include the resize border
in the touch region.

- Touch region should include the resize border and prevent it to be
  cropped by task bounds if window is freeform.
- Apply show or hide transaction for InputSurface immediately.

Bug: 152248369
Test: Enable freeform and resize.
Change-Id: I738da8f8c5cc08483c71edfc29eb7110c6111154
diff --git a/services/core/java/com/android/server/wm/TaskPositioner.java b/services/core/java/com/android/server/wm/TaskPositioner.java
index be0d6f8..c68b660 100644
--- a/services/core/java/com/android/server/wm/TaskPositioner.java
+++ b/services/core/java/com/android/server/wm/TaskPositioner.java
@@ -53,7 +53,6 @@
 import android.view.InputEvent;
 import android.view.InputWindowHandle;
 import android.view.MotionEvent;
-import android.view.SurfaceControl;
 import android.view.WindowManager;
 
 import com.android.internal.annotations.VisibleForTesting;
@@ -268,9 +267,7 @@
         mDisplayContent.getDisplayRotation().pause();
 
         // Notify InputMonitor to take mDragWindowHandle.
-        final SurfaceControl.Transaction t = mService.mTransactionFactory.get();
-        mDisplayContent.getInputMonitor().updateInputWindowsImmediately(t);
-        t.syncInputWindows().apply();
+        mService.mTaskPositioningController.showInputSurface(win.getDisplayId());
 
         final DisplayMetrics displayMetrics = displayContent.getDisplayMetrics();
         mMinVisibleWidth = dipToPixel(MINIMUM_VISIBLE_WIDTH_IN_DP, displayMetrics);
@@ -301,6 +298,7 @@
             return;
         }
 
+        mService.mTaskPositioningController.hideInputSurface(mDisplayContent.getDisplayId());
         mService.mInputManager.unregisterInputChannel(mServerChannel);
 
         mInputEventReceiver.dispose();