Bug 763018 - Report telemetry data for if background updates are enabled. r=rstrong

This commit is contained in:
Brian R. Bondy 2012-06-15 11:59:35 -04:00
parent 18331a6af5
commit d12eed31bb
4 changed files with 10 additions and 6 deletions

View File

@ -319,6 +319,7 @@ HISTOGRAM_BOOLEAN(UPDATER_UPDATES_AUTOMATIC, "Updater: Whether or not updates ar
HISTOGRAM_BOOLEAN(UPDATER_SERVICE_ENABLED, "Updater: Whether or not the MozillaMaintenance service is enabled")
HISTOGRAM(UPDATER_SERVICE_ERRORS, 1, 30, 31, LINEAR, "Updater: The number of MozillaMaintenance service errors that have occurred")
HISTOGRAM_BOOLEAN(UPDATER_SERVICE_INSTALLED, "Updater: Whether or not the MozillaMaintenance service is installed")
HISTOGRAM_BOOLEAN(UPDATER_STAGE_ENABLED, "Updater: Whether or not staging updates are enabled")
/**
* Thunderbird-specific telemetry.

View File

@ -42,7 +42,7 @@ const PREF_APP_UPDATE_POSTUPDATE = "app.update.postupdate";
const PREF_APP_UPDATE_PROMPTWAITTIME = "app.update.promptWaitTime";
const PREF_APP_UPDATE_SHOW_INSTALLED_UI = "app.update.showInstalledUI";
const PREF_APP_UPDATE_SILENT = "app.update.silent";
const PREF_APP_UPDATE_BACKGROUND = "app.update.stage.enabled";
const PREF_APP_UPDATE_STAGE_ENABLED = "app.update.stage.enabled";
const PREF_APP_UPDATE_URL = "app.update.url";
const PREF_APP_UPDATE_URL_DETAILS = "app.update.url.details";
const PREF_APP_UPDATE_URL_OVERRIDE = "app.update.url.override";
@ -417,8 +417,8 @@ XPCOMUtils.defineLazyGetter(this, "gCanApplyUpdates", function aus_gCanApplyUpda
XPCOMUtils.defineLazyGetter(this, "gCanStageUpdates", function aus_gCanStageUpdates() {
// If background updates are disabled, then just bail out!
if (!getPref("getBoolPref", PREF_APP_UPDATE_BACKGROUND, false)) {
LOG("gCanStageUpdates - staging updates is disabled by preference " + PREF_APP_UPDATE_BACKGROUND);
if (!getPref("getBoolPref", PREF_APP_UPDATE_STAGE_ENABLED, false)) {
LOG("gCanStageUpdates - staging updates is disabled by preference " + PREF_APP_UPDATE_STAGE_ENABLED);
return false;
}
@ -1604,6 +1604,9 @@ UpdateService.prototype = {
"UPDATER_UPDATES_ENABLED");
this._sendBoolPrefTelemetryPing(PREF_APP_UPDATE_AUTO,
"UPDATER_UPDATES_AUTOMATIC");
this._sendBoolPrefTelemetryPing(PREF_APP_UPDATE_STAGE_ENABLED,
"UPDATER_STAGE_ENABLED");
#ifdef XP_WIN
this._sendBoolPrefTelemetryPing(PREF_APP_UPDATE_SERVICE_ENABLED,
"UPDATER_SERVICE_ENABLED");
@ -3213,7 +3216,7 @@ Downloader.prototype = {
// download, since otherwise some kind of UI is already visible and
// that UI will notify.
if (this.background)
shouldShowPrompt = !getPref("getBoolPref", PREF_APP_UPDATE_BACKGROUND, false);
shouldShowPrompt = !getPref("getBoolPref", PREF_APP_UPDATE_STAGE_ENABLED, false);
// Tell the updater.exe we're ready to apply.
writeStatusFile(getUpdatesDir(), state);

View File

@ -12,7 +12,7 @@ const AUS_Cr = Components.results;
const AUS_Cu = Components.utils;
const PREF_APP_UPDATE_AUTO = "app.update.auto";
const PREF_APP_UPDATE_BACKGROUND = "app.update.stage.enabled";
const PREF_APP_UPDATE_STAGE_ENABLED = "app.update.stage.enabled";
const PREF_APP_UPDATE_BACKGROUNDERRORS = "app.update.backgroundErrors";
const PREF_APP_UPDATE_BACKGROUNDMAXERRORS = "app.update.backgroundMaxErrors";
const PREF_APP_UPDATE_CERTS_BRANCH = "app.update.certs.";

View File

@ -12,7 +12,7 @@ var gExpectedStatusResult;
function run_test() {
do_test_pending();
do_register_cleanup(end_test);
Services.prefs.setBoolPref(PREF_APP_UPDATE_BACKGROUND, false);
Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGE_ENABLED, false);
removeUpdateDirsAndFiles();
setUpdateURLOverride();
// The mock XMLHttpRequest is MUCH faster