Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe0d69d0 authored by Harry Cutts's avatar Harry Cutts Committed by Android (Google) Code Review
Browse files

Merge "Make MotionEvent#obtain with classification public"

parents 083cb898 2a17fe6d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -49563,6 +49563,7 @@ package android.view {
    method public float getY(int);
    method public float getYPrecision();
    method public boolean isButtonPressed(int);
    method @Nullable public static android.view.MotionEvent obtain(long, long, int, int, @NonNull android.view.MotionEvent.PointerProperties[], @NonNull android.view.MotionEvent.PointerCoords[], int, int, float, float, int, int, int, int, int, int);
    method public static android.view.MotionEvent obtain(long, long, int, int, android.view.MotionEvent.PointerProperties[], android.view.MotionEvent.PointerCoords[], int, int, float, float, int, int, int, int);
    method @Deprecated public static android.view.MotionEvent obtain(long, long, int, int, int[], android.view.MotionEvent.PointerCoords[], int, float, float, int, int, int, int);
    method public static android.view.MotionEvent obtain(long, long, int, float, float, float, float, int, float, float, int, int);
+10 −9
Original line number Diff line number Diff line
@@ -22,7 +22,9 @@ import static android.view.Display.DEFAULT_DISPLAY;
import static java.lang.annotation.RetentionPolicy.SOURCE;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.graphics.Matrix;
@@ -1780,19 +1782,18 @@ public final class MotionEvent extends InputEvent implements Parcelable {
     * @param displayId The display ID associated with this event.
     * @param flags The motion event flags.
     * @param classification The classification to give this event.
     * @hide
     */
    public static MotionEvent obtain(long downTime, long eventTime,
            int action, int pointerCount, PointerProperties[] pointerProperties,
            PointerCoords[] pointerCoords, int metaState, int buttonState,
            float xPrecision, float yPrecision, int deviceId,
            int edgeFlags, int source, int displayId, int flags,
            @Classification int classification) {
    public static @Nullable MotionEvent obtain(long downTime, long eventTime, int action,
            int pointerCount,
            @SuppressLint("ArrayReturn") @NonNull PointerProperties[] pointerProperties,
            @SuppressLint("ArrayReturn") @NonNull PointerCoords[] pointerCoords, int metaState,
            int buttonState, float xPrecision, float yPrecision, int deviceId, int edgeFlags,
            int source, int displayId, int flags, @Classification int classification) {
        MotionEvent ev = obtain();
        final boolean success = ev.initialize(deviceId, source, displayId, action, flags, edgeFlags,
                metaState, buttonState, classification, 0, 0, xPrecision, yPrecision,
                downTime * NS_PER_MS, eventTime * NS_PER_MS,
                pointerCount, pointerProperties, pointerCoords);
                downTime * NS_PER_MS, eventTime * NS_PER_MS, pointerCount, pointerProperties,
                pointerCoords);
        if (!success) {
            Log.e(TAG, "Could not initialize MotionEvent");
            ev.recycle();