Correctly handle shared class loaders
- The requested parent or shared class loaders might not be the
the actual class loader, hence cache the requested class loader instead.
Before this change using a shared class loader and proxying classes that
are not loaded by the DexClassLoader (and thereby cannot be shared) caused
the caching not to work properly.
- If a parent class loader is set, the shared class loader is ignored.
Hence do not set the parent class loader when using shared class
loaders. This behavior was broken for some time but people did not
notice as we very rarely use more than one non-boot-class class
loader.
Bug: 72571446
Test: - atest SystemUISharedLibTests (sets the shared_classloader
property)
- frameworks/opt/net/wifi/tests/wifitests/runtests.sh (discovered
the missing caching of the proxies)
- atest CtsMockingDebuggableTestCases
CtsMockingTestCases
CtsExtendedMockingTestCases
CtsInlineMockingTestCases
Change-Id: I33c12311cb17366b936f4716c1bf89a5d2e18074
Loading
Please sign in to comment