blob: 27f65bce8832d1610416e2b12e3c3492bbb080a8 [file] [log] [blame]
Jeff Brown46b9ac02010-04-22 18:58:52 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _UI_INPUT_H
18#define _UI_INPUT_H
19
20/**
21 * Native input event structures.
22 */
23
24#include <android/input.h>
25#include <utils/Vector.h>
Jeff Brown6d0fec22010-07-23 21:28:06 -070026#include <utils/KeyedVector.h>
Jeff Brown46b9ac02010-04-22 18:58:52 -070027#include <utils/Timers.h>
Jeff Brown6d0fec22010-07-23 21:28:06 -070028#include <utils/RefBase.h>
29#include <utils/String8.h>
Jeff Brown46b9ac02010-04-22 18:58:52 -070030
31/*
32 * Additional private constants not defined in ndk/ui/input.h.
33 */
34enum {
35 /*
36 * Private control to determine when an app is tracking a key sequence.
37 */
Jeff Brownc5ed5912010-07-14 18:48:53 -070038 AKEY_EVENT_FLAG_START_TRACKING = 0x40000000
Jeff Brown46b9ac02010-04-22 18:58:52 -070039};
40
41/*
42 * Maximum number of pointers supported per motion event.
Jeff Brown01ce2e92010-09-26 22:20:12 -070043 * Smallest number of pointers is 1.
Jeff Brown46b9ac02010-04-22 18:58:52 -070044 */
45#define MAX_POINTERS 10
46
Dianne Hackborna95e4cb2010-06-18 18:09:33 -070047/*
Jeff Brown01ce2e92010-09-26 22:20:12 -070048 * Maximum pointer id value supported in a motion event.
49 * Smallest pointer id is 0.
50 * (This is limited by our use of BitSet32 to track pointer assignments.)
51 */
52#define MAX_POINTER_ID 31
53
54/*
Dianne Hackborna95e4cb2010-06-18 18:09:33 -070055 * Declare a concrete type for the NDK's input event forward declaration.
56 */
Dianne Hackbornd76b67c2010-07-13 17:48:30 -070057struct AInputEvent {
58 virtual ~AInputEvent() { }
59};
Dianne Hackborna95e4cb2010-06-18 18:09:33 -070060
Jeff Brown46b9ac02010-04-22 18:58:52 -070061/*
Jeff Brown6d0fec22010-07-23 21:28:06 -070062 * Declare a concrete type for the NDK's input device forward declaration.
Jeff Brown46b9ac02010-04-22 18:58:52 -070063 */
Jeff Brown6d0fec22010-07-23 21:28:06 -070064struct AInputDevice {
65 virtual ~AInputDevice() { }
Jeff Brown46b9ac02010-04-22 18:58:52 -070066};
67
Jeff Brown6d0fec22010-07-23 21:28:06 -070068
69namespace android {
70
Jeff Brown46b9ac02010-04-22 18:58:52 -070071/*
72 * Flags that flow alongside events in the input dispatch system to help with certain
73 * policy decisions such as waking from device sleep.
Jeff Brownb6997262010-10-08 22:31:17 -070074 *
75 * These flags are also defined in frameworks/base/core/java/android/view/WindowManagerPolicy.java.
Jeff Brown46b9ac02010-04-22 18:58:52 -070076 */
77enum {
Jeff Brown0eaf3932010-10-01 14:55:30 -070078 /* These flags originate in RawEvents and are generally set in the key map.
Jeff Brown497a92c2010-09-12 17:55:08 -070079 * NOTE: If you edit these flags, also edit labels in KeycodeLabels.h. */
Jeff Brown46b9ac02010-04-22 18:58:52 -070080
81 POLICY_FLAG_WAKE = 0x00000001,
82 POLICY_FLAG_WAKE_DROPPED = 0x00000002,
83 POLICY_FLAG_SHIFT = 0x00000004,
84 POLICY_FLAG_CAPS_LOCK = 0x00000008,
85 POLICY_FLAG_ALT = 0x00000010,
86 POLICY_FLAG_ALT_GR = 0x00000020,
87 POLICY_FLAG_MENU = 0x00000040,
88 POLICY_FLAG_LAUNCHER = 0x00000080,
Jeff Brown0eaf3932010-10-01 14:55:30 -070089 POLICY_FLAG_VIRTUAL = 0x00000100,
Jeff Brown497a92c2010-09-12 17:55:08 -070090 POLICY_FLAG_FUNCTION = 0x00000200,
Jeff Brown46b9ac02010-04-22 18:58:52 -070091
Jeff Brown7fbdc842010-06-17 20:52:56 -070092 POLICY_FLAG_RAW_MASK = 0x0000ffff,
93
Jeff Brown85a31762010-09-01 17:01:00 -070094 /* These flags are set by the input dispatcher. */
95
96 // Indicates that the input event was injected.
97 POLICY_FLAG_INJECTED = 0x01000000,
98
Jeff Browne20c9e02010-10-11 14:20:19 -070099 // Indicates that the input event is from a trusted source such as a directly attached
100 // input device or an application with system-wide event injection permission.
101 POLICY_FLAG_TRUSTED = 0x02000000,
102
Jeff Brown9c3cda02010-06-15 01:31:58 -0700103 /* These flags are set by the input reader policy as it intercepts each event. */
Jeff Brown46b9ac02010-04-22 18:58:52 -0700104
105 // Indicates that the screen was off when the event was received and the event
106 // should wake the device.
107 POLICY_FLAG_WOKE_HERE = 0x10000000,
108
109 // Indicates that the screen was dim when the event was received and the event
110 // should brighten the device.
111 POLICY_FLAG_BRIGHT_HERE = 0x20000000,
Jeff Brownb6997262010-10-08 22:31:17 -0700112
113 // Indicates that the event should be dispatched to applications.
114 // The input event should still be sent to the InputDispatcher so that it can see all
115 // input events received include those that it will not deliver.
116 POLICY_FLAG_PASS_TO_USER = 0x40000000,
Jeff Brown46b9ac02010-04-22 18:58:52 -0700117};
118
119/*
Jeff Brown9c3cda02010-06-15 01:31:58 -0700120 * Describes the basic configuration of input devices that are present.
121 */
122struct InputConfiguration {
123 enum {
124 TOUCHSCREEN_UNDEFINED = 0,
125 TOUCHSCREEN_NOTOUCH = 1,
126 TOUCHSCREEN_STYLUS = 2,
127 TOUCHSCREEN_FINGER = 3
128 };
129
130 enum {
131 KEYBOARD_UNDEFINED = 0,
132 KEYBOARD_NOKEYS = 1,
133 KEYBOARD_QWERTY = 2,
134 KEYBOARD_12KEY = 3
135 };
136
137 enum {
138 NAVIGATION_UNDEFINED = 0,
139 NAVIGATION_NONAV = 1,
140 NAVIGATION_DPAD = 2,
141 NAVIGATION_TRACKBALL = 3,
142 NAVIGATION_WHEEL = 4
143 };
144
145 int32_t touchScreen;
146 int32_t keyboard;
147 int32_t navigation;
148};
149
150/*
Jeff Brown46b9ac02010-04-22 18:58:52 -0700151 * Pointer coordinate data.
152 */
153struct PointerCoords {
154 float x;
155 float y;
156 float pressure;
157 float size;
Jeff Brownc5ed5912010-07-14 18:48:53 -0700158 float touchMajor;
159 float touchMinor;
160 float toolMajor;
161 float toolMinor;
162 float orientation;
Jeff Brown46b9ac02010-04-22 18:58:52 -0700163};
164
165/*
166 * Input events.
167 */
Dianne Hackborn2e9f93e2010-06-28 15:27:30 -0700168class InputEvent : public AInputEvent {
Jeff Brown46b9ac02010-04-22 18:58:52 -0700169public:
170 virtual ~InputEvent() { }
171
172 virtual int32_t getType() const = 0;
173
174 inline int32_t getDeviceId() const { return mDeviceId; }
175
Jeff Brownc5ed5912010-07-14 18:48:53 -0700176 inline int32_t getSource() const { return mSource; }
Dianne Hackborn3c80a4a2010-06-29 19:20:40 -0700177
Jeff Brown46b9ac02010-04-22 18:58:52 -0700178protected:
Jeff Brownc5ed5912010-07-14 18:48:53 -0700179 void initialize(int32_t deviceId, int32_t source);
Dianne Hackborn2c6081c2010-07-15 17:44:53 -0700180 void initialize(const InputEvent& from);
Jeff Brown46b9ac02010-04-22 18:58:52 -0700181
182private:
183 int32_t mDeviceId;
Jeff Brownc5ed5912010-07-14 18:48:53 -0700184 int32_t mSource;
Jeff Brown46b9ac02010-04-22 18:58:52 -0700185};
186
Jeff Brown5c225b12010-06-16 01:53:36 -0700187/*
188 * Key events.
189 */
Jeff Brown46b9ac02010-04-22 18:58:52 -0700190class KeyEvent : public InputEvent {
191public:
192 virtual ~KeyEvent() { }
193
Jeff Brownc5ed5912010-07-14 18:48:53 -0700194 virtual int32_t getType() const { return AINPUT_EVENT_TYPE_KEY; }
Jeff Brown46b9ac02010-04-22 18:58:52 -0700195
196 inline int32_t getAction() const { return mAction; }
197
198 inline int32_t getFlags() const { return mFlags; }
199
200 inline int32_t getKeyCode() const { return mKeyCode; }
201
202 inline int32_t getScanCode() const { return mScanCode; }
203
204 inline int32_t getMetaState() const { return mMetaState; }
205
206 inline int32_t getRepeatCount() const { return mRepeatCount; }
207
208 inline nsecs_t getDownTime() const { return mDownTime; }
209
210 inline nsecs_t getEventTime() const { return mEventTime; }
211
Dianne Hackborn3c80a4a2010-06-29 19:20:40 -0700212 // Return true if this event may have a default action implementation.
213 static bool hasDefaultAction(int32_t keyCode);
214 bool hasDefaultAction() const;
215
216 // Return true if this event represents a system key.
217 static bool isSystemKey(int32_t keyCode);
218 bool isSystemKey() const;
219
Jeff Brown46b9ac02010-04-22 18:58:52 -0700220 void initialize(
221 int32_t deviceId,
Jeff Brownc5ed5912010-07-14 18:48:53 -0700222 int32_t source,
Jeff Brown46b9ac02010-04-22 18:58:52 -0700223 int32_t action,
224 int32_t flags,
225 int32_t keyCode,
226 int32_t scanCode,
227 int32_t metaState,
228 int32_t repeatCount,
229 nsecs_t downTime,
230 nsecs_t eventTime);
Dianne Hackborn2c6081c2010-07-15 17:44:53 -0700231 void initialize(const KeyEvent& from);
Jeff Brown46b9ac02010-04-22 18:58:52 -0700232
233private:
234 int32_t mAction;
235 int32_t mFlags;
236 int32_t mKeyCode;
237 int32_t mScanCode;
238 int32_t mMetaState;
239 int32_t mRepeatCount;
240 nsecs_t mDownTime;
241 nsecs_t mEventTime;
242};
243
Jeff Brown5c225b12010-06-16 01:53:36 -0700244/*
245 * Motion events.
246 */
Jeff Brown46b9ac02010-04-22 18:58:52 -0700247class MotionEvent : public InputEvent {
248public:
249 virtual ~MotionEvent() { }
250
Jeff Brownc5ed5912010-07-14 18:48:53 -0700251 virtual int32_t getType() const { return AINPUT_EVENT_TYPE_MOTION; }
Jeff Brown46b9ac02010-04-22 18:58:52 -0700252
253 inline int32_t getAction() const { return mAction; }
254
Jeff Brown85a31762010-09-01 17:01:00 -0700255 inline int32_t getFlags() const { return mFlags; }
256
Jeff Brown46b9ac02010-04-22 18:58:52 -0700257 inline int32_t getEdgeFlags() const { return mEdgeFlags; }
258
259 inline int32_t getMetaState() const { return mMetaState; }
260
Jeff Brown5c225b12010-06-16 01:53:36 -0700261 inline float getXOffset() const { return mXOffset; }
262
263 inline float getYOffset() const { return mYOffset; }
264
Jeff Brown46b9ac02010-04-22 18:58:52 -0700265 inline float getXPrecision() const { return mXPrecision; }
266
267 inline float getYPrecision() const { return mYPrecision; }
268
269 inline nsecs_t getDownTime() const { return mDownTime; }
270
271 inline size_t getPointerCount() const { return mPointerIds.size(); }
272
273 inline int32_t getPointerId(size_t pointerIndex) const { return mPointerIds[pointerIndex]; }
274
275 inline nsecs_t getEventTime() const { return mSampleEventTimes[getHistorySize()]; }
276
Jeff Brown5c225b12010-06-16 01:53:36 -0700277 inline float getRawX(size_t pointerIndex) const {
Jeff Brown46b9ac02010-04-22 18:58:52 -0700278 return getCurrentPointerCoords(pointerIndex).x;
279 }
280
Jeff Brown5c225b12010-06-16 01:53:36 -0700281 inline float getRawY(size_t pointerIndex) const {
Jeff Brown46b9ac02010-04-22 18:58:52 -0700282 return getCurrentPointerCoords(pointerIndex).y;
283 }
284
Jeff Brown5c225b12010-06-16 01:53:36 -0700285 inline float getX(size_t pointerIndex) const {
286 return getRawX(pointerIndex) + mXOffset;
287 }
288
289 inline float getY(size_t pointerIndex) const {
290 return getRawY(pointerIndex) + mYOffset;
291 }
292
Jeff Brown46b9ac02010-04-22 18:58:52 -0700293 inline float getPressure(size_t pointerIndex) const {
294 return getCurrentPointerCoords(pointerIndex).pressure;
295 }
296
297 inline float getSize(size_t pointerIndex) const {
298 return getCurrentPointerCoords(pointerIndex).size;
299 }
300
Jeff Brownc5ed5912010-07-14 18:48:53 -0700301 inline float getTouchMajor(size_t pointerIndex) const {
302 return getCurrentPointerCoords(pointerIndex).touchMajor;
303 }
304
305 inline float getTouchMinor(size_t pointerIndex) const {
306 return getCurrentPointerCoords(pointerIndex).touchMinor;
307 }
308
309 inline float getToolMajor(size_t pointerIndex) const {
310 return getCurrentPointerCoords(pointerIndex).toolMajor;
311 }
312
313 inline float getToolMinor(size_t pointerIndex) const {
314 return getCurrentPointerCoords(pointerIndex).toolMinor;
315 }
316
317 inline float getOrientation(size_t pointerIndex) const {
318 return getCurrentPointerCoords(pointerIndex).orientation;
319 }
320
Jeff Brown46b9ac02010-04-22 18:58:52 -0700321 inline size_t getHistorySize() const { return mSampleEventTimes.size() - 1; }
322
323 inline nsecs_t getHistoricalEventTime(size_t historicalIndex) const {
324 return mSampleEventTimes[historicalIndex];
325 }
326
Jeff Brown5c225b12010-06-16 01:53:36 -0700327 inline float getHistoricalRawX(size_t pointerIndex, size_t historicalIndex) const {
Jeff Brown46b9ac02010-04-22 18:58:52 -0700328 return getHistoricalPointerCoords(pointerIndex, historicalIndex).x;
329 }
330
Jeff Brown5c225b12010-06-16 01:53:36 -0700331 inline float getHistoricalRawY(size_t pointerIndex, size_t historicalIndex) const {
Jeff Brown46b9ac02010-04-22 18:58:52 -0700332 return getHistoricalPointerCoords(pointerIndex, historicalIndex).y;
333 }
334
Jeff Brown5c225b12010-06-16 01:53:36 -0700335 inline float getHistoricalX(size_t pointerIndex, size_t historicalIndex) const {
336 return getHistoricalRawX(pointerIndex, historicalIndex) + mXOffset;
337 }
338
339 inline float getHistoricalY(size_t pointerIndex, size_t historicalIndex) const {
340 return getHistoricalRawY(pointerIndex, historicalIndex) + mYOffset;
341 }
342
Jeff Brown46b9ac02010-04-22 18:58:52 -0700343 inline float getHistoricalPressure(size_t pointerIndex, size_t historicalIndex) const {
344 return getHistoricalPointerCoords(pointerIndex, historicalIndex).pressure;
345 }
346
347 inline float getHistoricalSize(size_t pointerIndex, size_t historicalIndex) const {
348 return getHistoricalPointerCoords(pointerIndex, historicalIndex).size;
349 }
350
Jeff Brownc5ed5912010-07-14 18:48:53 -0700351 inline float getHistoricalTouchMajor(size_t pointerIndex, size_t historicalIndex) const {
352 return getHistoricalPointerCoords(pointerIndex, historicalIndex).touchMajor;
353 }
354
355 inline float getHistoricalTouchMinor(size_t pointerIndex, size_t historicalIndex) const {
356 return getHistoricalPointerCoords(pointerIndex, historicalIndex).touchMinor;
357 }
358
359 inline float getHistoricalToolMajor(size_t pointerIndex, size_t historicalIndex) const {
360 return getHistoricalPointerCoords(pointerIndex, historicalIndex).toolMajor;
361 }
362
363 inline float getHistoricalToolMinor(size_t pointerIndex, size_t historicalIndex) const {
364 return getHistoricalPointerCoords(pointerIndex, historicalIndex).toolMinor;
365 }
366
367 inline float getHistoricalOrientation(size_t pointerIndex, size_t historicalIndex) const {
368 return getHistoricalPointerCoords(pointerIndex, historicalIndex).orientation;
369 }
370
Jeff Brown46b9ac02010-04-22 18:58:52 -0700371 void initialize(
372 int32_t deviceId,
Jeff Brownc5ed5912010-07-14 18:48:53 -0700373 int32_t source,
Jeff Brown46b9ac02010-04-22 18:58:52 -0700374 int32_t action,
Jeff Brown85a31762010-09-01 17:01:00 -0700375 int32_t flags,
Jeff Brown46b9ac02010-04-22 18:58:52 -0700376 int32_t edgeFlags,
377 int32_t metaState,
Jeff Brown5c225b12010-06-16 01:53:36 -0700378 float xOffset,
379 float yOffset,
Jeff Brown46b9ac02010-04-22 18:58:52 -0700380 float xPrecision,
381 float yPrecision,
382 nsecs_t downTime,
383 nsecs_t eventTime,
384 size_t pointerCount,
385 const int32_t* pointerIds,
386 const PointerCoords* pointerCoords);
387
388 void addSample(
389 nsecs_t eventTime,
390 const PointerCoords* pointerCoords);
391
392 void offsetLocation(float xOffset, float yOffset);
393
Jeff Brown5c225b12010-06-16 01:53:36 -0700394 // Low-level accessors.
395 inline const int32_t* getPointerIds() const { return mPointerIds.array(); }
396 inline const nsecs_t* getSampleEventTimes() const { return mSampleEventTimes.array(); }
397 inline const PointerCoords* getSamplePointerCoords() const {
398 return mSamplePointerCoords.array();
399 }
400
Jeff Brown46b9ac02010-04-22 18:58:52 -0700401private:
402 int32_t mAction;
Jeff Brown85a31762010-09-01 17:01:00 -0700403 int32_t mFlags;
Jeff Brown46b9ac02010-04-22 18:58:52 -0700404 int32_t mEdgeFlags;
405 int32_t mMetaState;
Jeff Brown5c225b12010-06-16 01:53:36 -0700406 float mXOffset;
407 float mYOffset;
Jeff Brown46b9ac02010-04-22 18:58:52 -0700408 float mXPrecision;
409 float mYPrecision;
410 nsecs_t mDownTime;
411 Vector<int32_t> mPointerIds;
412 Vector<nsecs_t> mSampleEventTimes;
413 Vector<PointerCoords> mSamplePointerCoords;
414
415 inline const PointerCoords& getCurrentPointerCoords(size_t pointerIndex) const {
416 return mSamplePointerCoords[getHistorySize() * getPointerCount() + pointerIndex];
417 }
418
419 inline const PointerCoords& getHistoricalPointerCoords(
420 size_t pointerIndex, size_t historicalIndex) const {
421 return mSamplePointerCoords[historicalIndex * getPointerCount() + pointerIndex];
422 }
423};
424
425/*
426 * Input event factory.
427 */
428class InputEventFactoryInterface {
429protected:
430 virtual ~InputEventFactoryInterface() { }
431
432public:
433 InputEventFactoryInterface() { }
434
435 virtual KeyEvent* createKeyEvent() = 0;
436 virtual MotionEvent* createMotionEvent() = 0;
437};
438
439/*
440 * A simple input event factory implementation that uses a single preallocated instance
441 * of each type of input event that are reused for each request.
442 */
443class PreallocatedInputEventFactory : public InputEventFactoryInterface {
444public:
445 PreallocatedInputEventFactory() { }
446 virtual ~PreallocatedInputEventFactory() { }
447
448 virtual KeyEvent* createKeyEvent() { return & mKeyEvent; }
449 virtual MotionEvent* createMotionEvent() { return & mMotionEvent; }
450
451private:
452 KeyEvent mKeyEvent;
453 MotionEvent mMotionEvent;
454};
455
Jeff Brown6d0fec22010-07-23 21:28:06 -0700456/*
457 * Describes the characteristics and capabilities of an input device.
458 */
459class InputDeviceInfo {
460public:
461 InputDeviceInfo();
462 InputDeviceInfo(const InputDeviceInfo& other);
463 ~InputDeviceInfo();
464
465 struct MotionRange {
466 float min;
467 float max;
468 float flat;
469 float fuzz;
470 };
471
472 void initialize(int32_t id, const String8& name);
473
474 inline int32_t getId() const { return mId; }
475 inline const String8 getName() const { return mName; }
476 inline uint32_t getSources() const { return mSources; }
477
478 const MotionRange* getMotionRange(int32_t rangeType) const;
479
480 void addSource(uint32_t source);
481 void addMotionRange(int32_t rangeType, float min, float max, float flat, float fuzz);
482 void addMotionRange(int32_t rangeType, const MotionRange& range);
483
484 inline void setKeyboardType(int32_t keyboardType) { mKeyboardType = keyboardType; }
485 inline int32_t getKeyboardType() const { return mKeyboardType; }
486
Jeff Brown8d608662010-08-30 03:02:23 -0700487 inline const KeyedVector<int32_t, MotionRange> getMotionRanges() const {
488 return mMotionRanges;
489 }
490
Jeff Brown6d0fec22010-07-23 21:28:06 -0700491private:
492 int32_t mId;
493 String8 mName;
494 uint32_t mSources;
495 int32_t mKeyboardType;
496
497 KeyedVector<int32_t, MotionRange> mMotionRanges;
498};
499
Jeff Brown90655042010-12-02 13:50:46 -0800500/*
501 * Identifies a device.
502 */
503struct InputDeviceIdentifier {
504 inline InputDeviceIdentifier() :
505 bus(0), vendor(0), product(0), version(0) {
506 }
507
508 String8 name;
509 String8 location;
510 String8 uniqueId;
511 uint16_t bus;
512 uint16_t vendor;
513 uint16_t product;
514 uint16_t version;
515};
516
Jeff Brown47e6b1b2010-11-29 17:37:49 -0800517/* Types of input device configuration files. */
518enum InputDeviceConfigurationFileType {
519 INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION = 0, /* .idc file */
520 INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_LAYOUT = 1, /* .kl file */
521 INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_CHARACTER_MAP = 2, /* .kcm file */
522};
523
524/*
Jeff Brown90655042010-12-02 13:50:46 -0800525 * Gets the path of an input device configuration file, if one is available.
Jeff Brown1f245102010-11-18 20:53:46 -0800526 * Considers both system provided and user installed configuration files.
Jeff Brown47e6b1b2010-11-29 17:37:49 -0800527 *
Jeff Brown90655042010-12-02 13:50:46 -0800528 * The device identifier is used to construct several default configuration file
529 * names to try based on the device name, vendor, product, and version.
530 *
Jeff Brown47e6b1b2010-11-29 17:37:49 -0800531 * Returns an empty string if not found.
532 */
Jeff Brown90655042010-12-02 13:50:46 -0800533extern String8 getInputDeviceConfigurationFilePathByDeviceIdentifier(
534 const InputDeviceIdentifier& deviceIdentifier,
535 InputDeviceConfigurationFileType type);
536
537/*
538 * Gets the path of an input device configuration file, if one is available.
539 * Considers both system provided and user installed configuration files.
540 *
541 * The name is case-sensitive and is used to construct the filename to resolve.
542 * All characters except 'a'-'z', 'A'-'Z', '0'-'9', '-', and '_' are replaced by underscores.
543 *
544 * Returns an empty string if not found.
545 */
546extern String8 getInputDeviceConfigurationFilePathByName(
Jeff Brown47e6b1b2010-11-29 17:37:49 -0800547 const String8& name, InputDeviceConfigurationFileType type);
Jeff Brown46b9ac02010-04-22 18:58:52 -0700548
549} // namespace android
550
551#endif // _UI_INPUT_H