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

Commit 68f13899 authored by android-build-team Robot's avatar android-build-team Robot Committed by Android (Google) Code Review
Browse files

Merge "Let Launcher handle proxy touch events even if it is not focused" into ub-launcher3-edmonton

parents cbebaa19 09cc13e2
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ import static android.view.MotionEvent.ACTION_POINTER_DOWN;
import static android.view.MotionEvent.ACTION_POINTER_UP;
import static android.view.MotionEvent.ACTION_UP;

import static com.android.systemui.shared.system.ActivityManagerWrapper
        .CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.NavigationBarCompat.HIT_TARGET_NONE;

import android.annotation.TargetApi;
@@ -256,7 +258,6 @@ public class TouchInteractionService extends Service {

        private boolean mTrackingStarted = false;
        private boolean mInvalidated = false;
        private boolean mHadWindowFocusOnDown;

        private float mLastProgress = 0;
        private boolean mStartPending = false;
@@ -281,8 +282,7 @@ public class TouchInteractionService extends Service {
            if (action == ACTION_DOWN) {
                mTrackingStarted = false;
                mDownPos.set(ev.getX(), ev.getY());
                mHadWindowFocusOnDown = mTarget.hasWindowFocus();
            } else if (!mTrackingStarted && mHadWindowFocusOnDown) {
            } else if (!mTrackingStarted) {
                switch (action) {
                    case ACTION_POINTER_UP:
                    case ACTION_POINTER_DOWN:
@@ -327,12 +327,24 @@ public class TouchInteractionService extends Service {
            ev.setEdgeFlags(flags);
        }

        @Override
        public void onQuickStep(float eventX, float eventY, long eventTime) {
            if (mInvalidated) {
                return;
            }
            mActivityHelper.onQuickstepGestureStarted(mActivity, true);
            ActivityManagerWrapper.getInstance()
                    .closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
        }

        @Override
        public void updateTouchTracking(int interactionType) {
            if (mInvalidated) {
                return;
            }
            if (interactionType == INTERACTION_QUICK_SCRUB) {
                ActivityManagerWrapper.getInstance()
                        .closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
                mStartPending = true;

                Runnable action = () -> {
@@ -345,7 +357,6 @@ public class TouchInteractionService extends Service {
                        mQuickScrubController.onQuickScrubEnd();
                        mEndPending = false;
                    }

                };

                mActivityHelper.executeOnWindowAvailable(mActivity, action);