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

Commit de8c4dd4 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou Committed by Android (Google) Code Review
Browse files

Merge "Add MotionPredictor API"

parents acc498a5 86413b57
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -50655,6 +50655,13 @@ package android.view {
    field public int toolType;
  }
  public final class MotionPredictor {
    ctor public MotionPredictor(@NonNull android.content.Context);
    method public boolean isPredictionAvailable(int, int);
    method @NonNull public java.util.List<android.view.MotionEvent> predict(long);
    method public void record(@NonNull android.view.MotionEvent);
  }
  public interface OnReceiveContentListener {
    method @Nullable public android.view.ContentInfo onReceiveContent(@NonNull android.view.View, @NonNull android.view.ContentInfo);
  }
+8 −3
Original line number Diff line number Diff line
@@ -25,10 +25,15 @@ import java.util.Arrays;
import java.util.List;

/**
 * Calculates motion predictions.
 * Calculate motion predictions.
 *
 * Add motions here to get predicted events!
 * @hide
 * Feed motion events to this class in order to generate the predicted events. The prediction
 * functionality may not be available on all devices. Check if a specific source is supported on a
 * given input device using #isPredictionAvailable.
 *
 * Send all of the events that were received from the system here in order to generate complete,
 * accurate predictions. When processing the returned predictions, make sure to consider all of the
 * {@link MotionEvent#getHistoricalAxisValue historical samples}.
 */
// Acts as a pass-through to the native MotionPredictor object.
// Do not store any state in this Java layer, or add any business logic here. All of the
+1 −2
Original line number Diff line number Diff line
@@ -26,6 +26,5 @@ package {
android_app {
    name: "MotionPrediction",
    srcs: ["**/*.kt"],
    platform_apis: true,
    certificate: "platform",
    sdk_version: "current",
}