Merge "Advise use of InputDeviceListener when using pointer capture" am: 5ec8916af2

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2074599

Change-Id: I97a33543b550bfc379e1d336872a7888f34fbd89
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2022-04-25 16:22:08 +00:00
committed by Automerger Merge Worker

View File

@@ -28283,7 +28283,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* {@link InputDevice#SOURCE_MOUSE_RELATIVE}, and relative position changes will be * {@link InputDevice#SOURCE_MOUSE_RELATIVE}, and relative position changes will be
* available through {@link MotionEvent#getX} and {@link MotionEvent#getY}.</li> * 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 * {@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 * on the touchpad will be available through {@link MotionEvent#getX(int)} and
* {@link MotionEvent#getY(int)}, and their relative movements are stored in * {@link MotionEvent#getY(int)}, and their relative movements are stored in
@@ -28292,6 +28292,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* <li>Events from other types of devices, such as touchscreens, will not be affected.</li> * <li>Events from other types of devices, such as touchscreens, will not be affected.</li>
* </ul> * </ul>
* <p> * <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 * Events captured through pointer capture will be dispatched to
* {@link OnCapturedPointerListener#onCapturedPointer(View, MotionEvent)} if an * {@link OnCapturedPointerListener#onCapturedPointer(View, MotionEvent)} if an
* {@link OnCapturedPointerListener} is set, and otherwise to * {@link OnCapturedPointerListener} is set, and otherwise to