Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a89053db authored by Winson Chung's avatar Winson Chung
Browse files

Don't update the PiP bounds when we aren't resizing the PiP

- When we go from a non-expanded menu (with just the close button) to a
  no-menu state, ignore the logic to readjust the PiP since it can
  introduce rounding errors.

Bug: 80500702
Test: Enter PiP on P3, then launch an app and ensure that it moves back to
      the bottom

Change-Id: Iad3f491ab08b575bdca57a127e8f7e6d35c0d443
parent 129be9f9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -514,7 +514,7 @@ public class PipTouchHandler {
     * Sets the menu visibility.
     */
    private void setMenuState(int menuState, boolean resize) {
        if (menuState == MENU_STATE_FULL) {
        if (menuState == MENU_STATE_FULL && mMenuState != MENU_STATE_FULL) {
            // Save the current snap fraction and if we do not drag or move the PiP, then
            // we store back to this snap fraction.  Otherwise, we'll reset the snap
            // fraction and snap to the closest edge
@@ -523,7 +523,7 @@ public class PipTouchHandler {
                mSavedSnapFraction = mMotionHelper.animateToExpandedState(expandedBounds,
                        mMovementBounds, mExpandedMovementBounds);
            }
        } else if (menuState == MENU_STATE_NONE) {
        } else if (menuState == MENU_STATE_NONE && mMenuState == MENU_STATE_FULL) {
            // Try and restore the PiP to the closest edge, using the saved snap fraction
            // if possible
            if (resize) {