diff --git a/services/core/java/com/android/server/am/CachedAppOptimizer.java b/services/core/java/com/android/server/am/CachedAppOptimizer.java index f54e2b06cc9aa..410bc416a72fc 100644 --- a/services/core/java/com/android/server/am/CachedAppOptimizer.java +++ b/services/core/java/com/android/server/am/CachedAppOptimizer.java @@ -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; diff --git a/services/tests/mockingservicestests/src/com/android/server/am/CachedAppOptimizerTest.java b/services/tests/mockingservicestests/src/com/android/server/am/CachedAppOptimizerTest.java index 05cad160c7fa5..64e39ef9e1f75 100644 --- a/services/tests/mockingservicestests/src/com/android/server/am/CachedAppOptimizerTest.java +++ b/services/tests/mockingservicestests/src/com/android/server/am/CachedAppOptimizerTest.java @@ -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