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

Commit dc941984 authored by Ethan Chen's avatar Ethan Chen Committed by Gerrit Code Review
Browse files

Support GESTURE_SENSOR input device type with GestureService

* The GESTURE_SENSOR input device type is meant to support touch sensors
  which are meant for gesture input only, very similar to a touchpad,
  but without the pointer capability.
* Define separate service to handle gestures from GESTURE_SENSOR device
  type.

Change-Id: I9b273df2a3cc141774d7f7cd81e43a90ea5b230b
parent eaae8f77
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ LOCAL_SRC_FILES += \
	core/java/android/service/notification/INotificationListener.aidl \
	core/java/android/service/dreams/IDreamManager.aidl \
	core/java/android/service/dreams/IDreamService.aidl \
	core/java/android/service/gesture/IGestureService.aidl \
	core/java/android/service/pie/IPieService.aidl \
	core/java/android/service/pie/IPieActivationListener.aidl \
	core/java/android/service/pie/IPieHostCallback.aidl \
+3 −1
Original line number Diff line number Diff line
@@ -78,13 +78,15 @@ public class Input {
                    return;
                }
            } else if (command.equals("touchscreen") || command.equals("touchpad")
                    || command.equals("touchnavigation")) {
                    || command.equals("touchnavigation") || command.equals("gesture")) {
                // determine input source
                int inputSource = InputDevice.SOURCE_TOUCHSCREEN;
                if (command.equals("touchpad")) {
                    inputSource = InputDevice.SOURCE_TOUCHPAD;
                } else if (command.equals("touchnavigation")) {
                    inputSource = InputDevice.SOURCE_TOUCH_NAVIGATION;
                } else if (command.equals("gesture")) {
                    inputSource = InputDevice.SOURCE_GESTURE_SENSOR;
                }
                // determine subcommand
                if (args.length > 1) {
+10 −0
Original line number Diff line number Diff line
package android.service.gesture;

/** @hide */
interface IGestureService {

    /**
     * Register a listener for gesture sensor input. Gesture sensor input
     * is then converted into input events for system consumption.
     */
}
+11 −0
Original line number Diff line number Diff line
@@ -219,6 +219,16 @@ public final class InputDevice implements Parcelable {
     */
    public static final int SOURCE_TOUCH_NAVIGATION = 0x00200000 | SOURCE_CLASS_NONE;

    /**
     * The input source is a touch device whose motions should be interpreted as gestures.
     *
     * For example, an upward swipe should be treated the same as a swipe of the touchscreen.
     * The same should apply for left, right, down swipes. Complex gestures may also be input.
     *
     * @see #SOURCE_CLASS_NONE
     */
    public static final int SOURCE_GESTURE_SENSOR = 0x00400000 | SOURCE_CLASS_NONE;

    /**
     * The input source is a joystick.
     * (It may also be a {@link #SOURCE_GAMEPAD}).
@@ -787,6 +797,7 @@ public final class InputDevice implements Parcelable {
        appendSourceDescriptionIfApplicable(description, SOURCE_TOUCHPAD, "touchpad");
        appendSourceDescriptionIfApplicable(description, SOURCE_JOYSTICK, "joystick");
        appendSourceDescriptionIfApplicable(description, SOURCE_GAMEPAD, "gamepad");
        appendSourceDescriptionIfApplicable(description, SOURCE_GESTURE_SENSOR, "gesture");
        description.append(" )\n");

        final int numAxes = mMotionRanges.size();
+3 −0
Original line number Diff line number Diff line
@@ -1293,6 +1293,9 @@
    <!-- True if the Irda service should be started at system start -->
    <bool name="config_enableIrdaManagerService">false</bool>

    <!-- True if the gesture service should be started at system start -->
    <bool name="config_enableGestureService">false</bool>

    <!-- The list of components which should be automatically disabled. -->
    <string-array name="config_disabledComponents" translatable="false">
    </string-array>
Loading