Adding new feature flag for new device management
This commit is contained in:
parent
ce4ab78f13
commit
fb0b38bb49
|
@ -90,6 +90,11 @@ class DebugFeaturesStateFactory @Inject constructor(
|
|||
key = DebugFeatureKeys.newAppLayoutEnabled,
|
||||
factory = VectorFeatures::isNewAppLayoutEnabled
|
||||
),
|
||||
createBooleanFeature(
|
||||
label = "Enable New Device Management",
|
||||
key = DebugFeatureKeys.newDeviceManagementEnabled,
|
||||
factory = VectorFeatures::isNewDeviceManagementEnabled
|
||||
),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -79,6 +79,9 @@ class DebugVectorFeatures(
|
|||
override fun isNewAppLayoutEnabled(): Boolean = read(DebugFeatureKeys.newAppLayoutEnabled)
|
||||
?: vectorFeatures.isNewAppLayoutEnabled()
|
||||
|
||||
override fun isNewDeviceManagementEnabled(): Boolean = read(DebugFeatureKeys.newDeviceManagementEnabled)
|
||||
?: vectorFeatures.isNewDeviceManagementEnabled()
|
||||
|
||||
fun <T> override(value: T?, key: Preferences.Key<T>) = updatePreferences {
|
||||
if (value == null) {
|
||||
it.remove(key)
|
||||
|
@ -139,4 +142,5 @@ object DebugFeatureKeys {
|
|||
val forceUsageOfOpusEncoder = booleanPreferencesKey("force-usage-of-opus-encoder")
|
||||
val startDmOnFirstMsg = booleanPreferencesKey("start-dm-on-first-msg")
|
||||
val newAppLayoutEnabled = booleanPreferencesKey("new-app-layout-enabled")
|
||||
val newDeviceManagementEnabled = booleanPreferencesKey("new-device-management-enabled")
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ interface VectorFeatures {
|
|||
fun forceUsageOfOpusEncoder(): Boolean
|
||||
fun shouldStartDmOnFirstMessage(): Boolean
|
||||
fun isNewAppLayoutEnabled(): Boolean
|
||||
fun isNewDeviceManagementEnabled(): Boolean
|
||||
}
|
||||
|
||||
class DefaultVectorFeatures : VectorFeatures {
|
||||
|
@ -50,4 +51,5 @@ class DefaultVectorFeatures : VectorFeatures {
|
|||
override fun forceUsageOfOpusEncoder(): Boolean = false
|
||||
override fun shouldStartDmOnFirstMessage(): Boolean = false
|
||||
override fun isNewAppLayoutEnabled(): Boolean = false
|
||||
override fun isNewDeviceManagementEnabled(): Boolean = false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue