Build libinputflinger for host
We don't have a usecase for it today, but the main motivation here is to
unify the target and host build parameters.
Also, this exposed an issue where ::write wasn't wrapped.
The host build produced an error:
frameworks/native/services/inputflinger/InputManager.cpp:189:5: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]
::write(fd, dump.c_str(), dump.size());
Bug: 271455682
Test: m libinputflinger
Change-Id: If1abc85b230f8e928422dab4c6bb33834b6393ee
diff --git a/services/inputflinger/Android.bp b/services/inputflinger/Android.bp
index 8f62629..f4aab3b 100644
--- a/services/inputflinger/Android.bp
+++ b/services/inputflinger/Android.bp
@@ -118,6 +118,7 @@
cc_library_shared {
name: "libinputflinger",
+ host_supported: true,
defaults: [
"inputflinger_defaults",
"libinputflinger_defaults",
diff --git a/services/inputflinger/InputManager.cpp b/services/inputflinger/InputManager.cpp
index 1a9f47d..09c88ba 100644
--- a/services/inputflinger/InputManager.cpp
+++ b/services/inputflinger/InputManager.cpp
@@ -186,7 +186,7 @@
dump += " InputFlinger dump\n";
- ::write(fd, dump.c_str(), dump.size());
+ TEMP_FAILURE_RETRY(::write(fd, dump.c_str(), dump.size()));
return NO_ERROR;
}