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

Commit 33e76776 authored by Dimitry Ivanov's avatar Dimitry Ivanov Committed by Gerrit Code Review
Browse files

Merge "Construct classloader for apps with no java code"

parents 90804668 70b6130d
Loading
Loading
Loading
Loading
+116 −115
Original line number Diff line number Diff line
@@ -261,7 +261,15 @@ public final class LoadedApk {
                return mClassLoader;
            }

            if (mIncludeCode && !mPackageName.equals("android")) {
            if (mPackageName.equals("android")) {
                if (mBaseClassLoader == null) {
                    mClassLoader = ClassLoader.getSystemClassLoader();
                } else {
                    mClassLoader = mBaseClassLoader;
                }
                return mClassLoader;
            }

            // Avoid the binder call when the package is the current application package.
            // The activity manager will perform ensure that dexopt is performed before
            // spinning up the process.
@@ -350,7 +358,7 @@ public final class LoadedApk {
                }
            }

                final String zip = TextUtils.join(File.pathSeparator, zipPaths);
            final String zip = mIncludeCode ? TextUtils.join(File.pathSeparator, zipPaths) : "";

            // Add path to libraries in apk for current abi
            if (mApplicationInfo.primaryCpuAbi != null) {
@@ -395,13 +403,6 @@ public final class LoadedApk {
                    librarySearchPath, libraryPermittedPath, mBaseClassLoader);

            StrictMode.setThreadPolicy(oldPolicy);
            } else {
                if (mBaseClassLoader == null) {
                    mClassLoader = ClassLoader.getSystemClassLoader();
                } else {
                    mClassLoader = mBaseClassLoader;
                }
            }
            return mClassLoader;
        }
    }
+2 −1
Original line number Diff line number Diff line
@@ -158,7 +158,8 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback2,
        String path = classLoader.findLibrary(libname);

        if (path == null) {
            throw new IllegalArgumentException("Unable to find native library: " + libname);
            throw new IllegalArgumentException("Unable to find native library " + libname +
                                               " using classloader: " + classLoader.toString());
        }
        
        byte[] nativeSavedState = savedInstanceState != null