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

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

Compile secondary dex files according to REASON_BACKGROUND_DEXOPT

Test: adb shell cmd package bg-dexopt-job works for sercondary dex files

Bug: 32871170
Bug: 26719109

(cherry picked from commit a70b1b12)

Merged-In: Iaee8071449c83e774b2fe331aaccfc5433856f4f
Change-Id: I2334e4d73a5acdd1106e913c59ddf642782f1eee
parent a9f46f76
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -290,8 +290,8 @@ public class BackgroundDexOptService extends JobService {
                            PackageManagerService.REASON_BACKGROUND_DEXOPT,
                            /* force */ false)
                    : pm.performDexOptSecondary(pkg,
                            PackageManagerServiceCompilerMapping.getFullCompilerFilter(),
                            /* force */ true);
                            PackageManagerService.REASON_BACKGROUND_DEXOPT,
                            /* force */ false);
            if (success) {
                // Dexopt succeeded, remove package from the list of failing ones.
                synchronized (failedPackageNames) {
+5 −0
Original line number Diff line number Diff line
@@ -7516,6 +7516,11 @@ public class PackageManagerService extends IPackageManager.Stub {
        return mDexManager.dexoptSecondaryDex(packageName, compilerFilter, force);
    }
    public boolean performDexOptSecondary(String packageName, int compileReason,
            boolean force) {
        return mDexManager.dexoptSecondaryDex(packageName, compileReason, force);
    }
    /**
     * Reconcile the information we have about the secondary dex files belonging to
     * {@code packagName} and the actual dex files. For all dex files that were
+11 −0
Original line number Diff line number Diff line
@@ -274,6 +274,17 @@ public class DexManager {
        return mPackageDexUsage.getPackageUseInfo(packageName);
    }

    /**
     * Perform dexopt on the package {@code packageName} secondary dex files.
     * @return true if all secondary dex files were processed successfully (compiled or skipped
     *         because they don't need to be compiled)..
     */
    public boolean dexoptSecondaryDex(String packageName, int compilerReason, boolean force) {
        return dexoptSecondaryDex(packageName,
                PackageManagerServiceCompilerMapping.getCompilerFilterForReason(compilerReason),
                force);
    }

    /**
     * Perform dexopt on the package {@code packageName} secondary dex files.
     * @return true if all secondary dex files were processed successfully (compiled or skipped