Revert "[build] Cleanup for specifying [min|target|max]SdkVersion in GN"

This reverts commit 07f70727879b890bcdb8183036e895de375ca695.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 671446 as the
culprit for failures in the build cycles as shown on:
https://analysis.chromium.org/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtLzA3ZjcwNzI3ODc5Yjg5MGJjZGI4MTgzMDM2ZTg5NWRlMzc1Y2E2OTUM

Sample Failed Build: https://ci.chromium.org/buildbot/chromium/android-archive-rel/1542

Sample Failed Step: compile

Original change's description:
> [build] Cleanup for specifying [min|target|max]SdkVersion in GN
> 
> crrev/c/1650265 enforced setting [min|target|max]SdkVersion in GN.
> However, this is to strict for some dependencies, e.g. WebRTC.
> Therefore, relax rules so that you can specify the SDK versions in both
> GN and the AndroidManifest.xml. And the build system will assert that
> these values match.
> 
> + Update some SDK versions that had been changed inadvertently in
>   crrev/c/1650265.
> 
> TBR=tedchoc@chromium.org,torne@chromium.org
> 
> Bug: 891996
> Bug: 977417
> Bug: 977328
> Change-Id: I89b944c1f73a35ba8fcdafdf4bdf62508759811e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660361
> Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Reviewed-by: Yusuf Ozuysal <yusufo@chromium.org>
> Reviewed-by: Eric Stevenson <estevenson@chromium.org>
> Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org>
> Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#671446}


Change-Id: I06e05d04cf5e8cbc4c663bd6a5ebfda1ba0b2b3c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 977328
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1672178
Cr-Original-Commit-Position: refs/heads/master@{#671461}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 92e53a6ae0cee9a38f96eb1926cccfa4027db9d4
diff --git a/android/internal_rules.gni b/android/internal_rules.gni
index fb0de83..9557296 100644
--- a/android/internal_rules.gni
+++ b/android/internal_rules.gni
@@ -810,10 +810,6 @@
   android_default_aapt_path = "$android_sdk_build_tools/aapt"
 
   template("android_lint") {
-    _min_sdk_version = 19
-    if (defined(invoker.min_sdk_version)) {
-      _min_sdk_version = invoker.min_sdk_version
-    }
     action_with_pydeps(target_name) {
       forward_variables_from(invoker,
                              [
@@ -873,7 +869,6 @@
         "--result-path",
         rebase_path(_result_path, root_build_dir),
         "--include-unexpected-failures",
-        "--min-sdk-version=$_min_sdk_version",
       ]
       if (defined(invoker.android_manifest)) {
         inputs += [ invoker.android_manifest ]
@@ -888,7 +883,10 @@
       }
 
       if (defined(invoker.create_cache) && invoker.create_cache) {
-        args += [ "--silent" ]
+        args += [
+          "--create-cache",
+          "--silent",
+        ]
       } else {
         inputs += invoker.java_files
         inputs += [ invoker.build_config ]
@@ -913,6 +911,10 @@
           ]
         }
       }
+
+      if (defined(invoker.min_sdk_version)) {
+        args += [ "--min-sdk-version=${invoker.min_sdk_version}" ]
+      }
     }
   }
 
@@ -1760,6 +1762,12 @@
         "--min-sdk-version=${invoker.min_sdk_version}",
         "--target-sdk-version=${invoker.target_sdk_version}",
       ]
+
+      # TODO(crbug.com/891996): Only activate for non-Chromium code once
+      # downstream has been updated.
+      if ((defined(invoker.chromium_code) && !invoker.chromium_code) || true) {
+        args += [ "--allow-uses-sdk" ]
+      }
     }
   }
 
diff --git a/android/rules.gni b/android/rules.gni
index fa5bf33..f74548e 100644
--- a/android/rules.gni
+++ b/android/rules.gni
@@ -2321,6 +2321,7 @@
         "$target_gen_dir/${_template_name}_manifest/AndroidManifest.xml"
     _merge_manifest_target = "${_template_name}__merge_manifests"
     merge_manifests(_merge_manifest_target) {
+      forward_variables_from(invoker, [ "chromium_code" ])
       input_manifest = _android_root_manifest
       output_manifest = _android_manifest
       build_config = _build_config