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

Commit 41e0c458 authored by Hongwei Wang's avatar Hongwei Wang Committed by Automerger Merge Worker
Browse files

Merge "PiP: Move tap-outside-hide block one level higher." into sc-dev am: 395c582b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15162888

Change-Id: Ifa8e390efe3446543d3a499de25f3624c7157704
parents 38291a09 395c582b
Loading
Loading
Loading
Loading
+12 −8
Original line number Original line Diff line number Diff line
@@ -246,10 +246,20 @@ public class PipResizeGestureHandler {
        }
        }


        if (ev instanceof MotionEvent) {
        if (ev instanceof MotionEvent) {
            MotionEvent mv = (MotionEvent) ev;
            int action = mv.getActionMasked();
            final Rect pipBounds = mPipBoundsState.getBounds();
            if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
                if (!pipBounds.contains((int) mv.getRawX(), (int) mv.getRawY())
                        && mPhonePipMenuController.isMenuVisible()) {
                    mPhonePipMenuController.hideMenu();
                }
            }

            if (mEnablePinchResize && mOngoingPinchToResize) {
            if (mEnablePinchResize && mOngoingPinchToResize) {
                onPinchResize((MotionEvent) ev);
                onPinchResize(mv);
            } else if (mEnableDragCornerResize) {
            } else if (mEnableDragCornerResize) {
                onDragCornerResize((MotionEvent) ev);
                onDragCornerResize(mv);
            }
            }
        }
        }
    }
    }
@@ -450,7 +460,6 @@ public class PipResizeGestureHandler {
        float x = ev.getX();
        float x = ev.getX();
        float y = ev.getY() - mOhmOffset;
        float y = ev.getY() - mOhmOffset;
        if (action == MotionEvent.ACTION_DOWN) {
        if (action == MotionEvent.ACTION_DOWN) {
            final Rect currentPipBounds = mPipBoundsState.getBounds();
            mLastResizeBounds.setEmpty();
            mLastResizeBounds.setEmpty();
            mAllowGesture = isInValidSysUiState() && isWithinDragResizeRegion((int) x, (int) y);
            mAllowGesture = isInValidSysUiState() && isWithinDragResizeRegion((int) x, (int) y);
            if (mAllowGesture) {
            if (mAllowGesture) {
@@ -458,11 +467,6 @@ public class PipResizeGestureHandler {
                mDownPoint.set(x, y);
                mDownPoint.set(x, y);
                mDownBounds.set(mPipBoundsState.getBounds());
                mDownBounds.set(mPipBoundsState.getBounds());
            }
            }
            if (!currentPipBounds.contains((int) x, (int) y)
                    && mPhonePipMenuController.isMenuVisible()) {
                mPhonePipMenuController.hideMenu();
            }

        } else if (mAllowGesture) {
        } else if (mAllowGesture) {
            switch (action) {
            switch (action) {
                case MotionEvent.ACTION_POINTER_DOWN:
                case MotionEvent.ACTION_POINTER_DOWN: