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

Commit e1831cdf authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Exposing MotionEvent.addBatch method to be used in Launcher

Test: Verified library in Launcher
Change-Id: Idd58082d75310a15ed2196917f1a9e9e42f82d45
parent b615f565
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
     */