summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sandro Meier <sandromeier@google.com> 2022-10-20 14:04:00 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-10-20 14:04:00 +0000
commit5cb1b5e360d762433cb2317a36e81ddd76c24f60 (patch)
tree6a3e2e616926f1465103a1456a591c8f6bdb2b1c
parent6ae1224ac66d5db1c4250183e0a60df64e494a71 (diff)
parentd3d4060123e774d38f69c85d7ae4cb3d66f0e2d8 (diff)
Merge "Add INVALID_INPUT_DEVICE_ID to IInputConstants"
-rw-r--r--include/input/InputDevice.h3
-rw-r--r--libs/input/android/os/IInputConstants.aidl8
2 files changed, 11 insertions, 0 deletions
diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h
index f4a15238cf..ac9c5a5a6f 100644
--- a/include/input/InputDevice.h
+++ b/include/input/InputDevice.h
@@ -23,6 +23,7 @@
#include <unordered_map>
#include <vector>
+#include <android/os/IInputConstants.h>
#include "android/hardware/input/InputDeviceCountryCode.h"
namespace android {
@@ -346,6 +347,8 @@ extern std::string getInputDeviceConfigurationFilePathByName(
const std::string& name, InputDeviceConfigurationFileType type);
enum ReservedInputDeviceId : int32_t {
+ // Device id representing an invalid device
+ INVALID_INPUT_DEVICE_ID = android::os::IInputConstants::INVALID_INPUT_DEVICE_ID,
// Device id of a special "virtual" keyboard that is always present.
VIRTUAL_KEYBOARD_ID = -1,
// Device id of the "built-in" keyboard if there is one.
diff --git a/libs/input/android/os/IInputConstants.aidl b/libs/input/android/os/IInputConstants.aidl
index 5ce10a4a50..dab843b48f 100644
--- a/libs/input/android/os/IInputConstants.aidl
+++ b/libs/input/android/os/IInputConstants.aidl
@@ -35,6 +35,14 @@ interface IInputConstants
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 accessibility. Used in policyFlags for input event
* injection.
*/