Fix the last warnings in frameworks/av/ drm code.
- index is always positive so no need to check > 0
- args parameters are unused.
Bug: 27151704
Change-Id: Ia4c23e1fc4eaef47f38526574b35ccfea9c92177
diff --git a/drm/drmserver/Android.mk b/drm/drmserver/Android.mk
index 9b15f93..3b8bb04 100644
--- a/drm/drmserver/Android.mk
+++ b/drm/drmserver/Android.mk
@@ -36,6 +36,8 @@
$(TOP)/frameworks/av/drm/libdrmframework/include \
$(TOP)/frameworks/av/drm/libdrmframework/plugins/common/include
+LOCAL_CFLAGS += -Wall -Wextra -Werror
+
LOCAL_MODULE:= drmserver
LOCAL_MODULE_TAGS := optional
diff --git a/drm/drmserver/DrmManagerService.cpp b/drm/drmserver/DrmManagerService.cpp
index 857d73e..814ffcc 100644
--- a/drm/drmserver/DrmManagerService.cpp
+++ b/drm/drmserver/DrmManagerService.cpp
@@ -51,8 +51,7 @@
const char *DrmManagerService::get_perm_label(drm_perm_t perm) {
unsigned int index = perm;
- if (index < 0 ||
- index >= (sizeof(drm_perm_labels) / sizeof(drm_perm_labels[0]))) {
+ if (index >= (sizeof(drm_perm_labels) / sizeof(drm_perm_labels[0]))) {
ALOGE("SELinux: Failed to retrieve permission label(perm=%d).\n", perm);
abort();
}
@@ -338,7 +337,7 @@
return mDrmManager->pread(uniqueId, decryptHandle, buffer, numBytes, offset);
}
-status_t DrmManagerService::dump(int fd, const Vector<String16>& args)
+status_t DrmManagerService::dump(int fd, const Vector<String16>& /* args */)
{
const size_t SIZE = 256;
char buffer[SIZE];
diff --git a/services/mediadrm/Android.mk b/services/mediadrm/Android.mk
index cc78361..f6ddf94 100644
--- a/services/mediadrm/Android.mk
+++ b/services/mediadrm/Android.mk
@@ -34,6 +34,8 @@
LOCAL_C_INCLUDES := \
frameworks/av/media/libmediaplayerservice \
+LOCAL_CFLAGS += -Wall -Wextra -Werror
+
LOCAL_MODULE:= mediadrmserver
LOCAL_32_BIT_ONLY := true
diff --git a/services/mediadrm/main_mediadrmserver.cpp b/services/mediadrm/main_mediadrmserver.cpp
index 4d0b644..b767b8c 100644
--- a/services/mediadrm/main_mediadrmserver.cpp
+++ b/services/mediadrm/main_mediadrmserver.cpp
@@ -30,7 +30,7 @@
using namespace android;
-int main(int argc __unused, char** argv)
+int main()
{
signal(SIGPIPE, SIG_IGN);