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

Commit aae35767 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
Change-Id: If0628aeb4e3f5717604bfc4a87a4b1d438e5fa65
parent cfa9c5b4
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
@@ -545,9 +545,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 = "&";
    /** All dangerous permission names in the same order as the events in MetricsEvent */
    private static final List<String> ALL_DANGEROUS_PERMISSIONS = Arrays.asList(
            Manifest.permission.READ_CALENDAR,
@@ -2401,7 +2398,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: " + libPath);