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

Commit f7925c11 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Exposing MotionEvent.addBatch method to be used in Launcher"

parents 74c8a14a e1831cdf
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.view.Choreographer;
import android.view.InputChannel;
import android.view.InputEvent;
import android.view.InputEventSender;
import android.view.MotionEvent;

/**
 * @see android.view.InputChannel
@@ -63,6 +64,19 @@ public class InputChannelCompat {
        return new InputEventReceiver(channel, looper, choreographer, listener);
    }

    /**
     * Version of addBatch method which preserves time accuracy in nanoseconds instead of
     * converting the time to milliseconds.
     * @param src old MotionEvent where the target should be appended
     * @param target new MotionEvent which should be added to the src
     * @return true if the merge was successful
     *
     * @see MotionEvent#addBatch(MotionEvent)
     */
    public static boolean mergeMotionEvent(MotionEvent src, MotionEvent target) {
        return target.addBatch(src);
    }

    /**
     * @see BatchedInputEventReceiver
     */