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

Commit 8c4a8243 authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge "Finish InputEvents."

parents 81056427 d982e6d9
Loading
Loading
Loading
Loading
+43 −39
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@


package com.android.server.wm;
package com.android.server.wm;


import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Region;
import android.os.Looper;
import android.os.Looper;
import android.view.DisplayInfo;
import android.view.DisplayInfo;
@@ -52,6 +51,7 @@ public class StackTapDetector extends InputEventReceiver {


    @Override
    @Override
    public void onInputEvent(InputEvent event) {
    public void onInputEvent(InputEvent event) {
        try {
            if (!(event instanceof MotionEvent)
            if (!(event instanceof MotionEvent)
                    || !event.isFromSource(InputDevice.SOURCE_CLASS_POINTER)) {
                    || !event.isFromSource(InputDevice.SOURCE_CLASS_POINTER)) {
                return;
                return;
@@ -67,7 +67,8 @@ public class StackTapDetector extends InputEventReceiver {
                case MotionEvent.ACTION_MOVE:
                case MotionEvent.ACTION_MOVE:
                    if (mPointerId >= 0) {
                    if (mPointerId >= 0) {
                        int index = motionEvent.findPointerIndex(mPointerId);
                        int index = motionEvent.findPointerIndex(mPointerId);
                    if ((motionEvent.getEventTime() - motionEvent.getDownTime()) > TAP_TIMEOUT_MSEC
                        if ((motionEvent.getEventTime() - motionEvent.getDownTime())
                                > TAP_TIMEOUT_MSEC
                                || (motionEvent.getX(index) - mDownX) > mMotionSlop
                                || (motionEvent.getX(index) - mDownX) > mMotionSlop
                                || (motionEvent.getY(index) - mDownY) > mMotionSlop) {
                                || (motionEvent.getY(index) - mDownY) > mMotionSlop) {
                            mPointerId = -1;
                            mPointerId = -1;
@@ -87,8 +88,8 @@ public class StackTapDetector extends InputEventReceiver {
                                    < TAP_TIMEOUT_MSEC
                                    < TAP_TIMEOUT_MSEC
                                    && (x - mDownX) < mMotionSlop && (y - mDownY) < mMotionSlop
                                    && (x - mDownX) < mMotionSlop && (y - mDownY) < mMotionSlop
                                    && !mTouchExcludeRegion.contains(x, y)) {
                                    && !mTouchExcludeRegion.contains(x, y)) {
                            mService.mH.obtainMessage(H.TAP_OUTSIDE_STACK, x, y, mDisplayContent)
                                mService.mH.obtainMessage(H.TAP_OUTSIDE_STACK, x, y,
                                    .sendToTarget();
                                        mDisplayContent).sendToTarget();
                            }
                            }
                        }
                        }
                        mPointerId = -1;
                        mPointerId = -1;
@@ -96,5 +97,8 @@ public class StackTapDetector extends InputEventReceiver {
                    break;
                    break;
                }
                }
            }
            }
        } finally {
            finishInputEvent(event, false /*ignored for monitors*/);
        }
    }
    }
}
}