Use -Werror in frameworks/native/libs/gui and ui
* Remove unused variable and function.
* Suppress warning of unused return results.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: If6f445be1e7677a37bf780844a79b84d6d7e1c1e
diff --git a/libs/ui/Android.bp b/libs/ui/Android.bp
index 28b8ab3..14c0d5c 100644
--- a/libs/ui/Android.bp
+++ b/libs/ui/Android.bp
@@ -20,9 +20,12 @@
},
clang: true,
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
cppflags: [
"-Weverything",
- "-Werror",
// The static constructors and destructors in this library have not been noted to
// introduce significant overheads
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp
index 5b0e7f6..d5a30d7 100644
--- a/libs/ui/GraphicBufferMapper.cpp
+++ b/libs/ui/GraphicBufferMapper.cpp
@@ -125,29 +125,6 @@
return static_cast<status_t>(error);
}
-static inline bool isValidYCbCrPlane(const android_flex_plane_t& plane) {
- if (plane.bits_per_component != 8) {
- ALOGV("Invalid number of bits per component: %d",
- plane.bits_per_component);
- return false;
- }
- if (plane.bits_used != 8) {
- ALOGV("Invalid number of bits used: %d", plane.bits_used);
- return false;
- }
-
- bool hasValidIncrement = plane.h_increment == 1 ||
- (plane.component != FLEX_COMPONENT_Y && plane.h_increment == 2);
- hasValidIncrement = hasValidIncrement && plane.v_increment > 0;
- if (!hasValidIncrement) {
- ALOGV("Invalid increment: h %d v %d", plane.h_increment,
- plane.v_increment);
- return false;
- }
-
- return true;
-}
-
status_t GraphicBufferMapper::lockAsyncYCbCr(buffer_handle_t handle,
uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr, int fenceFd)
{
diff --git a/libs/ui/tests/Android.bp b/libs/ui/tests/Android.bp
index 6733505..08067fc 100644
--- a/libs/ui/tests/Android.bp
+++ b/libs/ui/tests/Android.bp
@@ -18,10 +18,12 @@
name: "Region_test",
shared_libs: ["libui"],
srcs: ["Region_test.cpp"],
+ cflags: ["-Wall", "-Werror"],
}
cc_test {
name: "colorspace_test",
shared_libs: ["libui"],
srcs: ["colorspace_test.cpp"],
+ cflags: ["-Wall", "-Werror"],
}