summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorDan Zimmerman <danzimm@fb.com>2019-12-23 13:18:14 -0800
committerDan Zimmerman <danzimm@fb.com>2020-02-13 04:31:55 -0800
commita05766e507265c411340bb306200f30fcccb9875 (patch)
tree84b42de74f5ab8c7e60b417e160cd57b66a41550 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent3fa7b28384da29e805666b9076390b274ba1d8a5 (diff)
[DexLoadReporter] Report classloader contexts directly from classloader
At the moment classloader contexts are incorrectly computed in the PackageManager for secondary dex files. There are two issues: (1) The wrong computed classLoaderContext will be reported for a secondary dex file if it was loaded at the same time as a primary dex file - This is due to the continue statement that doesn't increment dexPathIndex (2) If a secondary dex file was loaded with a shared library then that shared library info isn't passed through the dex load reporting infrastructure, and thus its classloader context is incorrectly computed in PackageManager. In order to fix the issues described above & prevent further classloader context computation divergences between the package manager and the runtime, lets compute the classloader context in the runtime at dex load time and report the expected classloader context directly to DexLoadReporter (and thus the package manager). Notes: This is mostly just a refactor (i.e. there are a lot of line changes, but functionally speaking this set of CLs doesn't do much except change where the classloader context is computed) Addendum: The bugs described above could also be fixed by: - changing DexLoadReporter to report information about shared libraries that the reported classloaders depend on to PackageManager - Teach DexoptUtils.processContextForDexLoad about shared libraries - Fix dexPathIndex calculation in DexManager I opted for this set of changes instead because this reduces the possibility of context computation divergence between the framework and the runtime. Additionally it feels more "solid" that the classloader context is now computed directly when a dex file is loaded, rather than the context recreated later on in the PackageManager. Test: atest com.android.server.pm.dex.DexManagerTests Test: atest com.android.server.pm.PackageManagerServiceTest Test: Install app depending on shared library & uses secondary dex files; adb shell pm bg-dexopt-job; launch app and see odex file successfully loaded (from smaps/no logcat errors) Bug: 148494302 Change-Id: I00357cfe086ff149f92c1078c6df6daa713c8f7c
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions