I am implementing a 2 finger swipe gesture in my AOSP project. I want to block the touch of the application window when 2 fingers are detected. I added a overlay window using a window manager and added touch listener and consumed the event. But the child views are still getting the touch events. I am using InputEventRecevier for detecting the gestures. If any one out there have any idea how to block the touch events of views in the system ui based on the pointer count please comment your answers.
val lp = WindowManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
LayoutParams.TYPE_NAVIGATION_BAR_PANEL,
LayoutParams.FLAG_NOT_FOCUSABLE | LayoutParams.FLAG_FULLSCREEN
| LayoutParams.FLAG_SPLIT_TOUCH | LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
PixelFormat.TRANSPARENT);
on ACTION_POINTER_DOWN:
windowManager.addView(gestureLayout, lp)
on ACTION_POINTER_UP:
windowManager.removeView(gestureLayout)