blob: d7aeb31d2dfe7418bae51649002494c97115774c [file] [log] [blame]
Jeff Brown5912f952013-07-01 19:10:31 -07001/*
2 * Copyright (C) 2012 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
Prabir Pradhanc08b0db2022-09-10 00:57:15 +000017#pragma once
Jeff Brown5912f952013-07-01 19:10:31 -070018
Chris Yef59a2f42020-10-16 12:55:26 -070019#include <android/sensor.h>
Vaibhav Devmurari82b37d62022-09-12 13:36:48 +000020#include <ftl/flags.h>
Vaibhav Devmurari16c24192023-05-04 15:20:12 +000021#include <ftl/mixins.h>
Jeff Brown5912f952013-07-01 19:10:31 -070022#include <input/Input.h>
23#include <input/KeyCharacterMap.h>
Vaibhav Devmurari16c24192023-05-04 15:20:12 +000024#include <set>
Chris Yef59a2f42020-10-16 12:55:26 -070025#include <unordered_map>
Arthur Hung7c3ae9c2019-03-11 11:23:03 +080026#include <vector>
Jeff Brown5912f952013-07-01 19:10:31 -070027
Sandro Meierd3d40602022-10-19 16:18:26 +000028#include <android/os/IInputConstants.h>
Vaibhav Devmuraridd82b8e2022-08-16 15:34:01 +000029
Jeff Brown5912f952013-07-01 19:10:31 -070030namespace android {
31
32/*
33 * Identifies a device.
34 */
35struct InputDeviceIdentifier {
36 inline InputDeviceIdentifier() :
37 bus(0), vendor(0), product(0), version(0) {
38 }
39
40 // Information provided by the kernel.
Siarhei Vishniakouec8f7252018-07-06 11:19:32 +010041 std::string name;
42 std::string location;
43 std::string uniqueId;
Jeff Brown5912f952013-07-01 19:10:31 -070044 uint16_t bus;
45 uint16_t vendor;
46 uint16_t product;
47 uint16_t version;
48
49 // A composite input device descriptor string that uniquely identifies the device
50 // even across reboots or reconnections. The value of this field is used by
51 // upper layers of the input system to associate settings with individual devices.
52 // It is hashed from whatever kernel provided information is available.
53 // Ideally, the way this value is computed should not change between Android releases
54 // because that would invalidate persistent settings that rely on it.
Siarhei Vishniakouec8f7252018-07-06 11:19:32 +010055 std::string descriptor;
RoboErikec2a15a2013-12-19 11:54:29 -080056
57 // A value added to uniquely identify a device in the absence of a unique id. This
58 // is intended to be a minimum way to distinguish from other active devices and may
59 // reuse values that are not associated with an input anymore.
60 uint16_t nonce;
Siarhei Vishniakoub45635c2019-02-20 19:22:09 -060061
Prabir Pradhan07525ef2022-10-03 21:51:26 +000062 // The bluetooth address of the device, if known.
63 std::optional<std::string> bluetoothAddress;
64
Siarhei Vishniakoub45635c2019-02-20 19:22:09 -060065 /**
66 * Return InputDeviceIdentifier.name that has been adjusted as follows:
67 * - all characters besides alphanumerics, dash,
68 * and underscore have been replaced with underscores.
69 * This helps in situations where a file that matches the device name is needed,
70 * while conforming to the filename limitations.
71 */
72 std::string getCanonicalName() const;
Prabir Pradhan852db892023-04-06 22:16:44 +000073
74 bool operator==(const InputDeviceIdentifier&) const = default;
75 bool operator!=(const InputDeviceIdentifier&) const = default;
Jeff Brown5912f952013-07-01 19:10:31 -070076};
77
Yeabkal Wubshitb1b96db2024-01-24 12:47:00 -080078/**
79 * Holds View related behaviors for an InputDevice.
80 */
81struct InputDeviceViewBehavior {
82 /**
83 * The smooth scroll behavior that applies for all source/axis, if defined by the device.
84 * Empty optional if the device has not specified the default smooth scroll behavior.
85 */
86 std::optional<bool> shouldSmoothScroll;
87};
88
Chris Yef59a2f42020-10-16 12:55:26 -070089/* Types of input device sensors. Keep sync with core/java/android/hardware/Sensor.java */
90enum class InputDeviceSensorType : int32_t {
91 ACCELEROMETER = ASENSOR_TYPE_ACCELEROMETER,
92 MAGNETIC_FIELD = ASENSOR_TYPE_MAGNETIC_FIELD,
93 ORIENTATION = 3,
94 GYROSCOPE = ASENSOR_TYPE_GYROSCOPE,
95 LIGHT = ASENSOR_TYPE_LIGHT,
96 PRESSURE = ASENSOR_TYPE_PRESSURE,
97 TEMPERATURE = 7,
98 PROXIMITY = ASENSOR_TYPE_PROXIMITY,
99 GRAVITY = ASENSOR_TYPE_GRAVITY,
100 LINEAR_ACCELERATION = ASENSOR_TYPE_LINEAR_ACCELERATION,
101 ROTATION_VECTOR = ASENSOR_TYPE_ROTATION_VECTOR,
102 RELATIVE_HUMIDITY = ASENSOR_TYPE_RELATIVE_HUMIDITY,
103 AMBIENT_TEMPERATURE = ASENSOR_TYPE_AMBIENT_TEMPERATURE,
104 MAGNETIC_FIELD_UNCALIBRATED = ASENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED,
105 GAME_ROTATION_VECTOR = ASENSOR_TYPE_GAME_ROTATION_VECTOR,
106 GYROSCOPE_UNCALIBRATED = ASENSOR_TYPE_GYROSCOPE_UNCALIBRATED,
107 SIGNIFICANT_MOTION = ASENSOR_TYPE_SIGNIFICANT_MOTION,
Dominik Laskowski75788452021-02-09 18:51:25 -0800108
109 ftl_first = ACCELEROMETER,
110 ftl_last = SIGNIFICANT_MOTION
Chris Yef59a2f42020-10-16 12:55:26 -0700111};
112
113enum class InputDeviceSensorAccuracy : int32_t {
114 ACCURACY_NONE = 0,
115 ACCURACY_LOW = 1,
116 ACCURACY_MEDIUM = 2,
117 ACCURACY_HIGH = 3,
Harry Cuttsc57cd3c2024-04-24 13:52:55 +0000118
119 ftl_last = ACCURACY_HIGH,
Chris Yef59a2f42020-10-16 12:55:26 -0700120};
121
122enum class InputDeviceSensorReportingMode : int32_t {
123 CONTINUOUS = 0,
124 ON_CHANGE = 1,
125 ONE_SHOT = 2,
126 SPECIAL_TRIGGER = 3,
127};
128
Chris Ye3fdbfef2021-01-06 18:45:18 -0800129enum class InputDeviceLightType : int32_t {
Vaibhav Devmurari82b37d62022-09-12 13:36:48 +0000130 INPUT = 0,
Chris Ye3fdbfef2021-01-06 18:45:18 -0800131 PLAYER_ID = 1,
Vaibhav Devmurari82b37d62022-09-12 13:36:48 +0000132 KEYBOARD_BACKLIGHT = 2,
Dominik Laskowski75788452021-02-09 18:51:25 -0800133
Vaibhav Devmurari82b37d62022-09-12 13:36:48 +0000134 ftl_last = KEYBOARD_BACKLIGHT
135};
136
137enum class InputDeviceLightCapability : uint32_t {
138 /** Capability to change brightness of the light */
139 BRIGHTNESS = 0x00000001,
140 /** Capability to change color of the light */
141 RGB = 0x00000002,
Chris Ye3fdbfef2021-01-06 18:45:18 -0800142};
143
Chris Yef59a2f42020-10-16 12:55:26 -0700144struct InputDeviceSensorInfo {
145 explicit InputDeviceSensorInfo(std::string name, std::string vendor, int32_t version,
146 InputDeviceSensorType type, InputDeviceSensorAccuracy accuracy,
147 float maxRange, float resolution, float power, int32_t minDelay,
148 int32_t fifoReservedEventCount, int32_t fifoMaxEventCount,
149 std::string stringType, int32_t maxDelay, int32_t flags,
150 int32_t id)
151 : name(name),
152 vendor(vendor),
153 version(version),
154 type(type),
155 accuracy(accuracy),
156 maxRange(maxRange),
157 resolution(resolution),
158 power(power),
159 minDelay(minDelay),
160 fifoReservedEventCount(fifoReservedEventCount),
161 fifoMaxEventCount(fifoMaxEventCount),
162 stringType(stringType),
163 maxDelay(maxDelay),
164 flags(flags),
165 id(id) {}
166 // Name string of the sensor.
167 std::string name;
168 // Vendor string of this sensor.
169 std::string vendor;
170 // Version of the sensor's module.
171 int32_t version;
172 // Generic type of this sensor.
173 InputDeviceSensorType type;
174 // The current accuracy of sensor event.
175 InputDeviceSensorAccuracy accuracy;
176 // Maximum range of the sensor in the sensor's unit.
177 float maxRange;
178 // Resolution of the sensor in the sensor's unit.
179 float resolution;
180 // The power in mA used by this sensor while in use.
181 float power;
182 // The minimum delay allowed between two events in microsecond or zero if this sensor only
183 // returns a value when the data it's measuring changes.
184 int32_t minDelay;
185 // Number of events reserved for this sensor in the batch mode FIFO.
186 int32_t fifoReservedEventCount;
187 // Maximum number of events of this sensor that could be batched.
188 int32_t fifoMaxEventCount;
189 // The type of this sensor as a string.
190 std::string stringType;
191 // The delay between two sensor events corresponding to the lowest frequency that this sensor
192 // supports.
193 int32_t maxDelay;
194 // Sensor flags
195 int32_t flags;
196 // Sensor id, same as the input device ID it belongs to.
197 int32_t id;
198};
199
Vaibhav Devmurari16c24192023-05-04 15:20:12 +0000200struct BrightnessLevel : ftl::DefaultConstructible<BrightnessLevel, std::uint8_t>,
201 ftl::Equatable<BrightnessLevel>,
202 ftl::Orderable<BrightnessLevel>,
203 ftl::Addable<BrightnessLevel> {
204 using DefaultConstructible::DefaultConstructible;
205};
206
Chris Ye3fdbfef2021-01-06 18:45:18 -0800207struct InputDeviceLightInfo {
208 explicit InputDeviceLightInfo(std::string name, int32_t id, InputDeviceLightType type,
Vaibhav Devmurari82b37d62022-09-12 13:36:48 +0000209 ftl::Flags<InputDeviceLightCapability> capabilityFlags,
Vaibhav Devmurari16c24192023-05-04 15:20:12 +0000210 int32_t ordinal,
211 std::set<BrightnessLevel> preferredBrightnessLevels)
212 : name(name),
213 id(id),
214 type(type),
215 capabilityFlags(capabilityFlags),
216 ordinal(ordinal),
217 preferredBrightnessLevels(std::move(preferredBrightnessLevels)) {}
Chris Ye3fdbfef2021-01-06 18:45:18 -0800218 // Name string of the light.
219 std::string name;
220 // Light id
221 int32_t id;
222 // Type of the light.
223 InputDeviceLightType type;
Vaibhav Devmurari82b37d62022-09-12 13:36:48 +0000224 // Light capabilities.
225 ftl::Flags<InputDeviceLightCapability> capabilityFlags;
Chris Ye3fdbfef2021-01-06 18:45:18 -0800226 // Ordinal of the light
227 int32_t ordinal;
Vaibhav Devmurari16c24192023-05-04 15:20:12 +0000228 // Custom brightness levels for the light
229 std::set<BrightnessLevel> preferredBrightnessLevels;
Chris Ye3fdbfef2021-01-06 18:45:18 -0800230};
231
Chris Yee2b1e5c2021-03-10 22:45:12 -0800232struct InputDeviceBatteryInfo {
233 explicit InputDeviceBatteryInfo(std::string name, int32_t id) : name(name), id(id) {}
234 // Name string of the battery.
235 std::string name;
236 // Battery id
237 int32_t id;
238};
239
Zixuan Qufecb6062022-11-12 04:44:31 +0000240struct KeyboardLayoutInfo {
241 explicit KeyboardLayoutInfo(std::string languageTag, std::string layoutType)
242 : languageTag(languageTag), layoutType(layoutType) {}
243
244 // A BCP 47 conformant language tag such as "en-US".
245 std::string languageTag;
246 // The layout type such as QWERTY or AZERTY.
247 std::string layoutType;
Vaibhav Devmurari0a6fee82023-04-11 18:53:04 +0000248
249 inline bool operator==(const KeyboardLayoutInfo& other) const {
250 return languageTag == other.languageTag && layoutType == other.layoutType;
251 }
252 inline bool operator!=(const KeyboardLayoutInfo& other) const { return !(*this == other); }
Zixuan Qufecb6062022-11-12 04:44:31 +0000253};
254
Prabir Pradhane04ffaa2022-12-13 23:04:04 +0000255// The version of the Universal Stylus Initiative (USI) protocol supported by the input device.
256struct InputDeviceUsiVersion {
257 int32_t majorVersion = -1;
258 int32_t minorVersion = -1;
259};
260
Jeff Brown5912f952013-07-01 19:10:31 -0700261/*
262 * Describes the characteristics and capabilities of an input device.
263 */
264class InputDeviceInfo {
265public:
266 InputDeviceInfo();
267 InputDeviceInfo(const InputDeviceInfo& other);
268 ~InputDeviceInfo();
269
270 struct MotionRange {
271 int32_t axis;
272 uint32_t source;
273 float min;
274 float max;
275 float flat;
276 float fuzz;
277 float resolution;
278 };
279
Michael Wright0415d632013-07-17 13:23:26 -0700280 void initialize(int32_t id, int32_t generation, int32_t controllerNumber,
Vaibhav Devmuraridd82b8e2022-08-16 15:34:01 +0000281 const InputDeviceIdentifier& identifier, const std::string& alias,
Yeabkal Wubshitb1b96db2024-01-24 12:47:00 -0800282 bool isExternal, bool hasMic, int32_t associatedDisplayId,
283 InputDeviceViewBehavior viewBehavior = {{}});
Jeff Brown5912f952013-07-01 19:10:31 -0700284
285 inline int32_t getId() const { return mId; }
Michael Wright0415d632013-07-17 13:23:26 -0700286 inline int32_t getControllerNumber() const { return mControllerNumber; }
Jeff Brown5912f952013-07-01 19:10:31 -0700287 inline int32_t getGeneration() const { return mGeneration; }
288 inline const InputDeviceIdentifier& getIdentifier() const { return mIdentifier; }
Siarhei Vishniakouec8f7252018-07-06 11:19:32 +0100289 inline const std::string& getAlias() const { return mAlias; }
290 inline const std::string& getDisplayName() const {
291 return mAlias.empty() ? mIdentifier.name : mAlias;
Jeff Brown5912f952013-07-01 19:10:31 -0700292 }
293 inline bool isExternal() const { return mIsExternal; }
Tim Kilbourn063ff532015-04-08 10:26:18 -0700294 inline bool hasMic() const { return mHasMic; }
Jeff Brown5912f952013-07-01 19:10:31 -0700295 inline uint32_t getSources() const { return mSources; }
296
297 const MotionRange* getMotionRange(int32_t axis, uint32_t source) const;
298
299 void addSource(uint32_t source);
300 void addMotionRange(int32_t axis, uint32_t source,
301 float min, float max, float flat, float fuzz, float resolution);
302 void addMotionRange(const MotionRange& range);
Chris Yef59a2f42020-10-16 12:55:26 -0700303 void addSensorInfo(const InputDeviceSensorInfo& info);
Chris Yee2b1e5c2021-03-10 22:45:12 -0800304 void addBatteryInfo(const InputDeviceBatteryInfo& info);
Chris Ye3fdbfef2021-01-06 18:45:18 -0800305 void addLightInfo(const InputDeviceLightInfo& info);
Jeff Brown5912f952013-07-01 19:10:31 -0700306
Philip Junkerf8437962022-01-25 21:20:19 +0100307 void setKeyboardType(int32_t keyboardType);
Jeff Brown5912f952013-07-01 19:10:31 -0700308 inline int32_t getKeyboardType() const { return mKeyboardType; }
309
Zixuan Qufecb6062022-11-12 04:44:31 +0000310 void setKeyboardLayoutInfo(KeyboardLayoutInfo keyboardLayoutInfo);
311 inline const std::optional<KeyboardLayoutInfo>& getKeyboardLayoutInfo() const {
312 return mKeyboardLayoutInfo;
313 }
314
Yeabkal Wubshitb1b96db2024-01-24 12:47:00 -0800315 inline const InputDeviceViewBehavior& getViewBehavior() const { return mViewBehavior; }
316
Chris Ye3a1e4462020-08-12 10:13:15 -0700317 inline void setKeyCharacterMap(const std::shared_ptr<KeyCharacterMap> value) {
Jeff Brown5912f952013-07-01 19:10:31 -0700318 mKeyCharacterMap = value;
319 }
320
Chris Ye3a1e4462020-08-12 10:13:15 -0700321 inline const std::shared_ptr<KeyCharacterMap> getKeyCharacterMap() const {
Jeff Brown5912f952013-07-01 19:10:31 -0700322 return mKeyCharacterMap;
323 }
324
325 inline void setVibrator(bool hasVibrator) { mHasVibrator = hasVibrator; }
326 inline bool hasVibrator() const { return mHasVibrator; }
327
Kim Low03ea0352020-11-06 12:45:07 -0800328 inline void setHasBattery(bool hasBattery) { mHasBattery = hasBattery; }
329 inline bool hasBattery() const { return mHasBattery; }
330
Michael Wright931fd6d2013-07-10 18:05:15 -0700331 inline void setButtonUnderPad(bool hasButton) { mHasButtonUnderPad = hasButton; }
332 inline bool hasButtonUnderPad() const { return mHasButtonUnderPad; }
333
Chris Yef59a2f42020-10-16 12:55:26 -0700334 inline void setHasSensor(bool hasSensor) { mHasSensor = hasSensor; }
335 inline bool hasSensor() const { return mHasSensor; }
336
Arthur Hung7c3ae9c2019-03-11 11:23:03 +0800337 inline const std::vector<MotionRange>& getMotionRanges() const {
Jeff Brown5912f952013-07-01 19:10:31 -0700338 return mMotionRanges;
339 }
340
Siarhei Vishniakou1983a712021-06-04 19:27:09 +0000341 std::vector<InputDeviceSensorInfo> getSensors();
Chris Yef59a2f42020-10-16 12:55:26 -0700342
Siarhei Vishniakou1983a712021-06-04 19:27:09 +0000343 std::vector<InputDeviceLightInfo> getLights();
Chris Ye3fdbfef2021-01-06 18:45:18 -0800344
Prabir Pradhane04ffaa2022-12-13 23:04:04 +0000345 inline void setUsiVersion(std::optional<InputDeviceUsiVersion> usiVersion) {
346 mUsiVersion = std::move(usiVersion);
347 }
348 inline std::optional<InputDeviceUsiVersion> getUsiVersion() const { return mUsiVersion; }
349
350 inline int32_t getAssociatedDisplayId() const { return mAssociatedDisplayId; }
Prabir Pradhan167c2702022-09-14 00:37:24 +0000351
Jeff Brown5912f952013-07-01 19:10:31 -0700352private:
353 int32_t mId;
354 int32_t mGeneration;
Michael Wright0415d632013-07-17 13:23:26 -0700355 int32_t mControllerNumber;
Jeff Brown5912f952013-07-01 19:10:31 -0700356 InputDeviceIdentifier mIdentifier;
Siarhei Vishniakouec8f7252018-07-06 11:19:32 +0100357 std::string mAlias;
Jeff Brown5912f952013-07-01 19:10:31 -0700358 bool mIsExternal;
Tim Kilbourn063ff532015-04-08 10:26:18 -0700359 bool mHasMic;
Zixuan Qufecb6062022-11-12 04:44:31 +0000360 std::optional<KeyboardLayoutInfo> mKeyboardLayoutInfo;
Jeff Brown5912f952013-07-01 19:10:31 -0700361 uint32_t mSources;
362 int32_t mKeyboardType;
Chris Ye3a1e4462020-08-12 10:13:15 -0700363 std::shared_ptr<KeyCharacterMap> mKeyCharacterMap;
Prabir Pradhane04ffaa2022-12-13 23:04:04 +0000364 std::optional<InputDeviceUsiVersion> mUsiVersion;
365 int32_t mAssociatedDisplayId;
Vaibhav Devmuraridd82b8e2022-08-16 15:34:01 +0000366
Jeff Brown5912f952013-07-01 19:10:31 -0700367 bool mHasVibrator;
Kim Low03ea0352020-11-06 12:45:07 -0800368 bool mHasBattery;
Michael Wright931fd6d2013-07-10 18:05:15 -0700369 bool mHasButtonUnderPad;
Chris Yef59a2f42020-10-16 12:55:26 -0700370 bool mHasSensor;
Jeff Brown5912f952013-07-01 19:10:31 -0700371
Arthur Hung7c3ae9c2019-03-11 11:23:03 +0800372 std::vector<MotionRange> mMotionRanges;
Chris Yef59a2f42020-10-16 12:55:26 -0700373 std::unordered_map<InputDeviceSensorType, InputDeviceSensorInfo> mSensors;
Chris Ye3fdbfef2021-01-06 18:45:18 -0800374 /* Map from light ID to light info */
375 std::unordered_map<int32_t, InputDeviceLightInfo> mLights;
Chris Yee2b1e5c2021-03-10 22:45:12 -0800376 /* Map from battery ID to battery info */
377 std::unordered_map<int32_t, InputDeviceBatteryInfo> mBatteries;
Yeabkal Wubshitb1b96db2024-01-24 12:47:00 -0800378 /** The View related behaviors for the device. */
379 InputDeviceViewBehavior mViewBehavior;
Jeff Brown5912f952013-07-01 19:10:31 -0700380};
381
382/* Types of input device configuration files. */
Chris Ye1d927aa2020-07-04 18:22:41 -0700383enum class InputDeviceConfigurationFileType : int32_t {
384 CONFIGURATION = 0, /* .idc file */
385 KEY_LAYOUT = 1, /* .kl file */
386 KEY_CHARACTER_MAP = 2, /* .kcm file */
Jeff Brown5912f952013-07-01 19:10:31 -0700387};
388
389/*
390 * Gets the path of an input device configuration file, if one is available.
391 * Considers both system provided and user installed configuration files.
Siarhei Vishniakoua9fd82c2022-05-18 09:42:52 -0700392 * The optional suffix is appended to the end of the file name (before the
393 * extension).
Jeff Brown5912f952013-07-01 19:10:31 -0700394 *
395 * The device identifier is used to construct several default configuration file
396 * names to try based on the device name, vendor, product, and version.
397 *
398 * Returns an empty string if not found.
399 */
Siarhei Vishniakouec8f7252018-07-06 11:19:32 +0100400extern std::string getInputDeviceConfigurationFilePathByDeviceIdentifier(
Siarhei Vishniakoua9fd82c2022-05-18 09:42:52 -0700401 const InputDeviceIdentifier& deviceIdentifier, InputDeviceConfigurationFileType type,
402 const char* suffix = "");
Jeff Brown5912f952013-07-01 19:10:31 -0700403
404/*
405 * Gets the path of an input device configuration file, if one is available.
406 * Considers both system provided and user installed configuration files.
407 *
408 * The name is case-sensitive and is used to construct the filename to resolve.
409 * All characters except 'a'-'z', 'A'-'Z', '0'-'9', '-', and '_' are replaced by underscores.
410 *
411 * Returns an empty string if not found.
412 */
Siarhei Vishniakouec8f7252018-07-06 11:19:32 +0100413extern std::string getInputDeviceConfigurationFilePathByName(
414 const std::string& name, InputDeviceConfigurationFileType type);
Jeff Brown5912f952013-07-01 19:10:31 -0700415
Prabir Pradhancae4b3a2019-02-05 18:51:32 -0800416enum ReservedInputDeviceId : int32_t {
Sandro Meierd3d40602022-10-19 16:18:26 +0000417 // Device id representing an invalid device
418 INVALID_INPUT_DEVICE_ID = android::os::IInputConstants::INVALID_INPUT_DEVICE_ID,
Prabir Pradhancae4b3a2019-02-05 18:51:32 -0800419 // Device id of a special "virtual" keyboard that is always present.
420 VIRTUAL_KEYBOARD_ID = -1,
421 // Device id of the "built-in" keyboard if there is one.
422 BUILT_IN_KEYBOARD_ID = 0,
Nathaniel R. Lewisa7b82e12020-02-12 15:40:45 -0800423 // First device id available for dynamic devices
424 END_RESERVED_ID = 1,
Prabir Pradhancae4b3a2019-02-05 18:51:32 -0800425};
426
Jeff Brown5912f952013-07-01 19:10:31 -0700427} // namespace android