Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c28d1c74 authored by Nan Wu's avatar Nan Wu
Browse files

Fix LazyValue ClassLoader issue

LazyValue's class loader is set when the bundle that contains it
is first unparceled. This is when the LazyValue object is created.
But between when the container bundle is unparceled and when the
LazyValue is unparceled (LazyValue.apply() is called), the bundle's
ClassLoader could have changed. LazyValue unparcel should use the
new ClassLoader.

To fix this issue, replace the ClassLoader member of the LazyValue
with a ClassLoaderProvider, which could simply point back to the
containe bundle as the ClassLoaderProvider. Thus, updates of the
ClassLoader of the container bundle is always effective when the
LazyValue.apply is called.

Also, when a bundle is retrieved from a bundle, the parent's
classLoader needs to be set to the child. This is because if a
bundle contains another nested bundle, when the top level bundle
is unparceled, the nested bundle's classLoader is set as the same
as the top level bundle's

Bug: 382633789
Test: manual test
Flag: EXEMPT bug fix
Change-Id: Id775366506d101b618b214837df1a61f1db380d7
parent f22a6ea2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment