Loading core/java/android/view/VelocityTracker.java +25 −12 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import android.annotation.IntDef; import android.compat.annotation.UnsupportedAppUsage; import android.hardware.input.InputManagerGlobal; import android.os.IInputConstants; import android.util.ArrayMap; import android.util.Pools.SynchronizedPool; Loading Loading @@ -53,11 +54,13 @@ public final class VelocityTracker { public @interface VelocityTrackableMotionEventAxis {} /** * Velocity Tracker Strategy: Invalid. * Use the default Velocity Tracker Strategy. Different axes may use different default * strategies. * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_DEFAULT = -1; public static final int VELOCITY_TRACKER_STRATEGY_DEFAULT = IInputConstants.VELOCITY_TRACKER_STRATEGY_DEFAULT; /** * Velocity Tracker Strategy: Impulse. Loading @@ -66,7 +69,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_IMPULSE = 0; public static final int VELOCITY_TRACKER_STRATEGY_IMPULSE = IInputConstants.VELOCITY_TRACKER_STRATEGY_IMPULSE; /** * Velocity Tracker Strategy: LSQ1. Loading @@ -77,7 +81,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_LSQ1 = 1; public static final int VELOCITY_TRACKER_STRATEGY_LSQ1 = IInputConstants.VELOCITY_TRACKER_STRATEGY_LSQ1; /** * Velocity Tracker Strategy: LSQ2. Loading @@ -88,7 +93,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_LSQ2 = 2; public static final int VELOCITY_TRACKER_STRATEGY_LSQ2 = IInputConstants.VELOCITY_TRACKER_STRATEGY_LSQ2; /** * Velocity Tracker Strategy: LSQ3. Loading @@ -98,7 +104,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_LSQ3 = 3; public static final int VELOCITY_TRACKER_STRATEGY_LSQ3 = IInputConstants.VELOCITY_TRACKER_STRATEGY_LSQ3; /** * Velocity Tracker Strategy: WLSQ2_DELTA. Loading @@ -106,7 +113,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_DELTA = 4; public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_DELTA = IInputConstants.VELOCITY_TRACKER_STRATEGY_WLSQ2_DELTA; /** * Velocity Tracker Strategy: WLSQ2_CENTRAL. Loading @@ -114,7 +122,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_CENTRAL = 5; public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_CENTRAL = IInputConstants.VELOCITY_TRACKER_STRATEGY_WLSQ2_CENTRAL; /** * Velocity Tracker Strategy: WLSQ2_RECENT. Loading @@ -122,7 +131,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_RECENT = 6; public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_RECENT = IInputConstants.VELOCITY_TRACKER_STRATEGY_WLSQ2_RECENT; /** * Velocity Tracker Strategy: INT1. Loading @@ -134,7 +144,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_INT1 = 7; public static final int VELOCITY_TRACKER_STRATEGY_INT1 = IInputConstants.VELOCITY_TRACKER_STRATEGY_INT1; /** * Velocity Tracker Strategy: INT2. Loading @@ -144,7 +155,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_INT2 = 8; public static final int VELOCITY_TRACKER_STRATEGY_INT2 = IInputConstants.VELOCITY_TRACKER_STRATEGY_INT2; /** * Velocity Tracker Strategy: Legacy. Loading @@ -155,7 +167,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_LEGACY = 9; public static final int VELOCITY_TRACKER_STRATEGY_LEGACY = IInputConstants.VELOCITY_TRACKER_STRATEGY_LEGACY; /** Loading core/jni/android_view_VelocityTracker.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ #define LOG_TAG "VelocityTracker-JNI" #include <android-base/logging.h> #include <android_runtime/AndroidRuntime.h> #include <cutils/properties.h> #include <input/Input.h> #include <input/VelocityTracker.h> #include <nativehelper/JNIHelp.h> #include <nativehelper/ScopedUtfChars.h> #include <utils/Log.h> #include "android_view_MotionEvent.h" #include "core_jni_helpers.h" Loading Loading @@ -102,7 +103,7 @@ static void android_view_VelocityTracker_nativeAddMovement(JNIEnv* env, jclass c jobject eventObj) { const MotionEvent* event = android_view_MotionEvent_getNativePtr(env, eventObj); if (!event) { ALOGW("nativeAddMovement failed because MotionEvent was finalized."); LOG(WARNING) << "nativeAddMovement failed because MotionEvent was finalized."; return; } Loading Loading
core/java/android/view/VelocityTracker.java +25 −12 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import android.annotation.IntDef; import android.compat.annotation.UnsupportedAppUsage; import android.hardware.input.InputManagerGlobal; import android.os.IInputConstants; import android.util.ArrayMap; import android.util.Pools.SynchronizedPool; Loading Loading @@ -53,11 +54,13 @@ public final class VelocityTracker { public @interface VelocityTrackableMotionEventAxis {} /** * Velocity Tracker Strategy: Invalid. * Use the default Velocity Tracker Strategy. Different axes may use different default * strategies. * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_DEFAULT = -1; public static final int VELOCITY_TRACKER_STRATEGY_DEFAULT = IInputConstants.VELOCITY_TRACKER_STRATEGY_DEFAULT; /** * Velocity Tracker Strategy: Impulse. Loading @@ -66,7 +69,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_IMPULSE = 0; public static final int VELOCITY_TRACKER_STRATEGY_IMPULSE = IInputConstants.VELOCITY_TRACKER_STRATEGY_IMPULSE; /** * Velocity Tracker Strategy: LSQ1. Loading @@ -77,7 +81,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_LSQ1 = 1; public static final int VELOCITY_TRACKER_STRATEGY_LSQ1 = IInputConstants.VELOCITY_TRACKER_STRATEGY_LSQ1; /** * Velocity Tracker Strategy: LSQ2. Loading @@ -88,7 +93,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_LSQ2 = 2; public static final int VELOCITY_TRACKER_STRATEGY_LSQ2 = IInputConstants.VELOCITY_TRACKER_STRATEGY_LSQ2; /** * Velocity Tracker Strategy: LSQ3. Loading @@ -98,7 +104,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_LSQ3 = 3; public static final int VELOCITY_TRACKER_STRATEGY_LSQ3 = IInputConstants.VELOCITY_TRACKER_STRATEGY_LSQ3; /** * Velocity Tracker Strategy: WLSQ2_DELTA. Loading @@ -106,7 +113,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_DELTA = 4; public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_DELTA = IInputConstants.VELOCITY_TRACKER_STRATEGY_WLSQ2_DELTA; /** * Velocity Tracker Strategy: WLSQ2_CENTRAL. Loading @@ -114,7 +122,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_CENTRAL = 5; public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_CENTRAL = IInputConstants.VELOCITY_TRACKER_STRATEGY_WLSQ2_CENTRAL; /** * Velocity Tracker Strategy: WLSQ2_RECENT. Loading @@ -122,7 +131,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_RECENT = 6; public static final int VELOCITY_TRACKER_STRATEGY_WLSQ2_RECENT = IInputConstants.VELOCITY_TRACKER_STRATEGY_WLSQ2_RECENT; /** * Velocity Tracker Strategy: INT1. Loading @@ -134,7 +144,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_INT1 = 7; public static final int VELOCITY_TRACKER_STRATEGY_INT1 = IInputConstants.VELOCITY_TRACKER_STRATEGY_INT1; /** * Velocity Tracker Strategy: INT2. Loading @@ -144,7 +155,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_INT2 = 8; public static final int VELOCITY_TRACKER_STRATEGY_INT2 = IInputConstants.VELOCITY_TRACKER_STRATEGY_INT2; /** * Velocity Tracker Strategy: Legacy. Loading @@ -155,7 +167,8 @@ public final class VelocityTracker { * * @hide */ public static final int VELOCITY_TRACKER_STRATEGY_LEGACY = 9; public static final int VELOCITY_TRACKER_STRATEGY_LEGACY = IInputConstants.VELOCITY_TRACKER_STRATEGY_LEGACY; /** Loading
core/jni/android_view_VelocityTracker.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ #define LOG_TAG "VelocityTracker-JNI" #include <android-base/logging.h> #include <android_runtime/AndroidRuntime.h> #include <cutils/properties.h> #include <input/Input.h> #include <input/VelocityTracker.h> #include <nativehelper/JNIHelp.h> #include <nativehelper/ScopedUtfChars.h> #include <utils/Log.h> #include "android_view_MotionEvent.h" #include "core_jni_helpers.h" Loading Loading @@ -102,7 +103,7 @@ static void android_view_VelocityTracker_nativeAddMovement(JNIEnv* env, jclass c jobject eventObj) { const MotionEvent* event = android_view_MotionEvent_getNativePtr(env, eventObj); if (!event) { ALOGW("nativeAddMovement failed because MotionEvent was finalized."); LOG(WARNING) << "nativeAddMovement failed because MotionEvent was finalized."; return; } Loading