diff --git a/changelog.d/1241.bugfix b/changelog.d/1241.bugfix new file mode 100644 index 0000000000..d2339b3158 --- /dev/null +++ b/changelog.d/1241.bugfix @@ -0,0 +1 @@ +Enable polls in release build. diff --git a/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt b/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt index 6490b4e357..36113389a4 100644 --- a/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt +++ b/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt @@ -16,21 +16,26 @@ package io.element.android.libraries.featureflag.api +/** + * To enable or disable a FeatureFlags, change the `defaultValue` value. + * It will impact all the build types. + */ enum class FeatureFlags( override val key: String, override val title: String, override val description: String? = null, - override val defaultValue: Boolean = true + override val defaultValue: Boolean ) : Feature { LocationSharing( key = "feature.locationsharing", title = "Allow user to share location", + defaultValue = true, ), Polls( key = "feature.polls", title = "Polls", description = "Create poll and render poll events in the timeline", - defaultValue = false, + defaultValue = true, ), NotificationSettings( key = "feature.notificationsettings", diff --git a/libraries/featureflag/impl/src/main/kotlin/io/element/android/libraries/featureflag/impl/StaticFeatureFlagProvider.kt b/libraries/featureflag/impl/src/main/kotlin/io/element/android/libraries/featureflag/impl/StaticFeatureFlagProvider.kt index 2d66d3be21..50a1ac4dd5 100644 --- a/libraries/featureflag/impl/src/main/kotlin/io/element/android/libraries/featureflag/impl/StaticFeatureFlagProvider.kt +++ b/libraries/featureflag/impl/src/main/kotlin/io/element/android/libraries/featureflag/impl/StaticFeatureFlagProvider.kt @@ -22,7 +22,7 @@ import javax.inject.Inject /** * This provider is used for release build. - * Change the value return by [isFeatureEnabled] to enable/disable features. + * [isFeatureEnabled] just returns the default value of the FeatureFlags. */ class StaticFeatureFlagProvider @Inject constructor() : FeatureFlagProvider { @@ -31,11 +31,7 @@ class StaticFeatureFlagProvider @Inject constructor() : override suspend fun isFeatureEnabled(feature: Feature): Boolean { return if (feature is FeatureFlags) { - when (feature) { - FeatureFlags.LocationSharing -> true - FeatureFlags.Polls -> false - FeatureFlags.NotificationSettings -> false - } + feature.defaultValue } else { false }