diff --git a/vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorOverrides.kt b/vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorOverrides.kt index 5e16182f3c..4bd19d9740 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorOverrides.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorOverrides.kt @@ -33,6 +33,7 @@ private val keyForceDialPadDisplay = booleanPreferencesKey("force_dial_pad_displ private val keyForceLoginFallback = booleanPreferencesKey("force_login_fallback") private val forceCanChangeDisplayName = booleanPreferencesKey("force_can_change_display_name") private val forceCanChangeAvatar = booleanPreferencesKey("force_can_change_avatar") +private val keyForceEnableLiveLocationSharing = booleanPreferencesKey("force_enable_live_location_sharing") class DebugVectorOverrides(private val context: Context) : VectorOverrides { @@ -51,6 +52,10 @@ class DebugVectorOverrides(private val context: Context) : VectorOverrides { ) } + override val forceEnableLiveLocationSharing = context.dataStore.data.map { preferences -> + preferences[keyForceEnableLiveLocationSharing].orFalse() + } + suspend fun setForceDialPadDisplay(force: Boolean) { context.dataStore.edit { settings -> settings[keyForceDialPadDisplay] = force @@ -76,4 +81,10 @@ class DebugVectorOverrides(private val context: Context) : VectorOverrides { } } } + + suspend fun setForceEnableLiveLocationSharing(force: Boolean) { + context.dataStore.edit { settings -> + settings[keyForceEnableLiveLocationSharing] = force + } + } } diff --git a/vector/src/main/java/im/vector/app/features/DefaultVectorOverrides.kt b/vector/src/main/java/im/vector/app/features/DefaultVectorOverrides.kt index daa0d9e0bd..d055244148 100644 --- a/vector/src/main/java/im/vector/app/features/DefaultVectorOverrides.kt +++ b/vector/src/main/java/im/vector/app/features/DefaultVectorOverrides.kt @@ -23,6 +23,7 @@ interface VectorOverrides { val forceDialPad: Flow val forceLoginFallback: Flow val forceHomeserverCapabilities: Flow? + val forceEnableLiveLocationSharing: Flow } data class HomeserverCapabilitiesOverride( @@ -34,4 +35,5 @@ class DefaultVectorOverrides : VectorOverrides { override val forceDialPad = flowOf(false) override val forceLoginFallback = flowOf(false) override val forceHomeserverCapabilities: Flow? = null + override val forceEnableLiveLocationSharing = flowOf(false) }