diff options
| author | Evan Rosky <erosky@google.com> | 2021-05-03 20:14:04 -0700 |
|---|---|---|
| committer | Evan Rosky <erosky@google.com> | 2021-05-06 12:18:42 -0700 |
| commit | 1476d63b2b8d23061fcde97289f223399e8bef73 (patch) | |
| tree | ab2a45baea59ab0f51b59f077da9b07e14c7521b /core/java/android/view/MotionEvent.java | |
| parent | 327db7857dfed11faa52c2d3df1a7aeb8f02715d (diff) | |
Compat-rotate motion-events injected into dispatcher
With the flag, dispatcher operates in physical space, so
if injecting into dispatcher, the events need to be 'un'rotated.
Bug: 179274888
Test: atest Launcher3Tests:com.android.launcher3.ui.TaplTestsLauncher3
Change-Id: I9abdfd0540354ab6e3eac34ae15b784c0fcf6e2e
Diffstat (limited to 'core/java/android/view/MotionEvent.java')
| -rw-r--r-- | core/java/android/view/MotionEvent.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java index 31ca8e124f9e..c23678a0b068 100644 --- a/core/java/android/view/MotionEvent.java +++ b/core/java/android/view/MotionEvent.java @@ -1569,6 +1569,8 @@ public final class MotionEvent extends InputEvent implements Parcelable { int axis, int pointerIndex, int historyPos); @FastNative private static native void nativeTransform(long nativePtr, Matrix matrix); + @FastNative + private static native void nativeApplyTransform(long nativePtr, Matrix matrix); // -------------- @CriticalNative ---------------------- @@ -3266,6 +3268,21 @@ public final class MotionEvent extends InputEvent implements Parcelable { } /** + * Transforms all of the points in the event directly instead of modifying the event's + * internal transform. + * + * @param matrix The transformation matrix to apply. + * @hide + */ + public void applyTransform(Matrix matrix) { + if (matrix == null) { + throw new IllegalArgumentException("matrix must not be null"); + } + + nativeApplyTransform(mNativePtr, matrix); + } + + /** * Add a new movement to the batch of movements in this event. The event's * current location, position and size is updated to the new values. * The current values in the event are added to a list of historical values. |
