Rewrite android SDK jar build rules.

Android P splits some of the old android.test.* classes into what it
calls "legacy testing libraries." These need to interact with our build
system like the main android.jar does. That jar previously interacted
with the build system as a special case, though; this CL generalizes
it.

Bug: 841695
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ie6a61bdafbf4990e6f82d9431ae8d7c2fd6ba709
Reviewed-on: https://chromium-review.googlesource.com/1102915
Commit-Queue: John Budorick <[email protected]>
Reviewed-by: Helen Li <[email protected]>
Reviewed-by: Tommy Nyquist <[email protected]>
Reviewed-by: Bo <[email protected]>
Reviewed-by: agrieve <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#569291}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9bf7501b7d1d62985aac69c766bbef6960b4d8b5
diff --git a/android/gyp/prepare_resources.py b/android/gyp/prepare_resources.py
index b6a4ff4..38bcc32 100755
--- a/android/gyp/prepare_resources.py
+++ b/android/gyp/prepare_resources.py
@@ -131,7 +131,11 @@
                      '--no-crunch',
                      '--auto-add-overlay',
                      '--no-version-vectors',
-                     '-I', options.android_sdk_jar,
+                    ]
+  for j in options.android_sdk_jars:
+    package_command += ['-I', j]
+
+  package_command += [
                      '--output-text-symbols', gen_dir,
                      '-J', gen_dir,  # Required for R.txt generation.
                      '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN]
@@ -255,8 +259,8 @@
   possible_input_paths = [
     options.aapt_path,
     options.android_manifest,
-    options.android_sdk_jar,
   ]
+  possible_input_paths += options.android_sdk_jars
   input_paths = [x for x in possible_input_paths if x]
   input_paths.extend(options.dependencies_res_zips)
   input_paths.extend(options.extra_r_text_files)