@@ -261,6 +261,7 @@ public ClassLoader getClassLoader() {
261261
262262 if (mIncludeCode && !mPackageName .equals ("android" )) {
263263 String zip = mAppDir ;
264+ String libraryPath = mLibDir ;
264265
265266 /*
266267 * The following is a bit of a hack to inject
@@ -273,15 +274,20 @@ public ClassLoader getClassLoader() {
273274
274275 String instrumentationAppDir =
275276 mActivityThread .mInstrumentationAppDir ;
277+ String instrumentationAppLibraryDir =
278+ mActivityThread .mInstrumentationAppLibraryDir ;
276279 String instrumentationAppPackage =
277280 mActivityThread .mInstrumentationAppPackage ;
278281 String instrumentedAppDir =
279282 mActivityThread .mInstrumentedAppDir ;
283+ String instrumentedAppLibraryDir =
284+ mActivityThread .mInstrumentedAppLibraryDir ;
280285 String [] instrumentationLibs = null ;
281286
282287 if (mAppDir .equals (instrumentationAppDir )
283288 || mAppDir .equals (instrumentedAppDir )) {
284289 zip = instrumentationAppDir + ":" + instrumentedAppDir ;
290+ libraryPath = instrumentationAppLibraryDir + ":" + instrumentedAppLibraryDir ;
285291 if (! instrumentedAppDir .equals (instrumentationAppDir )) {
286292 instrumentationLibs =
287293 getLibrariesFor (instrumentationAppPackage );
@@ -301,15 +307,15 @@ public ClassLoader getClassLoader() {
301307 */
302308
303309 if (ActivityThread .localLOGV )
304- Slog .v (ActivityThread .TAG , "Class path: " + zip + ", JNI path: " + mLibDir );
310+ Slog .v (ActivityThread .TAG , "Class path: " + zip + ", JNI path: " + libraryPath );
305311
306312 // Temporarily disable logging of disk reads on the Looper thread
307313 // as this is early and necessary.
308314 StrictMode .ThreadPolicy oldPolicy = StrictMode .allowThreadDiskReads ();
309315
310316 mClassLoader =
311317 ApplicationLoaders .getDefault ().getClassLoader (
312- zip , mLibDir , mBaseClassLoader );
318+ zip , libraryPath , mBaseClassLoader );
313319 initializeJavaContextClassLoader ();
314320
315321 StrictMode .setThreadPolicy (oldPolicy );
@@ -442,6 +448,10 @@ public String getAppDir() {
442448 return mAppDir ;
443449 }
444450
451+ public String getLibDir () {
452+ return mLibDir ;
453+ }
454+
445455 public String getResDir () {
446456 return mResDir ;
447457 }
0 commit comments