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

Commit 45fedeb6 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-36fe639f-9404-4c33-86fb-47bc4ab2221f-for-git_oc-mr1-release-41...

release-request-36fe639f-9404-4c33-86fb-47bc4ab2221f-for-git_oc-mr1-release-4124666 snap-temp-L64200000076596327

Change-Id: I3892f74b253469146f89e6abe3a3d32dae00d376
parents 48f23620 ff093145
Loading
Loading
Loading
Loading
+341 −87

File changed.

Preview size limit exceeded, changes collapsed.

+341 −87

File changed.

Preview size limit exceeded, changes collapsed.

+341 −87

File changed.

Preview size limit exceeded, changes collapsed.

+23 −0
Original line number Diff line number Diff line
@@ -455,6 +455,7 @@ public final class LoadedApk {
                if (!outZipPaths.contains(lib)) {
                    outZipPaths.add(index, lib);
                    index++;
                    appendApkLibPathIfNeeded(lib, aInfo, outLibPaths);
                }
            }
        }
@@ -463,11 +464,33 @@ public final class LoadedApk {
            for (String lib : instrumentationLibs) {
                if (!outZipPaths.contains(lib)) {
                    outZipPaths.add(0, lib);
                    appendApkLibPathIfNeeded(lib, aInfo, outLibPaths);
                }
            }
        }
    }

    /**
     * This method appends a path to the appropriate native library folder of a
     * library if this library is hosted in an APK. This allows support for native
     * shared libraries. The library API is determined based on the application
     * ABI.
     *
     * @param path Path to the library.
     * @param applicationInfo The application depending on the library.
     * @param outLibPaths List to which to add the native lib path if needed.
     */
    private static void appendApkLibPathIfNeeded(@NonNull String path,
            @NonNull ApplicationInfo applicationInfo, @Nullable List<String> outLibPaths) {
        // Looking at the suffix is a little hacky but a safe and simple solution.
        // We will be revisiting code in the next release and clean this up.
        if (outLibPaths != null && applicationInfo.primaryCpuAbi != null && path.endsWith(".apk")) {
            if (applicationInfo.targetSdkVersion >= Build.VERSION_CODES.O) {
                outLibPaths.add(path + "!/lib/" + applicationInfo.primaryCpuAbi);
            }
        }
    }

    /*
     * All indices received by the super class should be shifted by 1 when accessing mSplitNames,
     * etc. The super class assumes the base APK is index 0, while the PackageManager APIs don't
+4 −0
Original line number Diff line number Diff line
@@ -6009,6 +6009,10 @@ public class PackageParser {
            }
        }

        public boolean isLibrary() {
            return staticSharedLibName != null || !ArrayUtils.isEmpty(libraryNames);
        }

        public List<String> getAllCodePaths() {
            ArrayList<String> paths = new ArrayList<>();
            paths.add(baseCodePath);
Loading