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

Commit 93aeb07c authored by Edgar Arriaga's avatar Edgar Arriaga
Browse files

Enable compaction by default

Since the system has been used for several releases and proven
to be useful. It also reduces the friction to drive adoption.

Test: am compact <pid> full <uid>
Bug: 266011748
Change-Id: Ifced837f0f790b0a5e60fac0d13e78a92d815bd4
parent 24737267
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public final class CachedAppOptimizer {
    private static final int FREEZE_BINDER_TIMEOUT_MS = 100;

    // Defaults for phenotype flags.
    @VisibleForTesting static final Boolean DEFAULT_USE_COMPACTION = false;
    @VisibleForTesting static final Boolean DEFAULT_USE_COMPACTION = true;
    @VisibleForTesting static final Boolean DEFAULT_USE_FREEZER = true;
    @VisibleForTesting static final int DEFAULT_COMPACT_ACTION_2 = COMPACT_ACTION_ALL;
    @VisibleForTesting static final int DEFAULT_COMPACT_ACTION_1 = COMPACT_ACTION_FILE;
+3 −4
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ public final class CachedAppOptimizerTest {
    public void init_withDeviceConfigSetsParameters() {
        // When the DeviceConfig already has a flag value stored (note this test will need to
        // change if the default value changes from false).
        assertThat(CachedAppOptimizer.DEFAULT_USE_COMPACTION).isFalse();
        assertThat(CachedAppOptimizer.DEFAULT_USE_COMPACTION).isTrue();
        DeviceConfig.setProperty(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
                CachedAppOptimizer.KEY_USE_COMPACTION, "true", false);
        DeviceConfig.setProperty(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
@@ -372,9 +372,8 @@ public final class CachedAppOptimizerTest {
                CachedAppOptimizer.KEY_USE_COMPACTION, "foobar", false);
        assertThat(mCountDown.await(5, TimeUnit.SECONDS)).isTrue();

        // Then we set the default.
        assertThat(mCachedAppOptimizerUnderTest.useCompaction()).isEqualTo(
                CachedAppOptimizer.DEFAULT_USE_COMPACTION);
        // Invalid value is mapped to false
        assertThat(mCachedAppOptimizerUnderTest.useCompaction()).isEqualTo(false);
    }

    @Test