summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chih-Hung Hsieh <chh@google.com> 2017-10-05 13:55:31 -0700
committer Chih-Hung Hsieh <chh@google.com> 2017-10-05 13:55:37 -0700
commita50a467030fbf6527e5e052b4c981cad85bc5de4 (patch)
treed74ed28d62ba468730c5053c7be50b216a9bec80
parent0c47ec9a824963f42640927b8d0a237bf8ce2ea7 (diff)
Use -Werror in frameworks/native/services/inputflinger
* Fix/suppress unused-* warnings. Bug: 66996870 Test: build with WITH_TIDY=1 Change-Id: If1dd59ea4ee8ce51f7b58ae4581531df301c68a8
-rw-r--r--services/inputflinger/Android.bp3
-rw-r--r--services/inputflinger/EventHub.cpp6
-rw-r--r--services/inputflinger/InputDispatcher.cpp2
-rw-r--r--services/inputflinger/host/Android.bp4
-rw-r--r--services/inputflinger/tests/Android.bp6
5 files changed, 12 insertions, 9 deletions
diff --git a/services/inputflinger/Android.bp b/services/inputflinger/Android.bp
index 4fd98e2a7e..238cba362c 100644
--- a/services/inputflinger/Android.bp
+++ b/services/inputflinger/Android.bp
@@ -37,6 +37,9 @@ cc_library_shared {
],
cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
"-Wno-unused-parameter",
// TODO: Move inputflinger to its own process and mark it hidden
//-fvisibility=hidden
diff --git a/services/inputflinger/EventHub.cpp b/services/inputflinger/EventHub.cpp
index d2f89959e1..2348d92621 100644
--- a/services/inputflinger/EventHub.cpp
+++ b/services/inputflinger/EventHub.cpp
@@ -69,12 +69,6 @@ namespace android {
static const char *WAKE_LOCK_ID = "KeyEvents";
static const char *DEVICE_PATH = "/dev/input";
-/* return the larger integer */
-static inline int max(int v1, int v2)
-{
- return (v1 > v2) ? v1 : v2;
-}
-
static inline const char* toString(bool value) {
return value ? "true" : "false";
}
diff --git a/services/inputflinger/InputDispatcher.cpp b/services/inputflinger/InputDispatcher.cpp
index 2efb340eba..043d157c7d 100644
--- a/services/inputflinger/InputDispatcher.cpp
+++ b/services/inputflinger/InputDispatcher.cpp
@@ -1135,8 +1135,6 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime,
INJECTION_PERMISSION_DENIED
};
- nsecs_t startTime = now();
-
// For security reasons, we defer updating the touch state until we are sure that
// event injection will be allowed.
int32_t displayId = entry->displayId;
diff --git a/services/inputflinger/host/Android.bp b/services/inputflinger/host/Android.bp
index b8e9bce4bd..775dbdc658 100644
--- a/services/inputflinger/host/Android.bp
+++ b/services/inputflinger/host/Android.bp
@@ -32,6 +32,8 @@ cc_library_shared {
],
cflags: [
+ "-Wall",
+ "-Werror",
"-Wno-unused-parameter",
// TODO: Move inputflinger to its own process and mark it hidden
//-fvisibility=hidden
@@ -47,6 +49,8 @@ cc_binary {
srcs: ["main.cpp"],
+ cflags: ["-Wall", "-Werror"],
+
shared_libs: [
"libbinder",
"libinputflingerhost",
diff --git a/services/inputflinger/tests/Android.bp b/services/inputflinger/tests/Android.bp
index 29d93f034b..a49c8c84c7 100644
--- a/services/inputflinger/tests/Android.bp
+++ b/services/inputflinger/tests/Android.bp
@@ -7,7 +7,11 @@ cc_test {
"InputDispatcher_test.cpp",
],
test_per_src: true,
- cflags: ["-Wno-unused-parameter"],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
shared_libs = [
"libcutils",
"liblog",