Bug 1420514 - Remove telemetry probes tracking app.update.enabled draft
authorKirk Steuber <ksteuber@mozilla.com>
Mon, 14 May 2018 14:24:52 -0700
changeset 818953 4dc5cbd440cedfae74871aca6470e6e29f92f24c
parent 818952 28bfc6deb9ec13e126f40b65452fed7a37bfb2dc
child 818954 8f49a1e77b56c2c02079f146f8ccedaeae59da8c
push id116400
push userbmo:ksteuber@mozilla.com
push dateMon, 16 Jul 2018 20:42:55 +0000
bugs1420514
milestone63.0a1
Bug 1420514 - Remove telemetry probes tracking app.update.enabled Telemetry probes reporting the status of app.update.enabled or nsUpdateService::_enabled have been removed since those values no longer exist. They were replaced with a probe indicating whether update was disabled by policy. MozReview-Commit-ID: 3YhY5P0gFYG
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/TelemetryEnvironment.jsm
toolkit/components/telemetry/histogram-whitelists.json
toolkit/mozapps/update/UpdateTelemetry.jsm
toolkit/mozapps/update/nsUpdateService.js
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -5456,32 +5456,16 @@
   "UPDATE_NOT_PREF_UPDATE_AUTO_NOTIFY": {
     "record_in_processes": ["main"],
     "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "count",
     "releaseChannelCollection": "opt-out",
     "description": "Update: count of when the app.update.auto boolean preference is not the default value of true (true values are not submitted)"
   },
