For #6441 - Only enable experiments for Beta/Prod
parent
fa780f6790
commit
1ee0703bc3
|
@ -12,6 +12,13 @@ enum class ReleaseChannel {
|
|||
Debug -> false
|
||||
else -> true
|
||||
}
|
||||
|
||||
val isReleaseOrBeta: Boolean
|
||||
get() = when (this) {
|
||||
Production -> true
|
||||
Beta -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
object Config {
|
||||
|
|
|
@ -82,7 +82,7 @@ open class FenixApplication : Application() {
|
|||
experimentLoader = loadExperiments()
|
||||
|
||||
// Enable the service-experiments component
|
||||
if (settings().isExperimentationEnabled) {
|
||||
if (settings().isExperimentationEnabled && Config.channel.isReleaseOrBeta) {
|
||||
Experiments.initialize(
|
||||
applicationContext,
|
||||
mozilla.components.service.experiments.Configuration(
|
||||
|
|
|
@ -9,6 +9,7 @@ import android.os.Bundle
|
|||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.SwitchPreference
|
||||
import org.mozilla.fenix.Config
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.ext.components
|
||||
import org.mozilla.fenix.ext.getPreferenceKey
|
||||
|
@ -66,6 +67,7 @@ class DataChoicesFragment : PreferenceFragmentCompat() {
|
|||
|
||||
findPreference<SwitchPreference>(getPreferenceKey(R.string.pref_key_experimentation))?.apply {
|
||||
isChecked = context.settings().isExperimentationEnabled
|
||||
isVisible = Config.channel.isReleaseOrBeta
|
||||
onPreferenceChangeListener = SharedPreferenceUpdater()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue