Android: Link against apk_under_test resources for test apks

Test apks are allowed to reference resources that live in the apk_under_test.
We've previous supported such references via R.java constants, but this
CL also adds the ability for resources in the test apk to directly
reference resources in the apk_under_test (e.g. via xml @references).

The need for this has come with the latest version of the support
library.

To accomplish this:
1. Adds a "-I UnderTest.ap_" flag when compiling test apks resources
2. Sets the test apk's arsc package name to match the apk_under_test's
   package name.
3. Uses --emit-ids / --stable-ids to avoid collisions between the
   test apk and the apk_under_test.
4. Updates incremental install manifest logic to do the same trick.

Some other small tweaks to related resource code:
* Removes incremental AndroidManifest.xml as an explicit build output
* Moves most uses of "aapt dump" to "aapt2 dump"
* Removes --check-resources-pkg-id in favor of always enabling it
* Removes --optimize-resources in favor of having it implicitly set by
  --optimized-resources-path

Bug: 896775
Change-Id: I6ea2d1ec8d1109bede4e0701eb4c7aeaa2a67503
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1556395
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Eric Stevenson <estevenson@chromium.org>
Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#650427}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a00b988e2c770bfb0e053a2cf91ee6d854495ae0
2 files changed