summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorSiarhei Vishniakou <svv@google.com>2019-01-24 10:38:02 -0800
committerSiarhei Vishniakou <svv@google.com>2019-01-26 18:42:46 -0800
commit45c1d0c19285f3abcbf394357541027841995c8e (patch)
tree131a357a04e81efe81856d7badb08f93a5665b89 /input
parent56ac36d3ab3e4203c50120d8c9bdc143c3116888 (diff)
downloadandroid_hardware_interfaces-45c1d0c19285f3abcbf394357541027841995c8e.tar.gz
android_hardware_interfaces-45c1d0c19285f3abcbf394357541027841995c8e.tar.bz2
android_hardware_interfaces-45c1d0c19285f3abcbf394357541027841995c8e.zip
Move input definitions into separate HAL
The types added for input in InputClassifier HAL are not specific to that HAL. These are common input definitions. To allow for future reuse in this and other HALs, move these definitions into a separate, type-only HAL android::hardware::input::common. This will be similar to such existing HALs as: hardware/interfaces/graphics/common hardware/interfaces/camera/common hardware/interfaces/audio/common Test: make only Bug: 111480215 Change-Id: I16d76d6bdb48b24487b232fda45c6146e1003fe9
Diffstat (limited to 'input')
-rw-r--r--input/classifier/1.0/Android.bp19
-rw-r--r--input/classifier/1.0/IInputClassifier.hal3
-rw-r--r--input/classifier/1.0/default/InputClassifier.cpp2
-rw-r--r--input/classifier/1.0/default/InputClassifier.h5
-rw-r--r--input/common/1.0/Android.bp34
-rw-r--r--input/common/1.0/types.hal (renamed from input/classifier/1.0/types.hal)14
6 files changed, 49 insertions, 28 deletions
diff --git a/input/classifier/1.0/Android.bp b/input/classifier/1.0/Android.bp
index c3c6fc612..6815a513c 100644
--- a/input/classifier/1.0/Android.bp
+++ b/input/classifier/1.0/Android.bp
@@ -7,29 +7,12 @@ hidl_interface {
enabled: true,
},
srcs: [
- "types.hal",
"IInputClassifier.hal",
],
interfaces: [
+ "android.hardware.input.common@1.0",
"android.hidl.base@1.0",
],
- types: [
- "Action",
- "Axis",
- "Button",
- "Classification",
- "EdgeFlag",
- "Flag",
- "Meta",
- "MotionEvent",
- "PointerCoords",
- "PointerProperties",
- "PolicyFlag",
- "Source",
- "SourceClass",
- "ToolType",
- "VideoFrame",
- ],
gen_java: true,
}
diff --git a/input/classifier/1.0/IInputClassifier.hal b/input/classifier/1.0/IInputClassifier.hal
index edc113807..5f8c2a564 100644
--- a/input/classifier/1.0/IInputClassifier.hal
+++ b/input/classifier/1.0/IInputClassifier.hal
@@ -16,6 +16,9 @@
package android.hardware.input.classifier@1.0;
+import android.hardware.input.common@1.0::Classification;
+import android.hardware.input.common@1.0::MotionEvent;
+
interface IInputClassifier {
/**
diff --git a/input/classifier/1.0/default/InputClassifier.cpp b/input/classifier/1.0/default/InputClassifier.cpp
index c463361dc..7005e9d8b 100644
--- a/input/classifier/1.0/default/InputClassifier.cpp
+++ b/input/classifier/1.0/default/InputClassifier.cpp
@@ -21,7 +21,7 @@
#include <log/log.h>
#include <utils/Timers.h>
-using namespace android::hardware::input::classifier::V1_0;
+using namespace android::hardware::input::common::V1_0;
namespace android {
namespace hardware {
diff --git a/input/classifier/1.0/default/InputClassifier.h b/input/classifier/1.0/default/InputClassifier.h
index 0858ecbae..39c4b17b3 100644
--- a/input/classifier/1.0/default/InputClassifier.h
+++ b/input/classifier/1.0/default/InputClassifier.h
@@ -31,8 +31,9 @@ using ::android::hardware::Return;
struct InputClassifier : public IInputClassifier {
// Methods from ::android::hardware::input::classifier::V1_0::IInputClassifier follow.
- Return<Classification> classify(
- const ::android::hardware::input::classifier::V1_0::MotionEvent& event) override;
+
+ Return<android::hardware::input::common::V1_0::Classification> classify(
+ const android::hardware::input::common::V1_0::MotionEvent& event) override;
};
} // namespace implementation
diff --git a/input/common/1.0/Android.bp b/input/common/1.0/Android.bp
new file mode 100644
index 000000000..68a77f13d
--- /dev/null
+++ b/input/common/1.0/Android.bp
@@ -0,0 +1,34 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+ name: "android.hardware.input.common@1.0",
+ root: "android.hardware",
+ vndk: {
+ enabled: true,
+ },
+ srcs: [
+ "types.hal",
+ ],
+ interfaces: [
+ "android.hidl.base@1.0",
+ ],
+ types: [
+ "Action",
+ "Axis",
+ "Button",
+ "Classification",
+ "EdgeFlag",
+ "Flag",
+ "Meta",
+ "MotionEvent",
+ "PointerCoords",
+ "PointerProperties",
+ "PolicyFlag",
+ "Source",
+ "SourceClass",
+ "ToolType",
+ "VideoFrame",
+ ],
+ gen_java: true,
+}
+
diff --git a/input/classifier/1.0/types.hal b/input/common/1.0/types.hal
index 244ecd93b..1a07f3b76 100644
--- a/input/classifier/1.0/types.hal
+++ b/input/common/1.0/types.hal
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package android.hardware.input.classifier@1.0;
+package android.hardware.input.common@1.0;
/**
@@ -435,12 +435,12 @@ struct PointerCoords {
};
enum SourceClass: uint8_t {
- NONE = 1 << 0,
- BUTTON = 1 << 1,
- POINTER = 1 << 2,
- NAVIGATION = 1 << 3,
- POSITION = 1 << 4,
- JOYSTICK = 1 << 5,
+ NONE = 0 << 0,
+ BUTTON = 1 << 0,
+ POINTER = 1 << 1,
+ NAVIGATION = 1 << 2,
+ POSITION = 1 << 3,
+ JOYSTICK = 1 << 4,
};
/**