From fe70cb672a0137c93c930179ea2bc9be63c8a859 Mon Sep 17 00:00:00 2001 From: Shobhit Agarwal Date: Tue, 12 Sep 2023 22:37:41 +0530 Subject: [PATCH] Enable offline imagery by default (#1875) --- .../google/android/ground/persistence/local/LocalValueStore.kt | 2 +- .../google/android/ground/repository/MapStateRepositoryTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ground/src/main/java/com/google/android/ground/persistence/local/LocalValueStore.kt b/ground/src/main/java/com/google/android/ground/persistence/local/LocalValueStore.kt index d5f46d9ce2..0d7ccc83ea 100644 --- a/ground/src/main/java/com/google/android/ground/persistence/local/LocalValueStore.kt +++ b/ground/src/main/java/com/google/android/ground/persistence/local/LocalValueStore.kt @@ -85,7 +85,7 @@ class LocalValueStore @Inject constructor(private val preferences: SharedPrefere /** Whether to overlay offline map imagery. */ var isOfflineImageryEnabled: Boolean - get() = allowThreadDiskReads { preferences.getBoolean(OFFLINE_MAP_IMAGERY, false) } + get() = allowThreadDiskReads { preferences.getBoolean(OFFLINE_MAP_IMAGERY, true) } set(value) = allowThreadDiskReads { preferences.edit().putBoolean(OFFLINE_MAP_IMAGERY, value).apply() _offlineImageryEnabled.value = value diff --git a/ground/src/test/java/com/google/android/ground/repository/MapStateRepositoryTest.kt b/ground/src/test/java/com/google/android/ground/repository/MapStateRepositoryTest.kt index cee6d8f83d..47078abef7 100644 --- a/ground/src/test/java/com/google/android/ground/repository/MapStateRepositoryTest.kt +++ b/ground/src/test/java/com/google/android/ground/repository/MapStateRepositoryTest.kt @@ -66,7 +66,7 @@ class MapStateRepositoryTest : BaseHiltTest() { @Test fun isOfflineImageryEnabled_default() = runWithTestDispatcher { - assertThat(mapStateRepository.isOfflineImageryEnabled).isFalse() + assertThat(mapStateRepository.isOfflineImageryEnabled).isTrue() } @Test