From b2410865d4a928d0bf3baafac5b65a7f494d5179 Mon Sep 17 00:00:00 2001 From: Margareta Eliza Balazs Date: Tue, 10 Jul 2018 14:15:34 +0300 Subject: [PATCH] Backed out changeset d04bd6e1521f (bug 1472715) for ES lint failure in components/telemetry/TelemetrySend.jsm on a CLOSED TREE --- .../components/telemetry/TelemetrySend.jsm | 19 ++++--------------- toolkit/content/aboutTelemetry.js | 6 +++--- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/toolkit/components/telemetry/TelemetrySend.jsm b/toolkit/components/telemetry/TelemetrySend.jsm index 081851db3bb9..56eb806a3d6c 100644 --- a/toolkit/components/telemetry/TelemetrySend.jsm +++ b/toolkit/components/telemetry/TelemetrySend.jsm @@ -221,18 +221,6 @@ var TelemetrySend = { return TelemetrySendImpl.submitPing(ping, options); }, - /** - * Check if sending is disabled. If Telemetry is not allowed to upload, - * pings are not sent to the server. - * If trying to send a deletion ping, don't block it. - * - * @param {Object} [ping=null] A ping to be checked. - * @return {Boolean} True if pings can be send to the servers, false otherwise. - */ - sendingEnabled(ping = null) { - return TelemetrySendImpl.sendingEnabled(ping) - }, - /** * Notify that we can start submitting data to the servers. */ @@ -1236,9 +1224,10 @@ var TelemetrySendImpl = { }, /** - * Check if sending is disabled. If Telemetry is not allowed to upload, - * pings are not sent to the server. - * If trying to send a deletion ping, don't block it. + * Check if sending is disabled. If FHR is not allowed to upload, + * pings are not sent to the server (Telemetry is a sub-feature of FHR). If trying + * to send a deletion ping, don't block it. + * If unified telemetry is off, don't send pings if Telemetry is disabled. * * @param {Object} [ping=null] A ping to be checked. * @return {Boolean} True if pings can be send to the servers, false otherwise. diff --git a/toolkit/content/aboutTelemetry.js b/toolkit/content/aboutTelemetry.js index 8187d1603ace..9a530ab93385 100644 --- a/toolkit/content/aboutTelemetry.js +++ b/toolkit/content/aboutTelemetry.js @@ -10,7 +10,6 @@ ChromeUtils.import("resource://gre/modules/TelemetryTimestamps.jsm"); ChromeUtils.import("resource://gre/modules/TelemetryController.jsm"); ChromeUtils.import("resource://gre/modules/TelemetryArchive.jsm"); ChromeUtils.import("resource://gre/modules/TelemetryUtils.jsm"); -ChromeUtils.import("resource://gre/modules/TelemetrySend.jsm"); ChromeUtils.import("resource://gre/modules/Preferences.jsm"); ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); @@ -207,7 +206,8 @@ var Settings = { } }, - getStatusString(enabled) { + getStatusStringForSetting(setting) { + let enabled = Preferences.get(setting.pref, setting.defaultPrefValue); let status = bundle.GetStringFromName(enabled ? "telemetryUploadEnabled" : "telemetryUploadDisabled"); return status; }, @@ -217,7 +217,7 @@ var Settings = { */ render() { let settingsExplanation = document.getElementById("settings-explanation"); - let uploadEnabled = this.getStatusString(TelemetrySend.sendingEnabled()); + let uploadEnabled = this.getStatusStringForSetting(this.SETTINGS[0]); let extendedEnabled = Services.telemetry.canRecordExtended; let collectedData = bundle.GetStringFromName(extendedEnabled ? "prereleaseData" : "releaseData"); let explanation = bundle.GetStringFromName("settingsExplanation");