Bug 821879 - don't initialize Telemetry if we can't send any data in; r=vdjeric

This commit is contained in:
Nathan Froyd 2012-12-14 17:03:31 -05:00
parent 3ce45c1705
commit 9b0fdc6323

View File

@ -717,6 +717,15 @@ TelemetryPing.prototype = {
* Initializes telemetry within a timer. If there is no PREF_SERVER set, don't turn on telemetry.
*/
setup: function setup() {
#ifdef MOZILLA_OFFICIAL
if (!Telemetry.canSend) {
// We can't send data; no point in initializing observers etc.
// Only do this for official builds so that e.g. developer builds
// still enable Telemetry based on prefs.
Telemetry.canRecord = false;
return;
}
#endif
let enabled = false;
try {
enabled = Services.prefs.getBoolPref(PREF_ENABLED);