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

Commit bfc47e1e authored by Jiakai Zhang's avatar Jiakai Zhang
Browse files

Delete more unused code that was for the legacy dexopt.

Bug: 258223472
Bug: 6527146
Test: Presubmit
Flag: EXEMPT cleanup
Change-Id: Ib6fa9eba2e03c9bb73b92b77b3e254bd1ba652d2
parent 3a224c66
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.
+0 −8
Original line number Diff line number Diff line
@@ -7648,14 +7648,6 @@ public class PackageManagerService implements PackageSender, TestUtilityService
        }
    }

    boolean canHaveOatDir(@NonNull Computer snapshot, String packageName) {
        final PackageStateInternal packageState = snapshot.getPackageStateInternal(packageName);
        if (packageState == null || packageState.getPkg() == null) {
            return false;
        }
        return AndroidPackageUtils.canHaveOatDir(packageState, packageState.getPkg());
    }

    long deleteOatArtifactsOfPackage(@NonNull Computer snapshot, String packageName) {
        PackageManagerServiceUtils.enforceSystemOrRootOrShell(
                "Only the system or shell can delete oat artifacts");
Loading