From 91fa08ff1bd85ae41d71e1ed5ee72357c975ee3b Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Fri, 8 Jun 2018 22:49:30 +0100 Subject: Move displayId into InputEvent Now both KeyEvent and MotionEvent will contain displayId. This will help with dispatching input events to specific displays. There are use cases where a particular input device is used for a specific display only, and it sends key events to the system. This will help with those usages. Test: atest view.MotionEventTest view.KeyEventTest Bug: 64258305 Change-Id: I75891037617ed60820d60736216a0d615ab5e3b0 --- core/java/android/view/MotionEvent.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/java/android/view/MotionEvent.java') diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java index 9148c27f6006..344806aa4d50 100644 --- a/core/java/android/view/MotionEvent.java +++ b/core/java/android/view/MotionEvent.java @@ -1943,11 +1943,13 @@ public final class MotionEvent extends InputEvent implements Parcelable { } /** @hide */ + @Override public int getDisplayId() { return nativeGetDisplayId(mNativePtr); } /** @hide */ + @Override public void setDisplayId(int displayId) { nativeSetDisplayId(mNativePtr, displayId); } -- cgit v1.2.3