From 949fa9b79d13039134b1922e9b2fac5dcc5d070e Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Thu, 11 Mar 2021 20:42:49 -0800 Subject: Add NO_FOCUS_CHANGE flag to MotionEvent The FLAG_NO_FOCUS_CHANGE will be used with pointer gestures to allow the user to direct gestures to an unfocused window without bringing the window into focus. Bug: 173733166 Test: None Change-Id: I1ae7614634f1bdc73bc3093499441331bebb6d3d --- core/java/android/view/MotionEvent.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java index 6801c27851a9..fb3b41b4360b 100644 --- a/core/java/android/view/MotionEvent.java +++ b/core/java/android/view/MotionEvent.java @@ -484,6 +484,15 @@ public final class MotionEvent extends InputEvent implements Parcelable { */ public static final int FLAG_CANCELED = 0x20; + /** + * This flag indicates that the event will not cause a focus change if it is directed to an + * unfocused window, even if it an {@link #ACTION_DOWN}. This is typically used with pointer + * gestures to allow the user to direct gestures to an unfocused window without bringing the + * window into focus. + * @hide + */ + public static final int FLAG_NO_FOCUS_CHANGE = 0x40; + /** * Private flag that indicates when the system has detected that this motion event * may be inconsistent with respect to the sequence of previously delivered motion events, -- cgit v1.2.3-59-g8ed1b