Loading services/accessibility/Android.bp +16 −0 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,22 @@ java_library_static { ], ], } } java_library_static { name: "AccessibilityGestureUtils", srcs: [ "java/**/gestures/GestureMatcher.java", "java/**/gestures/GestureManifold.java", "java/**/gestures/MultiFingerMultiTap.java", "java/**/gestures/TouchState.java", ], static_libs: [ "services.accessibility", ], libs: [ "androidx.annotation_annotation", ], } aconfig_declarations { aconfig_declarations { name: "com_android_server_accessibility_flags", name: "com_android_server_accessibility_flags", package: "com.android.server.accessibility", package: "com.android.server.accessibility", Loading services/accessibility/java/com/android/server/accessibility/gestures/GestureManifold.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,7 @@ import java.util.List; * detector. Gesture matchers are tied to a single gesture. It calls listener callback functions * detector. Gesture matchers are tied to a single gesture. It calls listener callback functions * when a gesture starts or completes. * when a gesture starts or completes. */ */ class GestureManifold implements GestureMatcher.StateChangeListener { public class GestureManifold implements GestureMatcher.StateChangeListener { private static final String LOG_TAG = "GestureManifold"; private static final String LOG_TAG = "GestureManifold"; Loading Loading @@ -111,7 +111,7 @@ class GestureManifold implements GestureMatcher.StateChangeListener { // Shared state information. // Shared state information. private TouchState mState; private TouchState mState; GestureManifold(Context context, Listener listener, TouchState state, Handler handler) { public GestureManifold(Context context, Listener listener, TouchState state, Handler handler) { mContext = context; mContext = context; mHandler = handler; mHandler = handler; mListener = listener; mListener = listener; Loading Loading @@ -222,7 +222,7 @@ class GestureManifold implements GestureMatcher.StateChangeListener { * @return True if the event has been appropriately handled by the gesture manifold and related * @return True if the event has been appropriately handled by the gesture manifold and related * callback functions, false if it should be handled further by the calling function. * callback functions, false if it should be handled further by the calling function. */ */ boolean onMotionEvent(MotionEvent event, MotionEvent rawEvent, int policyFlags) { public boolean onMotionEvent(MotionEvent event, MotionEvent rawEvent, int policyFlags) { if (mState.isClear()) { if (mState.isClear()) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { // Validity safeguard: if touch state is clear, then matchers should always be clear // Validity safeguard: if touch state is clear, then matchers should always be clear Loading Loading
services/accessibility/Android.bp +16 −0 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,22 @@ java_library_static { ], ], } } java_library_static { name: "AccessibilityGestureUtils", srcs: [ "java/**/gestures/GestureMatcher.java", "java/**/gestures/GestureManifold.java", "java/**/gestures/MultiFingerMultiTap.java", "java/**/gestures/TouchState.java", ], static_libs: [ "services.accessibility", ], libs: [ "androidx.annotation_annotation", ], } aconfig_declarations { aconfig_declarations { name: "com_android_server_accessibility_flags", name: "com_android_server_accessibility_flags", package: "com.android.server.accessibility", package: "com.android.server.accessibility", Loading
services/accessibility/java/com/android/server/accessibility/gestures/GestureManifold.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,7 @@ import java.util.List; * detector. Gesture matchers are tied to a single gesture. It calls listener callback functions * detector. Gesture matchers are tied to a single gesture. It calls listener callback functions * when a gesture starts or completes. * when a gesture starts or completes. */ */ class GestureManifold implements GestureMatcher.StateChangeListener { public class GestureManifold implements GestureMatcher.StateChangeListener { private static final String LOG_TAG = "GestureManifold"; private static final String LOG_TAG = "GestureManifold"; Loading Loading @@ -111,7 +111,7 @@ class GestureManifold implements GestureMatcher.StateChangeListener { // Shared state information. // Shared state information. private TouchState mState; private TouchState mState; GestureManifold(Context context, Listener listener, TouchState state, Handler handler) { public GestureManifold(Context context, Listener listener, TouchState state, Handler handler) { mContext = context; mContext = context; mHandler = handler; mHandler = handler; mListener = listener; mListener = listener; Loading Loading @@ -222,7 +222,7 @@ class GestureManifold implements GestureMatcher.StateChangeListener { * @return True if the event has been appropriately handled by the gesture manifold and related * @return True if the event has been appropriately handled by the gesture manifold and related * callback functions, false if it should be handled further by the calling function. * callback functions, false if it should be handled further by the calling function. */ */ boolean onMotionEvent(MotionEvent event, MotionEvent rawEvent, int policyFlags) { public boolean onMotionEvent(MotionEvent event, MotionEvent rawEvent, int policyFlags) { if (mState.isClear()) { if (mState.isClear()) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { // Validity safeguard: if touch state is clear, then matchers should always be clear // Validity safeguard: if touch state is clear, then matchers should always be clear Loading