InputDevice warning fixes and make warnigs into Error
use const char * for string literals in InputDevice
Remove unused variable in Keyboard
Bug: 35993509
Test: mm in frameworks/native/libs/input builds without the warning
Change-Id: I11242835eae855386c47e56d6c36e5a2f912a28f
diff --git a/libs/input/Android.bp b/libs/input/Android.bp
index 9485d5b..9294419 100644
--- a/libs/input/Android.bp
+++ b/libs/input/Android.bp
@@ -17,7 +17,11 @@
cc_library {
name: "libinput",
host_supported: true,
-
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ ],
srcs: [
"Input.cpp",
"InputDevice.cpp",
diff --git a/libs/input/InputDevice.cpp b/libs/input/InputDevice.cpp
index 9d761fd..4287abe 100644
--- a/libs/input/InputDevice.cpp
+++ b/libs/input/InputDevice.cpp
@@ -90,7 +90,7 @@
String8 path;
// Treblized input device config files will be located /odm/usr or /vendor/usr.
- char *rootsForPartition[] {"/odm", "/vendor", getenv("ANDROID_ROOT")};
+ const char *rootsForPartition[] {"/odm", "/vendor", getenv("ANDROID_ROOT")};
for (size_t i = 0; i < size(rootsForPartition); i++) {
path.setTo(rootsForPartition[i]);
path.append("/usr/");
diff --git a/libs/input/Keyboard.cpp b/libs/input/Keyboard.cpp
index 9a01395..07f2289 100644
--- a/libs/input/Keyboard.cpp
+++ b/libs/input/Keyboard.cpp
@@ -208,7 +208,6 @@
}
int32_t updateMetaState(int32_t keyCode, bool down, int32_t oldMetaState) {
- int32_t mask;
switch (keyCode) {
case AKEYCODE_ALT_LEFT:
return setEphemeralMetaState(AMETA_ALT_LEFT_ON, down, oldMetaState);