Add Voice Broadcast feature flag

This commit is contained in:
Florian Renaud 2022-09-21 11:50:16 +02:00
parent d0dd446af8
commit 0b0ea64a4b
3 changed files with 11 additions and 0 deletions

View File

@ -90,6 +90,11 @@ class DebugFeaturesStateFactory @Inject constructor(
key = DebugFeatureKeys.newDeviceManagementEnabled,
factory = VectorFeatures::isNewDeviceManagementEnabled
),
createBooleanFeature(
label = "Enable Voice Broadcast",
key = DebugFeatureKeys.voiceBroadcastEnabled,
factory = VectorFeatures::isVoiceBroadcastEnabled
),
)
)
}

View File

@ -79,6 +79,9 @@ class DebugVectorFeatures(
override fun isNewDeviceManagementEnabled(): Boolean = read(DebugFeatureKeys.newDeviceManagementEnabled)
?: vectorFeatures.isNewDeviceManagementEnabled()
override fun isVoiceBroadcastEnabled(): Boolean = read(DebugFeatureKeys.voiceBroadcastEnabled)
?: vectorFeatures.isVoiceBroadcastEnabled()
fun <T> override(value: T?, key: Preferences.Key<T>) = updatePreferences {
if (value == null) {
it.remove(key)
@ -140,4 +143,5 @@ object DebugFeatureKeys {
val startDmOnFirstMsg = booleanPreferencesKey("start-dm-on-first-msg")
val newAppLayoutEnabled = booleanPreferencesKey("new-app-layout-enabled")
val newDeviceManagementEnabled = booleanPreferencesKey("new-device-management-enabled")
val voiceBroadcastEnabled = booleanPreferencesKey("voice-broadcast-enabled")
}

View File

@ -41,6 +41,7 @@ interface VectorFeatures {
*/
fun isNewAppLayoutFeatureEnabled(): Boolean
fun isNewDeviceManagementEnabled(): Boolean
fun isVoiceBroadcastEnabled(): Boolean
}
class DefaultVectorFeatures : VectorFeatures {
@ -57,4 +58,5 @@ class DefaultVectorFeatures : VectorFeatures {
override fun forceUsageOfOpusEncoder(): Boolean = false
override fun isNewAppLayoutFeatureEnabled(): Boolean = true
override fun isNewDeviceManagementEnabled(): Boolean = false
override fun isVoiceBroadcastEnabled(): Boolean = false
}