Bug 1412845 - Whitelist the "default" channel in Prferences.cpp. r?chutten draft
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Tue, 31 Oct 2017 08:53:32 +0100
changeset 689297 47942e2d27573302afe21c754cb3eb042f166b89
parent 689081 083a9c84fbd09a6ff9bfecabbf773650842fe1c0
child 738279 03253fbc6a8b94e28d7561c83b2db9330a3e3d76
push id86980
push useralessio.placitelli@gmail.com
push dateTue, 31 Oct 2017 10:03:25 +0000
reviewerschutten
bugs1412845
milestone58.0a1
Bug 1412845 - Whitelist the "default" channel in Prferences.cpp. r?chutten This is needed for local developer builds to enable extended telemetry recording by default. As a consequence, other subsystems relying on this prefs will turn on (e.g. experiments, BHR, ...). MozReview-Commit-ID: W3RarufCdY
modules/libpref/Preferences.cpp
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -4780,20 +4780,28 @@ pref_InitInitialObjects()
       prerelease = true;
     }
 #endif
     PREF_SetBoolPref(kTelemetryPref, prerelease, true);
   }
 #else
   // For platforms with Unified Telemetry (here meaning not-Android),
   // toolkit.telemetry.enabled determines whether we send "extended" data.
-  // We only want extended data from pre-release channels due to size.
+  // We only want extended data from pre-release channels due to size. We
+  // also want it to be recorded for local developer builds (non-official builds
+  // on the "default" channel).
+  bool developerBuild = false;
+#ifndef MOZILLA_OFFICIAL
+  developerBuild = !strcmp(NS_STRINGIFY(MOZ_UPDATE_CHANNEL), "default");
+#endif
+
   if (!strcmp(NS_STRINGIFY(MOZ_UPDATE_CHANNEL), "nightly") ||
       !strcmp(NS_STRINGIFY(MOZ_UPDATE_CHANNEL), "aurora") ||
-      !strcmp(NS_STRINGIFY(MOZ_UPDATE_CHANNEL), "beta")) {
+      !strcmp(NS_STRINGIFY(MOZ_UPDATE_CHANNEL), "beta") ||
+      developerBuild) {
     PREF_SetBoolPref(kTelemetryPref, true, true);
   } else {
     PREF_SetBoolPref(kTelemetryPref, false, true);
   }
   PREF_LockPref(kTelemetryPref, true);
 #endif // MOZ_WIDGET_ANDROID
 
   NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID,