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

Commit f0408e28 authored by András Kurucz's avatar András Kurucz Committed by Android (Google) Code Review
Browse files

Merge "[Flexiglass] Send all touches through the NSSLC TouchHandler" into main

parents 816b7224 dac6f5f7
Loading
Loading
Loading
Loading
+5 −17
Original line number Diff line number Diff line
@@ -3654,20 +3654,11 @@ public class NotificationStackScrollLayout
    public boolean onTouchEvent(MotionEvent ev) {
        if (mTouchHandler != null) {
            boolean touchHandled = mTouchHandler.onTouchEvent(ev);
            if (SceneContainerFlag.isEnabled()) {
                if (getChildAtPosition(
                        mInitialTouchX, mInitialTouchY, true, true, false) == null) {
                    // If scene container is enabled, any touch that we are handling that is not on
                    // a child view should be handled by scene container instead.
                    return false;
                } else {
                    // If scene container is enabled, any touch that we are handling that is not on
                    // a child view should be handled by scene container instead.
            if (SceneContainerFlag.isEnabled() || touchHandled) {
                // If scene container is enabled, let the TouchHandlers decide if this event is
                // handled by the NSSL.
                return touchHandled;
            }
            } else if (touchHandled) {
                return true;
            }
        }

        return super.onTouchEvent(ev);
@@ -3707,13 +3698,10 @@ public class NotificationStackScrollLayout
                    mScrollViewFields.sendCurrentGestureInGuts(false);
                    mScrollViewFields.sendCurrentGestureOverscroll(false);
                    setIsBeingDragged(false);
                    // dispatch to touchHandlers, so they can still finalize a previously started
                    // motion, while the shade is being dragged
                    return super.dispatchTouchEvent(ev);
                }
                return false;
            }
        }
        // dispatch all touches to TouchHandlers, so they can decide whether they want to handle it.
        return TouchLogger.logDispatchTouch(TAG, ev, super.dispatchTouchEvent(ev));
    }

+8 −4
Original line number Diff line number Diff line
@@ -2074,20 +2074,23 @@ public class NotificationStackScrollLayoutController implements Dumpable {
            mView.initDownStates(ev);
            mView.handleEmptySpaceClick(ev);

            boolean skipForDragging = SceneContainerFlag.isEnabled() && mView.isBeingDragged()
                    && ev.getAction() == MotionEvent.ACTION_MOVE;

            NotificationGuts guts = mNotificationGutsManager.getExposedGuts();

            boolean longPressWantsIt = false;
            if (mLongPressedView != null) {
            if (mLongPressedView != null && !skipForDragging) {
                longPressWantsIt = mSwipeHelper.onInterceptTouchEvent(ev);
            }
            boolean expandWantsIt = false;
            if (mLongPressedView == null && !mSwipeHelper.isSwiping()
                    && !mView.getOnlyScrollingInThisMotion() && guts == null) {
                    && !mView.getOnlyScrollingInThisMotion() && guts == null && !skipForDragging) {
                expandWantsIt = mView.getExpandHelper().onInterceptTouchEvent(ev);
            }
            boolean scrollWantsIt = false;
            if (mLongPressedView == null && !mSwipeHelper.isSwiping()
                    && !mView.isExpandingNotification()) {
                    && !mView.isExpandingNotification() && !skipForDragging) {
                scrollWantsIt = mView.onInterceptTouchEventScroll(ev);
            }
            boolean hunWantsIt = false;
@@ -2099,7 +2102,8 @@ public class NotificationStackScrollLayoutController implements Dumpable {
                    && !mView.isExpandingNotification()
                    && !mView.getExpandedInThisMotion()
                    && !mView.getOnlyScrollingInThisMotion()
                    && !mView.getDisallowDismissInThisMotion()) {
                    && !mView.getDisallowDismissInThisMotion()
                    && !skipForDragging) {
                swipeWantsIt = mSwipeHelper.onInterceptTouchEvent(ev);
            }
            // Check if we need to clear any snooze leavebehinds