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

Commit 864bc48e authored by Jeff Hao's avatar Jeff Hao Committed by Android (Google) Code Review
Browse files

Merge "Support to pass <uses-library> option through to dex2oat." into nyc-dev

parents 9f72683f c7b9482b
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -356,15 +356,19 @@ public final class LoadedApk {
            if (instrumentationSplitAppDirs != null) {
                Collections.addAll(outZipPaths, instrumentationSplitAppDirs);
            }
            if (!instrumentationAppDir.equals(instrumentedAppDir)) {
                outZipPaths.add(instrumentedAppDir);
                if (instrumentedSplitAppDirs != null) {
                    Collections.addAll(outZipPaths, instrumentedSplitAppDirs);
                }
            }

            if (outLibPaths != null) {
                outLibPaths.add(instrumentationLibDir);
                if (!instrumentationLibDir.equals(instrumentedLibDir)) {
                    outLibPaths.add(instrumentedLibDir);
                }
            }

            if (!instrumentedAppDir.equals(instrumentationAppDir)) {
                instrumentationLibs = getLibrariesFor(instrumentationPackageName);
+7 −5
Original line number Diff line number Diff line
@@ -135,14 +135,15 @@ public class InstallerConnection {
    }

    public void dexopt(String apkPath, int uid, String instructionSet, int dexoptNeeded,
            int dexFlags, String compilerFilter, String volumeUuid) throws InstallerException {
        dexopt(apkPath, uid, "*", instructionSet, dexoptNeeded,
                null /*outputPath*/, dexFlags, compilerFilter, volumeUuid);
            int dexFlags, String compilerFilter, String volumeUuid, String sharedLibraries)
            throws InstallerException {
        dexopt(apkPath, uid, "*", instructionSet, dexoptNeeded, null /*outputPath*/, dexFlags,
                compilerFilter, volumeUuid, sharedLibraries);
    }

    public void dexopt(String apkPath, int uid, String pkgName, String instructionSet,
            int dexoptNeeded, String outputPath, int dexFlags, String compilerFilter,
            String volumeUuid) throws InstallerException {
            String volumeUuid, String sharedLibraries) throws InstallerException {
        execute("dexopt",
                apkPath,
                uid,
@@ -152,7 +153,8 @@ public class InstallerConnection {
                outputPath,
                dexFlags,
                compilerFilter,
                volumeUuid);
                volumeUuid,
                sharedLibraries);
    }

    public boolean mergeProfiles(int uid, String pkgName) throws InstallerException {
+7 −2
Original line number Diff line number Diff line
@@ -499,6 +499,7 @@ public class ZygoteInit {
        final String instructionSet = VMRuntime.getRuntime().vmInstructionSet();

        try {
            String sharedLibraries = "";
            for (String classPathElement : classPathElements) {
                // System server is fully AOTed and never profiled
                // for profile guided compilation.
@@ -508,9 +509,13 @@ public class ZygoteInit {
                        false /* newProfile */);
                if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                    installer.dexopt(classPathElement, Process.SYSTEM_UID, instructionSet,
                            dexoptNeeded, 0 /*dexFlags*/, "speed",
                            null /*volumeUuid*/);
                            dexoptNeeded, 0 /*dexFlags*/, "speed", null /*volumeUuid*/,
                            sharedLibraries);
                }
                if (!sharedLibraries.isEmpty()) {
                    sharedLibraries += ":";
                }
                sharedLibraries += classPathElement;
            }
        } catch (IOException | InstallerException e) {
            throw new RuntimeException("Error starting system_server", e);
+6 −5
Original line number Diff line number Diff line
@@ -133,19 +133,20 @@ public final class Installer extends SystemService {
    }

    public void dexopt(String apkPath, int uid, String instructionSet, int dexoptNeeded,
            int dexFlags, String compilerFilter, String volumeUuid) throws InstallerException {
            int dexFlags, String compilerFilter, String volumeUuid, String sharedLibraries)
            throws InstallerException {
        assertValidInstructionSet(instructionSet);
        mInstaller.dexopt(apkPath, uid, instructionSet, dexoptNeeded, dexFlags,
                compilerFilter, volumeUuid);
                compilerFilter, volumeUuid, sharedLibraries);
    }

    public void dexopt(String apkPath, int uid, String pkgName, String instructionSet,
            int dexoptNeeded, @Nullable String outputPath, int dexFlags,
            String compilerFilter, String volumeUuid)
            String compilerFilter, String volumeUuid, String sharedLibraries)
            throws InstallerException {
        assertValidInstructionSet(instructionSet);
        mInstaller.dexopt(apkPath, uid, pkgName, instructionSet, dexoptNeeded,
                outputPath, dexFlags, compilerFilter, volumeUuid);
                outputPath, dexFlags, compilerFilter, volumeUuid, sharedLibraries);
    }

    public boolean mergeProfiles(int uid, String pkgName) throws InstallerException {
+4 −1
Original line number Diff line number Diff line
@@ -22,7 +22,9 @@ import static com.android.server.pm.InstructionSets.getDexCodeInstructionSets;
import static com.android.server.pm.PackageManagerServiceCompilerMapping.getCompilerFilterForReason;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.IOtaDexopt;
import android.content.pm.PackageManager;
import android.content.pm.PackageParser;
import android.os.Environment;
import android.os.RemoteException;
@@ -142,7 +144,8 @@ public class OtaDexoptService extends IOtaDexopt.Stub {
            return;
        }

        mPackageDexOptimizer.performDexOpt(nextPackage, null /* ISAs */, false /* useProfiles */,
        mPackageDexOptimizer.performDexOpt(nextPackage, nextPackage.usesLibraryFiles,
                null /* ISAs */, false /* checkProfiles */,
                getCompilerFilterForReason(PackageManagerService.REASON_AB_OTA));
    }

Loading