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

Commit 280ea1af authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Remove unused flag DEXOPT_ONLY_SHARED_DEX.

It's not set anywhere except in tests. History shows it was implemented
in ce543973 and partially reverted in 1ba0b8ac. However a flag
refactoring in 1d0e83d2 got in between, so some parts of the flag
handling code wasn't cleaned up in the revert.

The flag is removed keep parity with ART Services, where it is not
(currently) planned to be supported.

Test: atest DexoptOptionsTests
Bug: 251903639
Change-Id: I09b3eb09636c2add529e1c77e938e073d634fe50
parent f3c69c3a
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -652,12 +652,6 @@ public class PackageDexOptimizer {
    @DexOptResult
    private int dexOptSecondaryDexPathLI(ApplicationInfo info, String path,
            PackageDexUsage.DexUseInfo dexUseInfo, DexoptOptions options) {
        if (options.isDexoptOnlySharedDex() && !dexUseInfo.isUsedByOtherApps()) {
            // We are asked to optimize only the dex files used by other apps and this is not
            // on of them: skip it.
            return DEX_OPT_SKIPPED;
        }

        String compilerFilter = getRealCompilerFilter(info, options.getCompilerFilter(),
                dexUseInfo.isUsedByOtherApps());
        // Get the dexopt flags after getRealCompilerFilter to make sure we get the correct flags.
+0 −9
Original line number Diff line number Diff line
@@ -40,10 +40,6 @@ public final class DexoptOptions {
    // will only consider the primary apk.
    public static final int DEXOPT_ONLY_SECONDARY_DEX = 1 << 3;

    // When set, dexopt will optimize only dex files that are used by other apps.
    // Currently, this flag is ignored for primary apks.
    public static final int DEXOPT_ONLY_SHARED_DEX = 1 << 4;

    // When set, dexopt will attempt to scale down the optimizations previously applied in order
    // save disk space.
    public static final int DEXOPT_DOWNGRADE = 1 << 5;
@@ -105,7 +101,6 @@ public final class DexoptOptions {
                DEXOPT_FORCE |
                DEXOPT_BOOT_COMPLETE |
                DEXOPT_ONLY_SECONDARY_DEX |
                DEXOPT_ONLY_SHARED_DEX |
                DEXOPT_DOWNGRADE |
                DEXOPT_AS_SHARED_LIBRARY |
                DEXOPT_IDLE_BACKGROUND_JOB |
@@ -146,10 +141,6 @@ public final class DexoptOptions {
        return (mFlags & DEXOPT_ONLY_SECONDARY_DEX) != 0;
    }

    public boolean isDexoptOnlySharedDex() {
        return (mFlags & DEXOPT_ONLY_SHARED_DEX) != 0;
    }

    public boolean isDowngrade() {
        return (mFlags & DEXOPT_DOWNGRADE) != 0;
    }
+0 −5
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ public class DexoptOptionsTests {
        assertFalse(opt.isBootComplete());
        assertFalse(opt.isCheckForProfileUpdates());
        assertFalse(opt.isDexoptOnlySecondaryDex());
        assertFalse(opt.isDexoptOnlySharedDex());
        assertFalse(opt.isDowngrade());
        assertFalse(opt.isForce());
        assertFalse(opt.isDexoptIdleBackgroundJob());
@@ -67,7 +66,6 @@ public class DexoptOptionsTests {
                DexoptOptions.DEXOPT_BOOT_COMPLETE |
                DexoptOptions.DEXOPT_CHECK_FOR_PROFILES_UPDATES |
                DexoptOptions.DEXOPT_ONLY_SECONDARY_DEX |
                DexoptOptions.DEXOPT_ONLY_SHARED_DEX |
                DexoptOptions.DEXOPT_DOWNGRADE  |
                DexoptOptions.DEXOPT_AS_SHARED_LIBRARY |
                DexoptOptions.DEXOPT_IDLE_BACKGROUND_JOB |
@@ -81,7 +79,6 @@ public class DexoptOptionsTests {
        assertTrue(opt.isBootComplete());
        assertTrue(opt.isCheckForProfileUpdates());
        assertTrue(opt.isDexoptOnlySecondaryDex());
        assertTrue(opt.isDexoptOnlySharedDex());
        assertTrue(opt.isDowngrade());
        assertTrue(opt.isForce());
        assertTrue(opt.isDexoptAsSharedLibrary());
@@ -113,7 +110,6 @@ public class DexoptOptionsTests {
            assertTrue(opt.isBootComplete());
            assertTrue(opt.isCheckForProfileUpdates());
            assertFalse(opt.isDexoptOnlySecondaryDex());
            assertFalse(opt.isDexoptOnlySharedDex());
            assertFalse(opt.isDowngrade());
            assertTrue(opt.isForce());
            assertFalse(opt.isDexoptAsSharedLibrary());
@@ -131,7 +127,6 @@ public class DexoptOptionsTests {
        assertTrue(opt.isBootComplete());
        assertFalse(opt.isCheckForProfileUpdates());
        assertFalse(opt.isDexoptOnlySecondaryDex());
        assertFalse(opt.isDexoptOnlySharedDex());
        assertFalse(opt.isDowngrade());
        assertTrue(opt.isForce());
        assertFalse(opt.isDexoptAsSharedLibrary());