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
This commit is contained in:
Edgar Arriaga
2023-01-19 01:02:44 +00:00
parent 24737267b7
commit 93aeb07cd1
2 changed files with 4 additions and 5 deletions

View File

@@ -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;

View File

@@ -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