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

Commit 3f95d0bb authored by Andreas Gampe's avatar Andreas Gampe
Browse files

OtaDexopt: Special-case system app classpaths

Specialize system apps' shared libraries so that classpath checks
are elided.

Bug: 30568568
Change-Id: Id1f2555ef43984b616e01f8596701ccba77895b3
(cherry picked from commit c7e02c1d)
parent 14186731
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -50,6 +50,9 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
    private final static String TAG = "OTADexopt";
    private final static boolean DEBUG_DEXOPT = true;

    // The synthetic library dependencies denoting "no checks."
    private final static String[] NO_LIBRARIES = new String[] { "&" };

    private final Context mContext;
    private final PackageManagerService mPackageManagerService;

@@ -202,7 +205,13 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
        PackageDexOptimizer optimizer = new OTADexoptPackageDexOptimizer(
                collectingInstaller, mPackageManagerService.mInstallLock, mContext);

        optimizer.performDexOpt(pkg, pkg.usesLibraryFiles,
        String[] libraryDependencies = pkg.usesLibraryFiles;
        if (pkg.isSystemApp()) {
            // For system apps, we want to avoid classpaths checks.
            libraryDependencies = NO_LIBRARIES;
        }

        optimizer.performDexOpt(pkg, libraryDependencies,
                null /* ISAs */, false /* checkProfiles */,
                getCompilerFilterForReason(compilationReason),
                null /* CompilerStats.PackageStats */);