From 347f2884dbb29efd9b996bbd7ae7ca7996eb5f08 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 13 Nov 2014 14:31:11 -0800 Subject: [PATCH] Frameworks/native: Wall Werror in batteryservice & powermanager Turn on -Wall -Werror in services/batteryservice and services/powermanager. Fix warnings. Change-Id: I1da667083013379cd8240377c48d63fa5c53033d --- services/batteryservice/Android.mk | 14 ++++++++------ .../batteryservice/IBatteryPropertiesListener.cpp | 2 +- services/powermanager/Android.mk | 8 +++++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/services/batteryservice/Android.mk b/services/batteryservice/Android.mk index 9354b99ae..e4097d710 100644 --- a/services/batteryservice/Android.mk +++ b/services/batteryservice/Android.mk @@ -2,17 +2,19 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ - BatteryProperties.cpp \ - BatteryProperty.cpp \ - IBatteryPropertiesListener.cpp \ - IBatteryPropertiesRegistrar.cpp + BatteryProperties.cpp \ + BatteryProperty.cpp \ + IBatteryPropertiesListener.cpp \ + IBatteryPropertiesRegistrar.cpp LOCAL_STATIC_LIBRARIES := \ - libutils \ - libbinder + libutils \ + libbinder LOCAL_MODULE:= libbatteryservice LOCAL_MODULE_TAGS := optional +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code + include $(BUILD_STATIC_LIBRARY) diff --git a/services/batteryservice/IBatteryPropertiesListener.cpp b/services/batteryservice/IBatteryPropertiesListener.cpp index 19ac7f0ec..8aff26c4c 100644 --- a/services/batteryservice/IBatteryPropertiesListener.cpp +++ b/services/batteryservice/IBatteryPropertiesListener.cpp @@ -35,7 +35,7 @@ public: data.writeInterfaceToken(IBatteryPropertiesListener::getInterfaceDescriptor()); data.writeInt32(1); props.writeToParcel(&data); - status_t err = remote()->transact(TRANSACT_BATTERYPROPERTIESCHANGED, data, &reply, IBinder::FLAG_ONEWAY); + remote()->transact(TRANSACT_BATTERYPROPERTIESCHANGED, data, &reply, IBinder::FLAG_ONEWAY); } }; diff --git a/services/powermanager/Android.mk b/services/powermanager/Android.mk index d98b2dafd..7b24c6555 100644 --- a/services/powermanager/Android.mk +++ b/services/powermanager/Android.mk @@ -2,14 +2,16 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ - IPowerManager.cpp + IPowerManager.cpp LOCAL_SHARED_LIBRARIES := \ - libutils \ - libbinder + libutils \ + libbinder LOCAL_MODULE:= libpowermanager LOCAL_MODULE_TAGS := optional +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code + include $(BUILD_SHARED_LIBRARY)