summaryrefslogtreecommitdiff
path: root/libs/input/android/os/IInputConstants.aidl
blob: 4b87dab01bbffbd4b59f778e147ee3388c3fa962 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
/**
 * Copyright (c) 2020, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.os;


/** @hide */
interface IInputConstants
{
    // This should be multiplied by the value of the system property ro.hw_timeout_multiplier before
    // use. A pre-multiplied constant is available in Java in
    // android.os.InputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS.
    const int UNMULTIPLIED_DEFAULT_DISPATCHING_TIMEOUT_MILLIS = 5000; // 5 seconds

    // Indicate invalid battery capacity
    const int INVALID_BATTERY_CAPACITY = -1;

    /**
     * Every input event has an id. This constant value is used when a valid input event id is not
     * available.
     */
    const int INVALID_INPUT_EVENT_ID = 0;

    /**
     * Every input device has an id. This constant value is used when a valid input device id is not
     * available.
     * The virtual keyboard uses -1 as the input device id. Therefore, we use -2 as the value for
     * an invalid input device.
     */
    const int INVALID_INPUT_DEVICE_ID = -2;

    /**
     * The input event was injected from some AccessibilityService, which may be either an
     * Accessibility Tool OR a service using that API for purposes other than assisting users with
     * disabilities. Used in policyFlags for input event injection.
     */
    const int POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY = 0x20000;

    /**
     * The key event triggered a key gesture. Used in policy flag to notify that a key gesture was
     * triggered using the event.
     */
    const int POLICY_FLAG_KEY_GESTURE_TRIGGERED = 0x40000;

    /**
     * The input event was injected from an AccessibilityService with the
     * AccessibilityServiceInfo#isAccessibilityTool property set to true. These services (known as
     * "Accessibility Tools") are used to assist users with disabilities, so events from these
     * services should be able to reach all Views including Views which set
     * View#isAccessibilityDataSensitive to true. Used in policyFlags for input event injection.
     */
    const int POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY_TOOL = 0x80000;

    /**
     * Common input event flag used for both motion and key events for a gesture or pointer being
     * canceled.
     */
    const int INPUT_EVENT_FLAG_CANCELED = 0x20;

    /**
     * Input event flag used for both motion and key events.
     * See POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY for more information.
     */
    const int INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT = 0x800;

    /**
     * Input event flag used for motion events.
     * See POLICY_FLAG_INJECTED_FROM_ACCESSIBILITY_TOOL for more information.
     */
    const int INPUT_EVENT_FLAG_INJECTED_FROM_ACCESSIBILITY_TOOL = 0x1000;

    /**
     * Common input event flag used for both motion and key events, indicating that the system has
     * detected this event may be inconsistent with the current event sequence or gesture, such as
     * when a pointer move event is sent but the pointer is not down.
     */
    const int INPUT_EVENT_FLAG_TAINTED = 0x80000000;

    /* The default pointer acceleration value. */
    const int DEFAULT_POINTER_ACCELERATION = 3;

    /* The default mouse wheel acceleration value. */
    const int DEFAULT_MOUSE_WHEEL_ACCELERATION = 4;

    /**
     * Use the default Velocity Tracker Strategy. Different axes may use different default
     * strategies.
     */
    const int VELOCITY_TRACKER_STRATEGY_DEFAULT = -1;

    /**
     * Velocity Tracker Strategy: Impulse.
     * Physical model of pushing an object.  Quality: VERY GOOD.
     * Works with duplicate coordinates, unclean finger liftoff.
     */
    const int VELOCITY_TRACKER_STRATEGY_IMPULSE = 0;

    /**
     * Velocity Tracker Strategy: LSQ1.
     * 1st order least squares.  Quality: POOR.
     * Frequently underfits the touch data especially when the finger accelerates
     * or changes direction.  Often underestimates velocity.  The direction
     * is overly influenced by historical touch points.
     */
    const int VELOCITY_TRACKER_STRATEGY_LSQ1 = 1;

    /**
     * Velocity Tracker Strategy: LSQ2.
     * 2nd order least squares.  Quality: VERY GOOD.
     * Pretty much ideal, but can be confused by certain kinds of touch data,
     * particularly if the panel has a tendency to generate delayed,
     * duplicate or jittery touch coordinates when the finger is released.
     */
    const int VELOCITY_TRACKER_STRATEGY_LSQ2 = 2;

    /**
     * Velocity Tracker Strategy: LSQ3.
     * 3rd order least squares.  Quality: UNUSABLE.
     * Frequently overfits the touch data yielding wildly divergent estimates
     * of the velocity when the finger is released.
     */
    const int VELOCITY_TRACKER_STRATEGY_LSQ3 = 3;

    /**
     * Velocity Tracker Strategy: WLSQ2_DELTA.
     * 2nd order weighted least squares, delta weighting.  Quality: EXPERIMENTAL
     */
    const int VELOCITY_TRACKER_STRATEGY_WLSQ2_DELTA = 4;

    /**
     * Velocity Tracker Strategy: WLSQ2_CENTRAL.
     * 2nd order weighted least squares, central weighting.  Quality: EXPERIMENTALe
     */
    const int VELOCITY_TRACKER_STRATEGY_WLSQ2_CENTRAL = 5;

