Bug 1178456 - Experiments service shouldn't use FHR prefs. r=gfritzsche

This commit is contained in:
Alessio Placitelli 2015-07-01 05:46:00 +02:00
parent ef08b9d390
commit 2bd3068c47

View File

@ -21,8 +21,13 @@ const PREF_EXPERIMENTS_ENABLED = "experiments.enabled";
const PREF_ACTIVE_EXPERIMENT = "experiments.activeExperiment"; // whether we have an active experiment
const PREF_HEALTHREPORT_ENABLED = "datareporting.healthreport.service.enabled";
const PREF_TELEMETRY_ENABLED = "toolkit.telemetry.enabled";
const PREF_TELEMETRY_UNIFIED = "toolkit.telemetry.unified";
const DELAY_INIT_MS = 30 * 1000;
// Whether the FHR/Telemetry unification features are enabled.
// Changing this pref requires a restart.
const IS_UNIFIED_TELEMETRY = Preferences.get(PREF_TELEMETRY_UNIFIED, false);
XPCOMUtils.defineLazyGetter(
this, "gPrefs", () => {
return new Preferences();
@ -30,9 +35,11 @@ XPCOMUtils.defineLazyGetter(
XPCOMUtils.defineLazyGetter(
this, "gExperimentsEnabled", () => {
// We can enable experiments if either unified Telemetry or FHR is on, and the user
// has opted into Telemetry.
return gPrefs.get(PREF_EXPERIMENTS_ENABLED, false) &&
gPrefs.get(PREF_TELEMETRY_ENABLED, false) &&
gPrefs.get(PREF_HEALTHREPORT_ENABLED, false);
(gPrefs.get(PREF_HEALTHREPORT_ENABLED, false) || IS_UNIFIED_TELEMETRY) &&
gPrefs.get(PREF_TELEMETRY_ENABLED, false);
});
XPCOMUtils.defineLazyGetter(