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

Commit f8afcdc7 authored by Calin Juravle's avatar Calin Juravle
Browse files

Skip class path checking for secondary dex files

Pass '&' marker to dex2oat classpath when compiling secondary dex files.
This will skip class path checking when loading the oat files.

Test: adb shell cmd package compile -m speed -f --secondary-dex com.google.android.gms
      oatdump --header-only --oat-
file=/data/user/0/com.google.android.gms/app_chimera/m/00000006/oat/arm64/DynamiteModulesC_GmsCore_prodmnc_alldpi_release
      check that the class path contains the special '&' marker

Bug: 32871170

(cherry picked from commit aae35767)

Change-Id: I7f3c6743e749316ee02e8586a525ad28ae1ef765

Merged-In: If0628aeb4e3f5717604bfc4a87a4b1d438e5fa65
parent ad014af0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -66,6 +66,9 @@ public class PackageDexOptimizer {
    public static final int DEX_OPT_PERFORMED = 1;
    public static final int DEX_OPT_FAILED = -1;

    /** Special library name that skips shared libraries check during compilation. */
    public static final String SKIP_SHARED_LIBRARY_CHECK = "&";

    private final Installer mInstaller;
    private final Object mInstallLock;

@@ -274,7 +277,7 @@ public class PackageDexOptimizer {
                // TODO(calin): maybe add a separate call.
                mInstaller.dexopt(path, info.uid, info.packageName, isa, /*dexoptNeeded*/ 0,
                        /*oatDir*/ null, dexoptFlags,
                        compilerFilter, info.volumeUuid, /*sharedLibrariesPath*/ null);
                        compilerFilter, info.volumeUuid, SKIP_SHARED_LIBRARY_CHECK);
            }

            return DEX_OPT_PERFORMED;
+1 −4
Original line number Diff line number Diff line
@@ -524,9 +524,6 @@ public class PackageManagerService extends IPackageManager.Stub {
    public static final int REASON_LAST = REASON_CORE_APP;
    /** Special library name that skips shared libraries check during compilation. */
    private static final String SKIP_SHARED_LIBRARY_CHECK = "&";
    final ServiceThread mHandlerThread;
    final PackageHandler mHandler;
@@ -2260,7 +2257,7 @@ public class PackageManagerService extends IPackageManager.Stub {
                                        DEXOPT_PUBLIC,
                                        getCompilerFilterForReason(REASON_SHARED_APK),
                                        StorageManager.UUID_PRIVATE_INTERNAL,
                                        SKIP_SHARED_LIBRARY_CHECK);
                                        PackageDexOptimizer.SKIP_SHARED_LIBRARY_CHECK);
                            }
                        } catch (FileNotFoundException e) {
                            Slog.w(TAG, "Library not found: " + lib);