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