diff --git a/WordPress/build.gradle b/WordPress/build.gradle index 7a292a41f1f6..040fa38f1db4 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -201,6 +201,7 @@ android { buildConfigField "boolean", "READER_ANNOUNCEMENT_CARD", "false" buildConfigField "boolean", "VOICE_TO_CONTENT", "false" buildConfigField "boolean", "READER_FLOATING_BUTTON", "false" + buildConfigField "boolean", "ENABLE_SELF_HOSTED_USERS", "false" // Override these constants in jetpack product flavor to enable/ disable features buildConfigField "boolean", "ENABLE_SITE_CREATION", "true" diff --git a/WordPress/src/main/java/org/wordpress/android/util/config/ExperimentConfig.kt b/WordPress/src/main/java/org/wordpress/android/util/config/ExperimentConfig.kt index 500e75f92dca..1ad5cf116bd8 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/config/ExperimentConfig.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/config/ExperimentConfig.kt @@ -2,7 +2,6 @@ package org.wordpress.android.util.config /** * This class represents an abstract experiment configuration. An experiment has a list of variants. - * To add an experiment don't forget to update the `remote_config_defaults.xml` file. * @param appConfig class that loads the feature configuration * @param remoteField is the key of the feature flag in the remote config file */ diff --git a/WordPress/src/main/java/org/wordpress/android/util/config/FeatureConfig.kt b/WordPress/src/main/java/org/wordpress/android/util/config/FeatureConfig.kt index 2e61efb970f0..023e4d6b8a91 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/config/FeatureConfig.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/config/FeatureConfig.kt @@ -2,7 +2,6 @@ package org.wordpress.android.util.config /** * A class that represents a feature configuration which enables the feature to be remotely turned on or off. - * To add a feature don't forget to update the remote_config_defaults.xml file. * @param appConfig class that loads the feature configuration * @param buildConfigValue is the field in the BuildConfig file. This flag overrides the remote value. Use this field * to enable the feature to a certain build (debug, test build) so it doesn't have to rely on remote configuration. diff --git a/WordPress/src/main/java/org/wordpress/android/util/config/SelfHostedUsersFeatureConfig.kt b/WordPress/src/main/java/org/wordpress/android/util/config/SelfHostedUsersFeatureConfig.kt new file mode 100644 index 000000000000..4e45eda1ba79 --- /dev/null +++ b/WordPress/src/main/java/org/wordpress/android/util/config/SelfHostedUsersFeatureConfig.kt @@ -0,0 +1,22 @@ +package org.wordpress.android.util.config + +import org.wordpress.android.BuildConfig +import org.wordpress.android.annotation.Feature +import javax.inject.Inject + +/** + * Configuration of the self-hosted users feature + */ +private const val SELF_HOSTED_USERS_REMOTE_FIELD = "self_hosted_users" + +@Feature(SELF_HOSTED_USERS_REMOTE_FIELD, false) +class SelfHostedUsersFeatureConfig +@Inject constructor(appConfig: AppConfig) : FeatureConfig( + appConfig, + BuildConfig.ENABLE_SELF_HOSTED_USERS, + SELF_HOSTED_USERS_REMOTE_FIELD +) { + override fun isEnabled(): Boolean { + return super.isEnabled() && BuildConfig.DEBUG + } +}