diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java index a646b07c49dc9..ae8c1b6f8c1aa 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java @@ -60,8 +60,7 @@ public class PhonePipMenuController implements PipMenuController { private static final boolean DEBUG = false; public static final int MENU_STATE_NONE = 0; - public static final int MENU_STATE_CLOSE = 1; - public static final int MENU_STATE_FULL = 2; + public static final int MENU_STATE_FULL = 1; /** * A listener interface to receive notification on changes in PIP. diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java index 67b1e6dd4cc76..8ef2b6b120304 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java @@ -23,7 +23,6 @@ import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_CONTR import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_ICONS; import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK; -import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_CLOSE; import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_FULL; import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_NONE; @@ -203,7 +202,7 @@ public class PipMenuView extends FrameLayout { @Override public boolean performAccessibilityAction(View host, int action, Bundle args) { - if (action == ACTION_CLICK && mMenuState == MENU_STATE_CLOSE) { + if (action == ACTION_CLICK && mMenuState != MENU_STATE_FULL) { mController.showMenu(); } return super.performAccessibilityAction(host, action, args); @@ -271,13 +270,12 @@ public class PipMenuView extends FrameLayout { mDismissButton.getAlpha(), 1f); ObjectAnimator resizeAnim = ObjectAnimator.ofFloat(mResizeHandle, View.ALPHA, mResizeHandle.getAlpha(), - ENABLE_RESIZE_HANDLE && menuState == MENU_STATE_CLOSE && showResizeHandle - ? 1f : 0f); + ENABLE_RESIZE_HANDLE && showResizeHandle ? 1f : 0f); if (menuState == MENU_STATE_FULL) { mMenuContainerAnimator.playTogether(menuAnim, settingsAnim, dismissAnim, resizeAnim); } else { - mMenuContainerAnimator.playTogether(dismissAnim, resizeAnim); + mMenuContainerAnimator.playTogether(resizeAnim); } mMenuContainerAnimator.setInterpolator(Interpolators.ALPHA_IN); mMenuContainerAnimator.setDuration(ANIMATION_HIDE_DURATION_MS); @@ -429,7 +427,7 @@ public class PipMenuView extends FrameLayout { FrameLayout.LayoutParams expandedLp = (FrameLayout.LayoutParams) expandContainer.getLayoutParams(); - if (mActions.isEmpty() || menuState == MENU_STATE_CLOSE || menuState == MENU_STATE_NONE) { + if (mActions.isEmpty() || menuState == MENU_STATE_NONE) { actionsContainer.setVisibility(View.INVISIBLE); // Update the expand container margin to adjust the center of the expand button to 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 7867f933de4fa..9f2f6a575acad 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 @@ -22,7 +22,6 @@ import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTI import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_LEFT; import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_NONE; import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_RIGHT; -import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_CLOSE; import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_FULL; import static com.android.wm.shell.pip.phone.PhonePipMenuController.MENU_STATE_NONE; import static com.android.wm.shell.pip.phone.PipMenuView.ANIM_TYPE_NONE; @@ -81,7 +80,6 @@ public class PipTouchHandler { private final PhonePipMenuController mMenuController; private final AccessibilityManager mAccessibilityManager; - private boolean mShowPipMenuOnAnimationEnd = false; /** * Whether PIP stash is enabled or not. When enabled, if the user flings toward the edge of the @@ -280,7 +278,6 @@ public class PipTouchHandler { public void onActivityPinned() { mPipDismissTargetHandler.createOrUpdateDismissTarget(); - mShowPipMenuOnAnimationEnd = true; mPipResizeGestureHandler.onActivityPinned(); mFloatingContentCoordinator.onContentAdded(mMotionHelper); } @@ -304,13 +301,6 @@ public class PipTouchHandler { // Set the initial bounds as the user resize bounds. mPipResizeGestureHandler.setUserResizeBounds(mPipBoundsState.getBounds()); } - - if (mShowPipMenuOnAnimationEnd) { - mMenuController.showMenu(MENU_STATE_CLOSE, mPipBoundsState.getBounds(), - true /* allowMenuTimeout */, false /* willResizeMenu */, - shouldShowResizeHandle()); - mShowPipMenuOnAnimationEnd = false; - } } public void onConfigurationChanged() {