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

Commit 387d30d7 authored by Martin Stjernholm's avatar Martin Stjernholm Committed by Android (Google) Code Review
Browse files

Merge "Make DexOptHelper.forceDexOpt a legacy dexopt only method."

parents 44c816cc f2ac30f2
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -575,8 +575,6 @@ interface IPackageManager {
    boolean performDexOptSecondary(String packageName,
            String targetCompilerFilter, boolean force);

    void forceDexOpt(String packageName);

    int getMoveStatus(int moveId);

    void registerMoveCallback(in IPackageMoveObserver callback);
+5 −0
Original line number Diff line number Diff line
@@ -1327,6 +1327,11 @@ public abstract class PackageManagerInternal {
    public abstract void legacyDumpProfiles(@NonNull String packageName,
            boolean dumpClassesAndMethods) throws LegacyDexoptDisabledException;

    /** @deprecated For legacy shell command only. */
    @Deprecated
    public abstract void legacyForceDexOpt(@NonNull String packageName)
            throws LegacyDexoptDisabledException;

    /** @deprecated For legacy shell command only. */
    @Deprecated
    public abstract void legacyReconcileSecondaryDexFiles(String packageName)
+5 −14
Original line number Diff line number Diff line
@@ -566,7 +566,10 @@ public final class DexOptHelper {
                mPm.getDexManager().getPackageUseInfoOrDefault(p.getPackageName()), options);
    }

    public void forceDexOpt(@NonNull Computer snapshot, String packageName) {
    /** @deprecated For legacy shell command only. */
    @Deprecated
    public void forceDexOpt(@NonNull Computer snapshot, String packageName)
            throws LegacyDexoptDisabledException {
        PackageManagerServiceUtils.enforceSystemOrRoot("forceDexOpt");

        final PackageStateInternal packageState = snapshot.getPackageStateInternal(packageName);
@@ -586,19 +589,7 @@ public final class DexOptHelper {
                getDefaultCompilerFilter(), null /* splitName */,
                DexoptOptions.DEXOPT_FORCE | DexoptOptions.DEXOPT_BOOT_COMPLETE);

        @DexOptResult int res;
        if (useArtService()) {
            // performDexOptWithArtService ignores the snapshot and takes its own, so it can race
            // with the package checks above, but at worst the effect is only a bit less friendly
            // error below.
            res = performDexOptWithArtService(options, ArtFlags.FLAG_SHOULD_INCLUDE_DEPENDENCIES);
        } else {
            try {
                res = performDexOptInternalWithDependenciesLI(pkg, packageState, options);
            } catch (LegacyDexoptDisabledException e) {
                throw new RuntimeException(e);
            }
        }
        @DexOptResult int res = performDexOptInternalWithDependenciesLI(pkg, packageState, options);

        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
        if (res != PackageDexOptimizer.DEX_OPT_PERFORMED) {
+0 −6
Original line number Diff line number Diff line
@@ -301,12 +301,6 @@ public abstract class IPackageManagerBase extends IPackageManager.Stub {
        return mPreferredActivityHelper.findPersistentPreferredActivity(snapshot(), intent, userId);
    }

    @Override
    @Deprecated
    public final void forceDexOpt(String packageName) {
        mDexOptHelper.forceDexOpt(snapshot(), packageName);
    }

    @Override
    @Deprecated
    public final ActivityInfo getActivityInfo(ComponentName component,
+7 −0
Original line number Diff line number Diff line
@@ -6676,6 +6676,13 @@ public class PackageManagerService implements PackageSender, TestUtilityService
            }
        }

        /** @deprecated For legacy shell command only. */
        @Override
        @Deprecated
        public void legacyForceDexOpt(String packageName) throws LegacyDexoptDisabledException {
            mDexOptHelper.forceDexOpt(snapshotComputer(), packageName);
        }

        /** @deprecated For legacy shell command only. */
        @Override
        @Deprecated
Loading