Revert "Make javac warnings errors for WebRTC targets."

This reverts commit 19b761403c3522902d69d61179f4d184e3632f79.

Reason for revert: Breaking internal builds

Original change's description:
> Make javac warnings errors for WebRTC targets.
> 
> Adds new rtc_* templates for Android targets to allow specifying
> default values that affect WebRTC targets.
> 
> Bug: webrtc:6597
> Change-Id: Ie529bfc8500d1e785b8a59dba7078b5f88ccfcd1
> Reviewed-on: https://webrtc-review.googlesource.com/15103
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20567}

TBR=phoglund@webrtc.org,sakal@webrtc.org

Change-Id: I6d3ff5604b3d4307765d3a65adb783f89fcc974c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:6597
Reviewed-on: https://webrtc-review.googlesource.com/20740
Reviewed-by: Lu Liu <lliuu@webrtc.org>
Commit-Queue: Lu Liu <lliuu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20571}
diff --git a/examples/BUILD.gn b/examples/BUILD.gn
index 01d73a4..c5bc83f 100644
--- a/examples/BUILD.gn
+++ b/examples/BUILD.gn
@@ -49,7 +49,7 @@
 }
 
 if (is_android) {
-  rtc_android_apk("AppRTCMobile") {
+  android_apk("AppRTCMobile") {
     testonly = true
     apk_name = "AppRTCMobile"
     android_manifest = "androidapp/AndroidManifest.xml"
@@ -62,9 +62,12 @@
     ]
 
     shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
+
+    # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+    no_build_hooks = true
   }
 
-  rtc_android_library("AppRTCMobile_javalib") {
+  android_library("AppRTCMobile_javalib") {
     testonly = true
     android_manifest = "androidapp/AndroidManifest.xml"
 
@@ -100,6 +103,9 @@
       "../sdk/android:libjingle_peerconnection_metrics_default_java",
       "androidapp/third_party/autobanh:autobanh_java",
     ]
+
+    # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+    no_build_hooks = true
   }
 
   android_resources("AppRTCMobile_resources") {
@@ -108,7 +114,7 @@
     custom_package = "org.appspot.apprtc"
   }
 
-  rtc_instrumentation_test_apk("AppRTCMobileTest") {
+  instrumentation_test_apk("AppRTCMobileTest") {
     apk_name = "AppRTCMobileTest"
     android_manifest = "androidtests/AndroidManifest.xml"
 
@@ -122,9 +128,12 @@
       "//third_party/android_support_test_runner:runner_java",
       "//third_party/junit",
     ]
+
+    # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+    no_build_hooks = true
   }
 
-  rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
+  instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
     apk_name = "AppRTCMobileTestStubbedVideoIO"
     android_manifest = "androidtests/AndroidManifest.xml"
 
@@ -145,6 +154,9 @@
     data = [
       "../resources/reference_video_640x360_30fps.y4m",
     ]
+
+    # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+    no_build_hooks = true
   }
 }
 
