Merge "Set threads' contextClassLoader during LoadedApk.makeApplication." into lmp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
20de619d66
@@ -360,7 +360,6 @@ public final class LoadedApk {
|
|||||||
|
|
||||||
mClassLoader = ApplicationLoaders.getDefault().getClassLoader(zip, lib,
|
mClassLoader = ApplicationLoaders.getDefault().getClassLoader(zip, lib,
|
||||||
mBaseClassLoader);
|
mBaseClassLoader);
|
||||||
initializeJavaContextClassLoader();
|
|
||||||
|
|
||||||
StrictMode.setThreadPolicy(oldPolicy);
|
StrictMode.setThreadPolicy(oldPolicy);
|
||||||
} else {
|
} else {
|
||||||
@@ -552,6 +551,9 @@ public final class LoadedApk {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
java.lang.ClassLoader cl = getClassLoader();
|
java.lang.ClassLoader cl = getClassLoader();
|
||||||
|
if (!mPackageName.equals("android")) {
|
||||||
|
initializeJavaContextClassLoader();
|
||||||
|
}
|
||||||
ContextImpl appContext = ContextImpl.createAppContext(mActivityThread, this);
|
ContextImpl appContext = ContextImpl.createAppContext(mActivityThread, this);
|
||||||
app = mActivityThread.mInstrumentation.newApplication(
|
app = mActivityThread.mInstrumentation.newApplication(
|
||||||
cl, appClass, appContext);
|
cl, appClass, appContext);
|
||||||
|
|||||||
Reference in New Issue
Block a user