Run some inputflinger_tests on host
Sometimes, it's convenient to execute the input tests without having a
connected device. This is especially useful when doing cherry-picks of
patch on a cloud device.
Allow input code to build for host, and enable the tests for running on
host.
Bug: 249591924
Test: atest --host --no-bazel-mode -c -m inputflinger_tests
Change-Id: Ib9be6a5fb6c35ffc450e41cb2a5688bfb2c8d01a
diff --git a/services/inputflinger/dispatcher/Android.bp b/services/inputflinger/dispatcher/Android.bp
index eb79b76..99c4936 100644
--- a/services/inputflinger/dispatcher/Android.bp
+++ b/services/inputflinger/dispatcher/Android.bp
@@ -23,6 +23,7 @@
cc_library_headers {
name: "libinputdispatcher_headers",
+ host_supported: true,
export_include_dirs: [
"include",
],
@@ -33,6 +34,7 @@
srcs: [
"AnrTracker.cpp",
"Connection.cpp",
+ "DragState.cpp",
"Entry.cpp",
"FocusResolver.cpp",
"InjectionState.cpp",
@@ -45,7 +47,6 @@
"LatencyTracker.cpp",
"Monitor.cpp",
"TouchState.cpp",
- "DragState.cpp",
],
}
@@ -56,20 +57,34 @@
"libbase",
"libcrypto",
"libcutils",
- "libinput",
"libkll",
"liblog",
"libprotobuf-cpp-lite",
"libstatslog",
- "libstatspull",
- "libstatssocket",
- "libgui",
"libutils",
"server_configurable_flags",
],
static_libs: [
"libattestation",
+ "libgui_window_info_static",
],
+ target: {
+ android: {
+ shared_libs: [
+ "libgui",
+ "libinput",
+ "libstatspull",
+ "libstatssocket",
+ ],
+ },
+ host: {
+ static_libs: [
+ "libinput",
+ "libstatspull",
+ "libstatssocket",
+ ],
+ },
+ },
header_libs: [
"libinputdispatcher_headers",
],
@@ -84,8 +99,8 @@
shared_libs: [
// This should consist only of dependencies from inputflinger. Other dependencies should be
// in cc_defaults so that they are included in the tests.
- "libinputreporter",
"libinputflinger_base",
+ "libinputreporter",
],
export_header_lib_headers: [
"libinputdispatcher_headers",