@@ -664,7 +676,7 @@
 }
 
 if (is_android) {
-  rtc_android_library("webrtc_unity_java") {
+  android_library("webrtc_unity_java") {
     java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
     deps = [
       "../rtc_base:base_java",
diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn
index 8f6f746..e50041f 100644
--- a/modules/audio_device/BUILD.gn
+++ b/modules/audio_device/BUILD.gn
@@ -368,7 +368,7 @@
 }
 
 if (!build_with_chromium && is_android) {
-  rtc_android_library("audio_device_java") {
+  android_library("audio_device_java") {
     java_files = [
       "android/java/src/org/webrtc/voiceengine/BuildInfo.java",
       "android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java",
@@ -380,5 +380,8 @@
     deps = [
       "../../rtc_base:base_java",
     ]
+
+    # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+    no_build_hooks = true
   }
 }
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index bc9b929..400efb6 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -1089,12 +1089,15 @@
 }
 
 if (is_android) {
-  rtc_android_library("base_java") {
+  android_library("base_java") {
     java_files = [
       "java/src/org/webrtc/ContextUtils.java",
       "java/src/org/webrtc/Logging.java",
       "java/src/org/webrtc/Size.java",
       "java/src/org/webrtc/ThreadUtils.java",
     ]
+
+    # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+    no_build_hooks = true
   }
 }
diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn
index c368d12..f30c7ae 100644
--- a/sdk/android/BUILD.gn
+++ b/sdk/android/BUILD.gn
@@ -385,7 +385,7 @@
   ]
 }
 
-rtc_android_library("libjingle_peerconnection_java") {
+android_library("libjingle_peerconnection_java") {
   java_files = [
     "api/org/webrtc/AudioProcessingFactory.java",
     "api/org/webrtc/AudioSource.java",
@@ -488,18 +488,24 @@
     "../../modules/audio_device:audio_device_java",
     "../../rtc_base:base_java",
   ]
+
+  # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+  no_build_hooks = true
 }
 
-rtc_android_library("libjingle_peerconnection_metrics_default_java") {
+android_library("libjingle_peerconnection_metrics_default_java") {
   java_files = [ "api/org/webrtc/Metrics.java" ]
 
   deps = [
     "../../rtc_base:base_java",
   ]
+
+  # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+  no_build_hooks = true
 }
 
 if (rtc_include_tests) {
-  rtc_instrumentation_test_apk("libjingle_peerconnection_android_unittest") {
+  instrumentation_test_apk("libjingle_peerconnection_android_unittest") {
     apk_name = "libjingle_peerconnection_android_unittest"
     android_manifest = "instrumentationtests/AndroidManifest.xml"
 
@@ -541,5 +547,8 @@
     ]
 
     shared_libraries = [ "../../sdk/android:libjingle_peerconnection_so" ]
+
+    # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+    no_build_hooks = true
   }
 }
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 7277e6b..78a734d 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -710,7 +710,7 @@
 }
 
 if (!build_with_chromium && is_android) {
-  rtc_android_library("native_test_java") {
+  android_library("native_test_java") {
     testonly = true
     java_files = [
       "android/org/webrtc/native_test/RTCNativeUnitTest.java",
@@ -720,5 +720,8 @@
       "../rtc_base:base_java",
       "//testing/android/native_test:native_test_java",
     ]
+
+    # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
+    no_build_hooks = true
   }
 }
diff --git a/webrtc.gni b/webrtc.gni
index 3b504e8..a4b7c18 100644
--- a/webrtc.gni
+++ b/webrtc.gni
@@ -398,62 +398,3 @@
     }
   }
 }
-
-if (is_android) {
-  template("rtc_android_library") {
-    android_library(target_name) {
-      forward_variables_from(invoker,
-                             "*",
-                             [
-                               "configs",
-                               "public_configs",
-                               "suppressed_configs",
-                               "visibility",
-                             ])
-
-      # Treat warnings as errors.
-      javac_args = [ "-Werror" ]
-
-      # TODO(sakal): Fix build hooks crbug.com/webrtc/8168
-      no_build_hooks = true
-    }
-  }
-
-  template("rtc_android_apk") {
-    android_apk(target_name) {
-      forward_variables_from(invoker,
-                             "*",
-                             [
-                               "configs",
-                               "public_configs",
-                               "suppressed_configs",
-                               "visibility",
-                             ])
-
-      # Treat warnings as errors.
-      javac_args = [ "-Werror" ]
-
-      # TODO(sakal): Fix build hooks crbug.com/webrtc/8168
-      no_build_hooks = true
-    }
-  }
-
-  template("rtc_instrumentation_test_apk") {
-    instrumentation_test_apk(target_name) {
-      forward_variables_from(invoker,
-                             "*",
-                             [
-                               "configs",
-                               "public_configs",
-                               "suppressed_configs",
-                               "visibility",
-                             ])
-
-      # Treat warnings as errors.
-      javac_args = [ "-Werror" ]
-
-      # TODO(sakal): Fix build hooks crbug.com/webrtc/8168
-      no_build_hooks = true
-    }
-  }
-}