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

Commit c5140b0a authored by Merissa Mitchell's avatar Merissa Mitchell Committed by Android (Google) Code Review
Browse files

Merge "[PIP2] Fix stashed state updates." into main

parents 09738fe1 2c238661
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -776,6 +776,10 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
                cancelPhysicsAnimation();
                settlePipBoundsAfterPhysicsAnimation(false /* animatingAfter */);
                break;
            case PipTransitionState.CHANGED_PIP_BOUNDS:
                // Check whether changed bounds imply we need to update stash state too.
                stashEndActionIfNeeded();
                break;
        }
    }

@@ -829,9 +833,6 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
        mPipBoundsState.getMotionBoundsState().onPhysicsAnimationEnded();
        mSpringingToTouch = false;
        mDismissalPending = false;

        // Check whether new bounds after fling imply we need to update stash state too.
        stashEndActionIfNeeded();
    }

    private void stashEndActionIfNeeded() {
+0 −15
Original line number Diff line number Diff line
@@ -1013,21 +1013,6 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha
            return true;
        }

        private void stashEndAction() {
            if (mPipBoundsState.getBounds().left < 0
                    && mPipBoundsState.getStashedState() != STASH_TYPE_LEFT) {
                mPipUiEventLogger.log(
                        PipUiEventLogger.PipUiEventEnum.PICTURE_IN_PICTURE_STASH_LEFT);
                mPipBoundsState.setStashed(STASH_TYPE_LEFT);
            } else if (mPipBoundsState.getBounds().left >= 0
                    && mPipBoundsState.getStashedState() != STASH_TYPE_RIGHT) {
                mPipUiEventLogger.log(
                        PipUiEventLogger.PipUiEventEnum.PICTURE_IN_PICTURE_STASH_RIGHT);
                mPipBoundsState.setStashed(STASH_TYPE_RIGHT);
            }
            mMenuController.hideMenu();
        }

        private void flingEndAction() {
            if (mShouldHideMenuAfterFling) {
                // If the menu is not visible, then we can still be showing the activity for the