-  "UPDATE_NOT_PREF_UPDATE_ENABLED_EXTERNAL": {
-    "record_in_processes": ["main"],
-    "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
-    "expires_in_version": "never",
-    "kind": "count",
-    "releaseChannelCollection": "opt-out",
-    "description": "Update: count of when the app.update.enabled boolean preference is not the default value of true (true values are not submitted)"
-  },
-  "UPDATE_NOT_PREF_UPDATE_ENABLED_NOTIFY": {
-    "record_in_processes": ["main"],
-    "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
-    "expires_in_version": "never",
-    "kind": "count",
-    "releaseChannelCollection": "opt-out",
-    "description": "Update: count of when the app.update.enabled boolean preference is not the default value of true (true values are not submitted)"
-  },
   "UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_EXTERNAL": {
     "record_in_processes": ["main"],
     "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "count",
     "releaseChannelCollection": "opt-out",
     "description": "Update: count of when the app.update.staging.enabled boolean preference is not the default value of true (true values are not submitted)"
   },
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -182,17 +182,16 @@ const RECORD_DEFAULTPREF_VALUE = Telemet
 const RECORD_DEFAULTPREF_STATE = TelemetryEnvironment.RECORD_DEFAULTPREF_STATE;
 const DEFAULT_ENVIRONMENT_PREFS = new Map([
   ["app.feedback.baseURL", {what: RECORD_PREF_VALUE}],
   ["app.support.baseURL", {what: RECORD_PREF_VALUE}],
   ["accessibility.browsewithcaret", {what: RECORD_PREF_VALUE}],
   ["accessibility.force_disabled", {what:  RECORD_PREF_VALUE}],
   ["app.shield.optoutstudies.enabled", {what: RECORD_PREF_VALUE}],
   ["app.update.auto", {what: RECORD_PREF_VALUE}],
-  ["app.update.enabled", {what: RECORD_PREF_VALUE}],
   ["app.update.interval", {what: RECORD_PREF_VALUE}],
   ["app.update.service.enabled", {what: RECORD_PREF_VALUE}],
   ["app.update.silent", {what: RECORD_PREF_VALUE}],
   ["app.update.url", {what: RECORD_PREF_VALUE}],
   ["browser.cache.disk.enable", {what: RECORD_PREF_VALUE}],
   ["browser.cache.disk.capacity", {what: RECORD_PREF_VALUE}],
   ["browser.cache.memory.enable", {what: RECORD_PREF_VALUE}],
   ["browser.cache.offline.enable", {what: RECORD_PREF_VALUE}],
@@ -263,17 +262,16 @@ const LOGGER_NAME = "Toolkit.Telemetry";
 
 const PREF_BLOCKLIST_ENABLED = "extensions.blocklist.enabled";
 const PREF_DISTRIBUTION_ID = "distribution.id";
 const PREF_DISTRIBUTION_VERSION = "distribution.version";
 const PREF_DISTRIBUTOR = "app.distributor";
 const PREF_DISTRIBUTOR_CHANNEL = "app.distributor.channel";
 const PREF_APP_PARTNER_BRANCH = "app.partner.";
 const PREF_PARTNER_ID = "mozilla.partner.id";
-const PREF_UPDATE_ENABLED = "app.update.enabled";
 const PREF_UPDATE_AUTODOWNLOAD = "app.update.auto";
 const PREF_SEARCH_COHORT = "browser.search.cohort";
 
 const COMPOSITOR_CREATED_TOPIC = "compositor:created";
 const COMPOSITOR_PROCESS_ABORTED_TOPIC = "compositor:process-aborted";
 const DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC = "distribution-customization-complete";
 const GFX_FEATURES_READY_TOPIC = "gfx-features-ready";
 const SEARCH_ENGINE_MODIFIED_TOPIC = "browser-search-engine-modified";
@@ -1415,17 +1413,17 @@ EnvironmentCache.prototype = {
     this._currentEnvironment.settings = {
       blocklistEnabled: Services.prefs.getBoolPref(PREF_BLOCKLIST_ENABLED, true),
       e10sEnabled: Services.appinfo.browserTabsRemoteAutostart,
       e10sMultiProcesses: Services.appinfo.maxWebProcessCount,
       telemetryEnabled: Utils.isTelemetryEnabled,
       locale: getBrowserLocale(),
       update: {
         channel: updateChannel,
-        enabled: Services.prefs.getBoolPref(PREF_UPDATE_ENABLED, true),
+        enabled: !Services.policies || Services.policies.isAllowed("appUpdate"),
         autoDownload: Services.prefs.getBoolPref(PREF_UPDATE_AUTODOWNLOAD, true),
       },
       userPrefs: this._getPrefData(),
       sandbox: this._getSandboxData(),
     };
 
     this._currentEnvironment.settings.addonCompatibilityCheckEnabled =
       AddonManager.checkCompatibility;
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -1172,18 +1172,16 @@
     "UPDATE_DOWNLOAD_CODE_COMPLETE",
     "UPDATE_DOWNLOAD_CODE_PARTIAL",
     "UPDATE_INVALID_LASTUPDATETIME_EXTERNAL",
     "UPDATE_INVALID_LASTUPDATETIME_NOTIFY",
     "UPDATE_LAST_NOTIFY_INTERVAL_DAYS_EXTERNAL",
     "UPDATE_LAST_NOTIFY_INTERVAL_DAYS_NOTIFY",
     "UPDATE_NOT_PREF_UPDATE_AUTO_EXTERNAL",
     "UPDATE_NOT_PREF_UPDATE_AUTO_NOTIFY",
-    "UPDATE_NOT_PREF_UPDATE_ENABLED_EXTERNAL",
-    "UPDATE_NOT_PREF_UPDATE_ENABLED_NOTIFY",
     "UPDATE_NOT_PREF_UPDATE_SERVICE_ENABLED_EXTERNAL",
     "UPDATE_NOT_PREF_UPDATE_SERVICE_ENABLED_NOTIFY",
     "UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_EXTERNAL",
     "UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_NOTIFY",
     "UPDATE_PING_COUNT_EXTERNAL",
     "UPDATE_PING_COUNT_NOTIFY",
     "UPDATE_PREF_SERVICE_ERRORS_EXTERNAL",
     "UPDATE_PREF_SERVICE_ERRORS_NOTIFY",
@@ -1652,18 +1650,16 @@
     "UPDATE_CHECK_EXTENDED_ERROR_EXTERNAL",
     "UPDATE_CHECK_EXTENDED_ERROR_NOTIFY",
     "UPDATE_CHECK_NO_UPDATE_EXTERNAL",
     "UPDATE_CHECK_NO_UPDATE_NOTIFY",
     "UPDATE_INVALID_LASTUPDATETIME_EXTERNAL",
     "UPDATE_INVALID_LASTUPDATETIME_NOTIFY",
     "UPDATE_NOT_PREF_UPDATE_AUTO_EXTERNAL",
     "UPDATE_NOT_PREF_UPDATE_AUTO_NOTIFY",
-    "UPDATE_NOT_PREF_UPDATE_ENABLED_EXTERNAL",
-    "UPDATE_NOT_PREF_UPDATE_ENABLED_NOTIFY",
     "UPDATE_NOT_PREF_UPDATE_SERVICE_ENABLED_EXTERNAL",
     "UPDATE_NOT_PREF_UPDATE_SERVICE_ENABLED_NOTIFY",
     "UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_EXTERNAL",
     "UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_NOTIFY",
     "UPDATE_PING_COUNT_EXTERNAL",
     "UPDATE_PING_COUNT_NOTIFY",
     "UPDATE_SERVICE_MANUALLY_UNINSTALLED_EXTERNAL",
     "UPDATE_SERVICE_MANUALLY_UNINSTALLED_NOTIFY",
--- a/toolkit/mozapps/update/UpdateTelemetry.jsm
+++ b/toolkit/mozapps/update/UpdateTelemetry.jsm
@@ -41,27 +41,24 @@ var AUSTLMY = {
   // Already has an active update in progress (no notification)
   CHK_HAS_ACTIVEUPDATE: 8,
   // A background download is already in progress (no notification)
   CHK_IS_DOWNLOADING: 9,
   // An update is already staged (no notification)
   CHK_IS_STAGED: 10,
   // An update is already downloaded (no notification)
   CHK_IS_DOWNLOADED: 11,
-  // Background checks disabled by preference (no notification)
-  CHK_PREF_DISABLED: 12,
-  // Update checks disabled by admin locked preference (no notification)
-  CHK_ADMIN_DISABLED: 13,
+  // Note: codes 12-13 were removed along with the |app.update.enabled| pref.
   // Unable to check for updates per hasUpdateMutex() (no notification)
   CHK_NO_MUTEX: 14,
   // Unable to check for updates per gCanCheckForUpdates (no notification). This
   // should be covered by other codes and is recorded just in case.
   CHK_UNABLE_TO_CHECK: 15,
-  // Background checks disabled for the current session (no notification)
-  CHK_DISABLED_FOR_SESSION: 16,
+  // Note: code 16 was removed when the feature for disabling updates for the
+  // session was removed.
   // Unable to perform a background check while offline (no notification)
   CHK_OFFLINE: 17,
   // Note: codes 18 - 21 were removed along with the certificate checking code.
   // General update check failure and threshold reached
   // (check failure notification)
   CHK_GENERAL_ERROR_PROMPT: 22,
   // General update check failure and threshold not reached (no notification)
   CHK_GENERAL_ERROR_SILENT: 23,
@@ -82,16 +79,18 @@ var AUSTLMY = {
   // Invalid url for app.update.url default preference (no notification)
   CHK_INVALID_DEFAULT_URL: 32,
   // Update elevation failures or cancelations threshold reached for this
   // version, OSX only (no notification)
   CHK_ELEVATION_DISABLED_FOR_VERSION: 35,
   // User opted out of elevated updates for the available update version, OSX
   // only (no notification)
   CHK_ELEVATION_OPTOUT_FOR_VERSION: 36,
+  // Update checks disabled by enterprise policy
+  CHK_DISABLED_BY_POLICY: 37,
 
   /**
    * Submit a telemetry ping for the update check result code or a telemetry
    * ping for a count type histogram count when no update was found. The no
    * update found ping is separate since it is the typical result, is less
    * interesting than the other result codes, and it is easier to analyze the
    * other codes without including it.
    *
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -2055,17 +2055,17 @@ UpdateService.prototype = {
       if (!UpdateUtils.OSVersion) {
         AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_OS_VERSION);
       } else if (!UpdateUtils.ABI) {
         AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_OS_ABI);
       } else if (!validUpdateURL) {
         AUSTLMY.pingCheckCode(this._pingSuffix,
                               AUSTLMY.CHK_INVALID_DEFAULT_URL);
       } else if (this.disabledByPolicy) {
-        AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_PREF_DISABLED);
+        AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_DISABLED_BY_POLICY);
       } else if (!hasUpdateMutex()) {
         AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_MUTEX);
       } else if (!this.canCheckForUpdates) {
         AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_UNABLE_TO_CHECK);
       }
 
       this.backgroundChecker.checkForUpdates(this, false);
     });