Initial InputMappers for evdev input HAL.
The previous design of the InputHost wrapper classes made it very
painful to do testing, so this change also reverts to a more classical
C++ pattern for non-copyable objects. The InputHost classes still simply
call through to the input_host_t and callbacks as before.
Updated unittests to use gmock for mocking the InputHost interactions.
Change-Id: I4b70df2c89ed48af77446b8f5b87a4bde94510bf
diff --git a/include/hardware/input.h b/include/hardware/input.h
index 969b8ce..91354aa 100644
--- a/include/hardware/input.h
+++ b/include/hardware/input.h
@@ -375,13 +375,23 @@
INPUT_USAGE_LED_CONTROLLER_2,
INPUT_USAGE_LED_CONTROLLER_3,
INPUT_USAGE_LED_CONTROLLER_4,
+
+ // switches
+ INPUT_USAGE_SWITCH_UNKNOWN,
+ INPUT_USAGE_SWITCH_LID,
+ INPUT_USAGE_SWITCH_KEYPAD_SLIDE,
+ INPUT_USAGE_SWITCH_HEADPHONE_INSERT,
+ INPUT_USAGE_SWITCH_MICROPHONE_INSERT,
+ INPUT_USAGE_SWITCH_LINEOUT_INSERT,
+ INPUT_USAGE_SWITCH_CAMERA_LENS_COVER,
} input_usage_t;
-typedef enum {
+typedef enum input_collection_id {
INPUT_COLLECTION_ID_TOUCH,
INPUT_COLLECTION_ID_KEYBOARD,
INPUT_COLLECTION_ID_MOUSE,
INPUT_COLLECTION_ID_TOUCHPAD,
+ INPUT_COLLECTION_ID_SWITCH,
// etc
} input_collection_id_t;
@@ -413,6 +423,11 @@
input_report_definition_t* (*create_output_report_definition)(input_host_t* host);
/**
+ * Frees the report definition.
+ */
+ void (*free_report_definition)(input_host_t* host, input_report_definition_t* report_def);
+
+ /**
* Append the report to the given input device.
*/
void (*input_device_definition_add_report)(input_host_t* host,