[Mail] Remove telemetry hooks from application code

This commit is contained in:
Matt A. Tobin
2020-08-01 13:30:50 -04:00
committed by Roy Tam
parent 4472088816
commit fd6341557c
9 changed files with 0 additions and 173 deletions
-1
View File
@@ -401,7 +401,6 @@ pref("browser.display.auto_quality_min_font_size", 0);
pref("view_source.syntax_highlight", false);
pref("toolkit.telemetry.infoURL", "https://www.mozilla.org/thunderbird/legal/privacy/#telemetry");
pref("toolkit.telemetry.enabled", false);
pref("mousewheel.withcontrolkey.action", 3);
-101
View File
@@ -239,13 +239,6 @@ var DOMLinkHandler = {
}
};
var kTelemetryPrompted = "toolkit.telemetry.prompted";
var kTelemetryEnabled = "toolkit.telemetry.enabled";
var kTelemetryRejected = "toolkit.telemetry.rejected";
var kTelemetryServerOwner = "toolkit.telemetry.server_owner";
// This is used to reprompt/renotify users when privacy message changes
var kTelemetryPromptRev = 2;
var contentTabBaseType = {
inContentWhitelist: ['about:addons', 'about:preferences'],
shouldSwitchTo: function onSwitchTo({contentPage: aContentPage}) {
@@ -598,13 +591,6 @@ var specialTabs = {
if (Services.prefs.prefHasUserValue("app.update.postupdate")) {
Services.prefs.clearUserPref("app.update.postupdate");
}
// XXXTobin: Remove
// Show the about rights notification if we need to.
//if (this.shouldShowAboutRightsNotification())
//this.showAboutRightsNotification();
//else if (this.shouldShowTelemetryNotification())
//this.showTelemetryNotification();
},
/**
@@ -828,93 +814,6 @@ var specialTabs = {
openWhatsNew();
},
/**
* Looks at the existing prefs and determines if we should suggest the user
* enables telemetry or not.
*
* This is controlled by the pref toolkit.telemetry.prompted
*/
shouldShowTelemetryNotification: function() {
// Toolkit has decided that the pref should have no default value, so this
// throws if not yet initialized.
let telemetryPrompted = false;
try {
telemetryPrompted = (Services.prefs.getIntPref(kTelemetryPrompted) >= kTelemetryPromptRev);
} catch (e) { }
let telemetryEnabled = false;
try {
telemetryEnabled = (Services.prefs.getBoolPref(kTelemetryEnabled));
} catch (e) { }
// In case user already allowed telemetry, do not bother him with any updated
// prompt. Clear the pref first, in case it was not Int (from older versions).
if (telemetryEnabled && !telemetryPrompted) {
Services.prefs.clearUserPref(kTelemetryPrompted);
Services.prefs.setIntPref(kTelemetryPrompted, kTelemetryPromptRev);
}
if (telemetryEnabled || telemetryPrompted)
return false;
return true;
},
showTelemetryNotification: function() {
var notifyBox = document.getElementById("mail-notification-box");
var brandBundle =
new StringBundle("chrome://branding/locale/brand.properties");
var telemetryBundle =
new StringBundle("chrome://messenger/locale/telemetry.properties");
var productName = brandBundle.get("brandFullName");
var serverOwner = Services.prefs.getCharPref(kTelemetryServerOwner);
var telemetryText = telemetryBundle.get("telemetryText", [productName, serverOwner]);
// Clear all the prefs as we will set them as needed after answering the prompt.
Services.prefs.clearUserPref(kTelemetryPrompted);
Services.prefs.clearUserPref(kTelemetryEnabled);
Services.prefs.clearUserPref(kTelemetryRejected);
var buttons = [
{
label: telemetryBundle.get("telemetryYesButtonLabel"),
accessKey: telemetryBundle.get("telemetryYesButtonAccessKey"),
popup: null,
callback: function(aNotificationBar, aButton) {
Services.prefs.setBoolPref(kTelemetryEnabled, true);
}
},
{
label: telemetryBundle.get("telemetryNoButtonLabel"),
accessKey: telemetryBundle.get("telemetryNoButtonAccessKey"),
popup: null,
callback: function(aNotificationBar, aButton) {
Services.prefs.setBoolPref(kTelemetryRejected, true);
}
}
];
// Set pref to indicate we've shown the notification.
Services.prefs.setIntPref(kTelemetryPrompted, kTelemetryPromptRev);
var notification = notifyBox.appendNotification(telemetryText, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons);
notification.persistence = 3; // arbitrary number, just so bar sticks around for a bit
let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
let link = notification.ownerDocument.createElementNS(XULNS, "label");
link.className = "text-link telemetry-text-link";
link.setAttribute("value", telemetryBundle.get("telemetryLinkLabel"));
link.addEventListener('click', function() {
openPrivacyPolicy('tab');
// Remove the notification on which the user clicked
notification.parentNode.removeNotification(notification, true);
// Add a new notification to that tab, with no "Learn more" link
notifyBox.appendNotification(telemetryText, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons);
}, false);
let description = notification.ownerDocument.getAnonymousElementByAttribute(notification, "anonid", "messageText");
description.appendChild(link);
},
/**
* Looks at the existing prefs and determines if we should show about:rights
* or not.
-12
View File
@@ -412,15 +412,3 @@ function openDictionaryList(where) {
openContentTab(dictUrl, where, "^https://addons.mozilla.org/");
}
/**
* Open the privacy policy in a new content tab, if possible in an available
* mail:3pane window, otherwise by opening a new mail:3pane.
*
* @param where the context to open the privacy policy in (e.g. 'tab',
* 'window'). See openContentTab for more details.
*/
function openPrivacyPolicy(where) {
const kTelemetryInfoUrl = "toolkit.telemetry.infoURL";
let url = Services.prefs.getCharPref(kTelemetryInfoUrl);
openContentTab(url, where, "^http://www.mozilla.org/");
}
-13
View File
@@ -38,7 +38,6 @@ var gAdvancedPane = {
if (AppConstants.MOZ_CRASHREPORTER)
this.initSubmitCrashes();
this.initTelemetry();
this.updateActualCacheSize();
// If the shell service is not working, disable the "Check now" button
@@ -449,16 +448,4 @@ updateWritePrefs: function ()
cr.submitReports = checkbox.checked;
} catch (e) { }
},
/**
* The preference/checkbox is configured in XUL.
*
* In all cases, set up the Learn More link sanely
*/
initTelemetry: function ()
{
if (AppConstants.MOZ_TELEMETRY_REPORTING)
this._setupLearnMoreLink("toolkit.telemetry.infoURL", "telemetryLearnMore");
},
};
-24
View File
@@ -52,13 +52,6 @@
#endif
<!-- Keep one id, so that we don't have to do platform specific stuff later -->
<!-- Data Choices tab -->
#ifdef MOZ_TELEMETRY_REPORTING
<preference id="toolkit.telemetry.enabled"
name="toolkit.telemetry.enabled"
type="bool"/>
#endif
<!-- Network tab -->
<preference id="mail.prompt_purge_threshhold"
name="mail.prompt_purge_threshhold" type="bool"/>
@@ -205,23 +198,6 @@ type="bool"/>
#ifdef MOZ_DATA_REPORTING
<!-- Data Choices -->
<tabpanel id="dataChoicesPanel" orient="vertical">
#ifdef MOZ_TELEMETRY_REPORTING
<groupbox>
<caption label="&telemetrySection.label;"/>
<description>&telemetryDesc.label;</description>
<hbox>
<checkbox id="submitTelemetryBox"
preference="toolkit.telemetry.enabled"
label="&enableTelemetry.label;"
accesskey="&enableTelemetry.accesskey;"/>
<spacer flex="1"/>
<label id="telemetryLearnMore"
class="text-link"
value="&telemetryLearnMore.label;"
onclick="gAdvancedPane.openTextLink(event)"/>
</hbox>
</groupbox>
#endif
#ifdef MOZ_CRASHREPORTER
<groupbox>
<caption label="&crashReporterSection.label;"/>
@@ -2,8 +2,6 @@
<!-- LOCALIZATION NOTE (warningDesc.version): This is a warning about the experimental nature of Nightly and Aurora builds. It is only shown in those versions. -->
<!ENTITY warningDesc.version "&brandShortName; is experimental and may be unstable.">
<!-- LOCALIZATION NOTE (warningDesc.telemetryDesc): This is a notification that Nightly/Aurora builds automatically send Telemetry data back to Mozilla. It is only shown in those versions. "It" refers to brandShortName. -->
<!ENTITY warningDesc.telemetryDesc "It automatically sends information about performance, hardware, usage and customizations back to &vendorShortName; to help make &brandShortName; better.">
<!-- LOCALIZATION NOTE (community.exp.*) This paragraph is shown in "experimental" builds, i.e. Nightly and Aurora builds, instead of the other "community.*" strings below. -->
<!ENTITY community.exp.start "">
@@ -39,12 +39,6 @@
<!ENTITY showReturnReceipts.accesskey "R">
<!-- Data Choices -->
<!ENTITY telemetrySection.label "Telemetry">
<!ENTITY telemetryDesc.label "Shares performance, usage, hardware and customization data about your e-mail client with &vendorShortName; to help us make &brandShortName; better">
<!ENTITY enableTelemetry.label "Enable Telemetry">
<!ENTITY enableTelemetry.accesskey "T">
<!ENTITY telemetryLearnMore.label "Learn More">
<!ENTITY crashReporterSection.label "Crash Reporter">
<!ENTITY crashReporterDesc.label "&brandShortName; submits crash reports to help &vendorShortName; make your e-mail client more stable and secure">
<!ENTITY enableCrashReporter.label "Enable Crash Reporter">
@@ -1,13 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Telemetry prompt
# LOCALIZATION NOTE (telemetryText): %1$S will be replaced by brandFullName,
# and %2$S by the value of the toolkit.telemetry.server_owner preference.
telemetryText = Would you like to help improve %1$S by automatically reporting memory usage, performance, and responsiveness to %2$S?
telemetryLinkLabel = Learn More
telemetryYesButtonLabel = Yes
telemetryYesButtonAccessKey = Y
telemetryNoButtonLabel = No
telemetryNoButtonAccessKey = N
-1
View File
@@ -15,7 +15,6 @@
locale/@AB_CD@/messenger/aboutRights.properties (%chrome/messenger/aboutRights.properties)
locale/@AB_CD@/messenger/aboutSupportMail.dtd (%chrome/messenger/aboutSupportMail.dtd)
locale/@AB_CD@/messenger/aboutSupportMail.properties (%chrome/messenger/aboutSupportMail.properties)
locale/@AB_CD@/messenger/telemetry.properties (%chrome/messenger/telemetry.properties)
locale/@AB_CD@/messenger/accountCreation.dtd (%chrome/messenger/accountCreation.dtd)
locale/@AB_CD@/messenger/accountCreation.properties (%chrome/messenger/accountCreation.properties)
locale/@AB_CD@/messenger/accountCreationModel.properties (%chrome/messenger/accountCreationModel.properties)