platform_build_soong/dexpreopt
Ulya Trafimovich 18554243de Add nested class loader subcontext at the proper hierarchy level.
When adding a subcontext in a class loader context tree, there are two
possible cases: 1) the root of the subcontext is itself a <uses-library>
and should be present as a node in the tree, or 2) the root is not a
<uses-library>, but some of its dependencies are -- in that case they
should be disconnected from the root, and the resulting forrest should
be added at the top-level.

Example:

  1) C is a <uses-library>:

     A
     ├── B
     └── C
         ├── D
         └── E
             └── F

  2) C is not a <uses-library>:

     A
     ├── B
     ├── D
     └── E
         └── F

Before the patch subcontexts for transitive dependencies were added
before the subcontext for the direct dependency (even if it was a
<uses-library>, resulting in case-2 hierarchy when case-1 should have
been used. Previosuly this didn't matter because class loader context
was a flat set of libraries, but now it matters because class loader
context is a tree.

This patch changes the order in which libraries are added, so that
direct dependencies are added before transitive ones. The context adding
method now accepts an "implicit root" parameter, so that when adding
transitive dependencies it can check if the corresponding direct
dependency is a <uses-library> and already present in the context.

Partially constructed class loader context is now propagated top-down
into aapt.buildActions, so that the method can use existing part of the
context to decide where the missing part should be connected.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: I649aff9e27494306885a4f4fc90226c399636b57
2020-11-16 14:57:05 +00:00
..
dexpreopt_gen Fix bpfmt issues and add bpfmt to preupload checks 2020-06-29 09:14:08 +02:00
Android.bp Add unit tests for class loader context. 2020-10-29 17:47:34 +00:00
class_loader_context.go Add nested class loader subcontext at the proper hierarchy level. 2020-11-16 14:57:05 +00:00
class_loader_context_test.go Add nested class loader subcontext at the proper hierarchy level. 2020-11-16 14:57:05 +00:00
config.go Rework class loader context implementation. 2020-11-03 15:15:46 +00:00
dexpreopt.go Rework class loader context implementation. 2020-11-03 15:15:46 +00:00
dexpreopt_test.go Rework class loader context implementation. 2020-11-03 15:15:46 +00:00
OWNERS Add an owners file for dexpreopt files. 2018-12-18 20:28:06 +00:00
testing.go Reland: Get the dex2oat host tool path from module dependency on the 2020-02-13 17:46:48 +00:00