diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2022-04-25 11:42:16 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-04-25 11:42:16 +0000 |
| commit | b49c8b3a3a9b6cf0423b9e6ca809cb92cdeb348f (patch) | |
| tree | 9b8891750bc23e2d56d7651d6b3a4914f8252106 /core/java/android/view/View.java | |
| parent | 9e4a0c1ac320340ce13772a43038f66266b60eb2 (diff) | |
| parent | e8258fdf7baed41ac6bf7c6386379eefb270d1ee (diff) | |
Merge "Advise use of InputDeviceListener when using pointer capture" into tm-dev
Diffstat (limited to 'core/java/android/view/View.java')
| -rw-r--r-- | core/java/android/view/View.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index dc3620bcc5e5..f8c7cd049365 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -28733,7 +28733,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link InputDevice#SOURCE_MOUSE_RELATIVE}, and relative position changes will be * available through {@link MotionEvent#getX} and {@link MotionEvent#getY}.</li> * - * <li>Events from a touchpad will be delivered with the source + * <li>Events from a touchpad or trackpad will be delivered with the source * {@link InputDevice#SOURCE_TOUCHPAD}, where the absolute position of each of the pointers * on the touchpad will be available through {@link MotionEvent#getX(int)} and * {@link MotionEvent#getY(int)}, and their relative movements are stored in @@ -28742,6 +28742,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * <li>Events from other types of devices, such as touchscreens, will not be affected.</li> * </ul> * <p> + * When pointer capture changes, connected mouse and trackpad devices may be reconfigured, + * and their properties (such as their sources or motion ranges) may change. Use an + * {@link android.hardware.input.InputManager.InputDeviceListener} to be notified when a device + * changes (which may happen after enabling or disabling pointer capture), and use + * {@link InputDevice#getDevice(int)} to get the updated {@link InputDevice}. + * <p> * Events captured through pointer capture will be dispatched to * {@link OnCapturedPointerListener#onCapturedPointer(View, MotionEvent)} if an * {@link OnCapturedPointerListener} is set, and otherwise to |
