Bug 1204995 - Add telemetry histogram probe to know what % of people have "open external links in private tabs" enabled. r=mcomella r=bsmedberg
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 16 Sep 2015 09:51:42 -0400
changeset 264694 df9dfa4138ed4c7864fe6e55f1ab41f10eb30c35
parent 264693 58adc6b9c8ea3d983ae82c22528fba244f9e5b51
child 264695 04f2a2c320a39859720caf16a7f5b5de836ab997
push id65707
push usercbook@mozilla.com
push dateMon, 28 Sep 2015 12:18:34 +0000
treeherdermozilla-inbound@2c0e60a8f736 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella, bsmedberg
bugs1204995
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1204995 - Add telemetry histogram probe to know what % of people have "open external links in private tabs" enabled. r=mcomella r=bsmedberg
mobile/android/base/BrowserApp.java
toolkit/components/telemetry/Histograms.json
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1803,16 +1803,21 @@ public class BrowserApp extends GeckoApp
             Telemetry.addToHistogram("FENNEC_FAVICONS_COUNT", db.getCount(cr, "favicons"));
             Telemetry.addToHistogram("FENNEC_THUMBNAILS_COUNT", db.getCount(cr, "thumbnails"));
             Telemetry.addToHistogram("FENNEC_READING_LIST_COUNT", db.getReadingListAccessor().getCount(cr));
             Telemetry.addToHistogram("BROWSER_IS_USER_DEFAULT", (isDefaultBrowser(Intent.ACTION_VIEW) ? 1 : 0));
             Telemetry.addToHistogram("FENNEC_TABQUEUE_ENABLED", (TabQueueHelper.isTabQueueEnabled(BrowserApp.this) ? 1 : 0));
             if (Versions.feature16Plus) {
                 Telemetry.addToHistogram("BROWSER_IS_ASSIST_DEFAULT", (isDefaultBrowser(Intent.ACTION_ASSIST) ? 1 : 0));
             }
+
+            final SharedPreferences sharedPrefs = GeckoSharedPrefs.forApp(BrowserApp.this);
+            if (sharedPrefs.getBoolean(GeckoPreferences.PREFS_OPEN_URLS_IN_PRIVATE, false)) {
+                Telemetry.addToHistogram("FENNEC_OPEN_URLS_IN_PRIVATE", 1);
+            }
         } else if ("Updater:Launch".equals(event)) {
             handleUpdaterLaunch();
         } else {
             super.handleMessage(event, message, callback);
         }
     }
 
     private void getFaviconFromCache(final EventCallback callback, final String url) {
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -8916,16 +8916,22 @@
     "n_values": 3,
     "description": "The number of times the tab queue prompt was seen before the user selected NO."
   },
   "FENNEC_TABQUEUE_ENABLED": {
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "Has the tab queue functionality been enabled."
   },
+  "FENNEC_OPEN_URLS_IN_PRIVATE": {
+    "alert_emails": ["margaret@mozilla.com"],
+    "expires_in_version": "44",
+    "kind": "flag",
+    "description": "Reports the state of the open external links in private tabs preference"
+  },
   "VIDEO_EME_DISABLED": {
     "alert_emails": ["edwin@mozilla.com"],
     "expires_in_version": "45",
     "kind": "boolean",
     "description": "Set if media.eme.enabled is false, in a build that supports the Adobe Primetime Content Decryption Module."
   },
   "GRAPHICS_DRIVER_STARTUP_TEST": {
     "alert_emails": ["danderson@mozilla.com"],