    /**
     * Velocity Tracker Strategy: WLSQ2_RECENT.
     * 2nd order weighted least squares, recent weighting.  Quality: EXPERIMENTAL
     */
    const int VELOCITY_TRACKER_STRATEGY_WLSQ2_RECENT = 6;

    /**
     * Velocity Tracker Strategy: INT1.
     * 1st order integrating filter.  Quality: GOOD.
     * Not as good as 'lsq2' because it cannot estimate acceleration but it is
     * more tolerant of errors.  Like 'lsq1', this strategy tends to underestimate
     * the velocity of a fling but this strategy tends to respond to changes in
     * direction more quickly and accurately.
     */
    const int VELOCITY_TRACKER_STRATEGY_INT1 = 7;

    /**
     * Velocity Tracker Strategy: INT2.
     * 2nd order integrating filter.  Quality: EXPERIMENTAL.
     * For comparison purposes only.  Unlike 'int1' this strategy can compensate
     * for acceleration but it typically overestimates the effect.
     */
    const int VELOCITY_TRACKER_STRATEGY_INT2 = 8;

    /**
     * Velocity Tracker Strategy: Legacy.
     * Legacy velocity tracker algorithm.  Quality: POOR.
     * For comparison purposes only.  This algorithm is strongly influenced by
     * old data points, consistently underestimates velocity and takes a very long
     * time to adjust to changes in direction.
     */
    const int VELOCITY_TRACKER_STRATEGY_LEGACY = 9;


    /*
     * Input device class: Keyboard
     * The input device is a keyboard or has buttons.
     *
     * @hide
     */
    const int DEVICE_CLASS_KEYBOARD = 0x00000001;

    /*
     * Input device class: Alphakey
     * The input device is an alpha-numeric keyboard (not just a dial pad).
     *
     * @hide
     */
    const int DEVICE_CLASS_ALPHAKEY = 0x00000002;

    /*
     * Input device class: Touch
     * The input device is a touchscreen or a touchpad (either single-touch or multi-touch).
     *
     * @hide
     */
    const int DEVICE_CLASS_TOUCH = 0x00000004;

    /*
     * Input device class: Cursor
     * The input device is a cursor device such as a trackball or mouse.
     *
     * @hide
     */
    const int DEVICE_CLASS_CURSOR = 0x00000008;

    /*
     * Input device class: Multi-touch
     * The input device is a multi-touch touchscreen or touchpad.
     *
     * @hide
     */
    const int DEVICE_CLASS_TOUCH_MT = 0x00000010;

    /*
     * Input device class: Dpad
     * The input device is a directional pad (implies keyboard, has DPAD keys).
     *
     * @hide
     */
    const int DEVICE_CLASS_DPAD = 0x00000020;

    /*
     * Input device class: Gamepad
     * The input device is a gamepad (implies keyboard, has BUTTON keys).
     *
     * @hide
     */
    const int DEVICE_CLASS_GAMEPAD = 0x00000040;

    /*
     * Input device class: Switch
     * The input device has switches.
     *
     * @hide
     */
    const int DEVICE_CLASS_SWITCH = 0x00000080;

    /*
     * Input device class: Joystick
     * The input device is a joystick (implies gamepad, has joystick absolute axes).
     *
     * @hide
     */
    const int DEVICE_CLASS_JOYSTICK = 0x00000100;

    /*
     * Input device class: Vibrator
     * The input device has a vibrator (supports FF_RUMBLE).
     *
     * @hide
     */
    const int DEVICE_CLASS_VIBRATOR = 0x00000200;

    /*
     * Input device class: Mic
     * The input device has a microphone.
     *
     * @hide
     */
    const int DEVICE_CLASS_MIC = 0x00000400;

    /*
     * Input device class: External Stylus
     * The input device is an external stylus (has data we want to fuse with touch data).
     *
     * @hide
     */
    const int DEVICE_CLASS_EXTERNAL_STYLUS = 0x00000800;

    /*
     * Input device class: Rotary Encoder
     * The input device has a rotary encoder.
     *
     * @hide
     */
    const int DEVICE_CLASS_ROTARY_ENCODER = 0x00001000;

    /*
     * Input device class: Sensor
     * The input device has a sensor like accelerometer, gyro, etc.
     *
     * @hide
     */
    const int DEVICE_CLASS_SENSOR = 0x00002000;

    /*
     * Input device class: Battery
     * The input device has a battery.
     *
     * @hide
     */
    const int DEVICE_CLASS_BATTERY = 0x00004000;

    /*
     * Input device class: Light
     * The input device has sysfs controllable lights.
     *
     * @hide
     */
    const int DEVICE_CLASS_LIGHT = 0x00008000;

    /*
     * Input device class: Touchpad
     * The input device is a touchpad, requiring an on-screen cursor.
     *
     * @hide
     */
    const int DEVICE_CLASS_TOUCHPAD = 0x00010000;

    /*
     * Input device class: Virtual
     * The input device is virtual (not a real device, not part of UI configuration).
     *
     * @hide
     */
    const int DEVICE_CLASS_VIRTUAL = 0x20000000;

    /*
     * Input device class: External
     * The input device is external (not built-in).
     *
     * @hide
     */
    const int DEVICE_CLASS_EXTERNAL = 0x40000000;
}