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

Commit afa655f2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "inherit-oat-dir-change" into main

* changes:
  Update the logic for inheriting dexopt artifacts during inherit install.
  Delete more unused code that was for the legacy dexopt.
parents df55a1a0 767b1214
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -7274,13 +7274,6 @@ public class PackageParser {
            return applicationInfo.isUpdatedSystemApp();
        }

        /** @hide */
        public boolean canHaveOatDir() {
            // Nobody should be calling this method ever, but we can't rely on this.
            // Thus no logic here and a reasonable return value.
            return true;
        }

        public boolean isMatch(int flags) {
            if ((flags & PackageManager.MATCH_SYSTEM_ONLY) != 0) {
                return isSystem();
+1 −14
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ public class ArtManager {
     *
     * @hide
     */
    public static String getProfileName(String splitName) {
    private static String getProfileName(String splitName) {
        return splitName == null ? "primary.prof" : splitName + ".split.prof";
    }

@@ -209,17 +209,4 @@ public class ArtManager {
        File profileDir = Environment.getDataRefProfilesDePackageDirectory(packageName);
        return new File(profileDir, getProfileName(splitName)).getAbsolutePath();
    }

    /**
     * Return the snapshot profile file for the given package and profile name.
     *
     * KEEP in sync with installd dexopt.cpp.
     * TODO(calin): inject the snapshot profile name from PM to avoid the dependency.
     *
     * @hide
     */
    public static File getProfileSnapshotFileForName(String packageName, String profileName) {
        File profileDir = Environment.getDataRefProfilesDePackageDirectory(packageName);
        return new File(profileDir, profileName  + ".snapshot");
    }
}
+0 −5
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ import com.android.server.utils.WatchedLongSparseArray;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.List;
import java.util.Set;

/**
 * A {@link Computer} provides a set of functions that can operate on live data or snapshot
@@ -520,10 +519,6 @@ public interface Computer extends PackageDataSnapshot {
    ParceledListSlice<InstrumentationInfo> queryInstrumentationAsUser(
            @NonNull String targetPackage, int flags, int userId);

    @NonNull
    List<PackageStateInternal> findSharedNonSystemLibraries(
            @NonNull PackageStateInternal pkgSetting);

    boolean getApplicationHiddenSettingAsUser(@NonNull String packageName, @UserIdInt int userId);

    boolean isPackageSuspendedForUser(@NonNull String packageName, @UserIdInt int userId)
+0 −20
Original line number Diff line number Diff line
@@ -4937,26 +4937,6 @@ public class ComputerEngine implements Computer {
        return new ParceledListSlice<>(finalList);
    }

    @NonNull
    @Override
    public List<PackageStateInternal> findSharedNonSystemLibraries(
            @NonNull PackageStateInternal pkgSetting) {
        List<SharedLibraryInfo> deps = SharedLibraryUtils.findSharedLibraries(pkgSetting);
        if (!deps.isEmpty()) {
            List<PackageStateInternal> retValue = new ArrayList<>();
            for (SharedLibraryInfo info : deps) {
                PackageStateInternal depPackageSetting =
                        getPackageStateInternal(info.getPackageName());
                if (depPackageSetting != null && depPackageSetting.getPkg() != null) {
                    retValue.add(depPackageSetting);
                }
            }
            return retValue;
        } else {
            return Collections.emptyList();
        }
    }

    /**
     * Returns true if application is not found or there was an error. Otherwise it returns
     * the hidden state of the package for the given user.
+3 −4
Original line number Diff line number Diff line
@@ -589,16 +589,15 @@ public class Installer extends SystemService {
    }

    /**
     * Creates an oat dir for given package and instruction set.
     * Creates an oat dir and its sub-dirs for given package.
     */
    public void createOatDir(String packageName, String oatDir, String dexInstructionSet)
    public void createOatDirs(String packageName, String oatDir, List<String> oatSubDirs)
            throws InstallerException {
        // This method should be allowed even if ART Service is enabled, because it's used for
        // creating oat dirs before creating hard links for partial installation.
        // TODO(b/274658735): Add an ART Service API to support hard linking.
        if (!checkBeforeRemote()) return;
        try {
            mInstalld.createOatDir(packageName, oatDir, dexInstructionSet);
            mInstalld.createOatDirs(packageName, oatDir, oatSubDirs);
        } catch (Exception e) {
            throw InstallerException.from(e);
        }
Loading