diff --git a/core/java/android/view/IPinnedStackController.aidl b/core/java/android/view/IPinnedStackController.aidl deleted file mode 100644 index 1cf83a3f1e794..0000000000000 --- a/core/java/android/view/IPinnedStackController.aidl +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2016, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.view; - -import android.graphics.Rect; - -/** - * An interface to the PinnedStackController to update it of state changes, and to query - * information based on the current state. - * - * @hide - */ -interface IPinnedStackController { - /** - * @return what WM considers to be the current device rotation. - */ - int getDisplayRotation(); -} diff --git a/core/java/android/view/IPinnedStackListener.aidl b/core/java/android/view/IPinnedStackListener.aidl index f49fee36ca7e9..84dd8af5e3426 100644 --- a/core/java/android/view/IPinnedStackListener.aidl +++ b/core/java/android/view/IPinnedStackListener.aidl @@ -21,7 +21,6 @@ import android.content.ComponentName; import android.content.pm.ParceledListSlice; import android.graphics.Rect; import android.view.DisplayInfo; -import android.view.IPinnedStackController; /** * Listener for changes to the pinned stack made by the WindowManager. @@ -30,12 +29,6 @@ import android.view.IPinnedStackController; */ oneway interface IPinnedStackListener { - /** - * Called when the listener is registered and provides an interface to call back to the pinned - * stack controller to update the controller of the pinned stack state. - */ - void onListenerRegistered(IPinnedStackController controller); - /** * Called when the window manager has detected a change that would cause the movement bounds * to be changed (ie. after configuration change, aspect ratio change, etc). diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PinnedStackListenerForwarder.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PinnedStackListenerForwarder.java index 6145b7c71c097..5593268588fde 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PinnedStackListenerForwarder.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PinnedStackListenerForwarder.java @@ -21,7 +21,6 @@ import android.content.ComponentName; import android.content.pm.ParceledListSlice; import android.os.RemoteException; import android.view.DisplayInfo; -import android.view.IPinnedStackController; import android.view.IPinnedStackListener; import android.view.WindowManagerGlobal; @@ -62,12 +61,6 @@ public class PinnedStackListenerForwarder { displayId, mListenerImpl); } - private void onListenerRegistered(IPinnedStackController controller) { - for (PinnedStackListener listener : mListeners) { - listener.onListenerRegistered(controller); - } - } - private void onMovementBoundsChanged(boolean fromImeAdjustment) { for (PinnedStackListener listener : mListeners) { listener.onMovementBoundsChanged(fromImeAdjustment); @@ -112,13 +105,6 @@ public class PinnedStackListenerForwarder { @BinderThread private class PinnedStackListenerImpl extends IPinnedStackListener.Stub { - @Override - public void onListenerRegistered(IPinnedStackController controller) { - mShellMainExecutor.execute(() -> { - PinnedStackListenerForwarder.this.onListenerRegistered(controller); - }); - } - @Override public void onMovementBoundsChanged(boolean fromImeAdjustment) { mShellMainExecutor.execute(() -> { @@ -174,8 +160,6 @@ public class PinnedStackListenerForwarder { * Subclasses can ignore those methods they do not intend to take action upon. */ public static class PinnedStackListener { - public void onListenerRegistered(IPinnedStackController controller) {} - public void onMovementBoundsChanged(boolean fromImeAdjustment) {} public void onImeVisibilityChanged(boolean imeVisible, int imeHeight) {} diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java index 119ef6d60beab..3234ef6ccf664 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java @@ -41,7 +41,6 @@ import android.util.Log; import android.util.Pair; import android.util.Slog; import android.view.DisplayInfo; -import android.view.IPinnedStackController; import android.view.WindowManagerGlobal; import android.window.WindowContainerTransaction; @@ -161,11 +160,6 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac */ private class PipControllerPinnedStackListener extends PinnedStackListenerForwarder.PinnedStackListener { - @Override - public void onListenerRegistered(IPinnedStackController controller) { - mTouchHandler.setPinnedStackController(controller); - } - @Override public void onImeVisibilityChanged(boolean imeVisible, int imeHeight) { mPipBoundsState.setImeVisibility(imeVisible, imeHeight); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java index 1ab31f846db71..b7cfad9030f7b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java @@ -31,11 +31,8 @@ import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; import android.os.Handler; -import android.os.RemoteException; import android.provider.DeviceConfig; -import android.util.Log; import android.util.Size; -import android.view.IPinnedStackController; import android.view.InputEvent; import android.view.MotionEvent; import android.view.ViewConfiguration; @@ -76,7 +73,6 @@ public class PipTouchHandler { private final PipDismissTargetHandler mPipDismissTargetHandler; private PipResizeGestureHandler mPipResizeGestureHandler; - private IPinnedStackController mPinnedStackController; private WeakReference> mPipExclusionBoundsChangeListener; private final PhonePipMenuController mMenuController; @@ -464,10 +460,6 @@ public class PipTouchHandler { if (!(inputEvent instanceof MotionEvent)) { return true; } - // Skip touch handling until we are bound to the controller - if (mPinnedStackController == null) { - return true; - } MotionEvent ev = (MotionEvent) inputEvent; if (!mPipBoundsState.isStashed() && mPipResizeGestureHandler.willStartResizeGesture(ev)) { @@ -590,13 +582,6 @@ public class PipTouchHandler { mAccessibilityManager.sendAccessibilityEvent(event); } - /** - * Sets the controller to update the system of changes from user interaction. - */ - void setPinnedStackController(IPinnedStackController controller) { - mPinnedStackController = controller; - } - /** * Sets the menu visibility. */ @@ -625,13 +610,9 @@ public class PipTouchHandler { // bounds which are now stale. In such a case we defer the animation to the // normal bounds until after the next onMovementBoundsChanged() call to get the // bounds in the new orientation - try { - int displayRotation = mPinnedStackController.getDisplayRotation(); - if (mDisplayRotation != displayRotation) { - mDeferResizeToNormalBoundsUntilRotation = displayRotation; - } - } catch (RemoteException e) { - Log.e(TAG, "Could not get display rotation from controller"); + int displayRotation = mContext.getDisplay().getRotation(); + if (mDisplayRotation != displayRotation) { + mDeferResizeToNormalBoundsUntilRotation = displayRotation; } } diff --git a/services/core/java/com/android/server/wm/PinnedStackController.java b/services/core/java/com/android/server/wm/PinnedStackController.java index 52ada472f0aaf..fd42b2467d198 100644 --- a/services/core/java/com/android/server/wm/PinnedStackController.java +++ b/services/core/java/com/android/server/wm/PinnedStackController.java @@ -29,7 +29,6 @@ import android.util.DisplayMetrics; import android.util.Log; import android.util.Slog; import android.view.DisplayInfo; -import android.view.IPinnedStackController; import android.view.IPinnedStackListener; import java.io.PrintWriter; @@ -63,8 +62,6 @@ class PinnedStackController { private final PinnedStackListenerDeathHandler mPinnedStackListenerDeathHandler = new PinnedStackListenerDeathHandler(); - private final PinnedStackControllerCallback mCallbacks = new PinnedStackControllerCallback(); - /** Whether the PiP is entering or leaving. */ private boolean mIsPipWindowingModeChanging; @@ -85,18 +82,6 @@ class PinnedStackController { // Temp vars for calculation private final DisplayMetrics mTmpMetrics = new DisplayMetrics(); - /** - * The callback object passed to listeners for them to notify the controller of state changes. - */ - private class PinnedStackControllerCallback extends IPinnedStackController.Stub { - @Override - public int getDisplayRotation() { - synchronized (mService.mGlobalLock) { - return mDisplayInfo.rotation; - } - } - } - /** * Handler for the case where the listener dies. */ @@ -141,7 +126,6 @@ class PinnedStackController { void registerPinnedStackListener(IPinnedStackListener listener) { try { listener.asBinder().linkToDeath(mPinnedStackListenerDeathHandler, 0); - listener.onListenerRegistered(mCallbacks); mPinnedStackListener = listener; notifyDisplayInfoChanged(mDisplayInfo); notifyImeVisibilityChanged(mIsImeShowing, mImeHeight);