Bug 1249094 - Add UI Telemetry probes for application foreground / background changes r=margaret
authorMark Finkle <mfinkle@mozilla.com>
Fri, 19 Feb 2016 14:56:40 -0500
changeset 321295 f95431e5e7975e3783fbeddcac19495fd0f210d3
parent 321294 8b65dd9aa149cd88bb39e6eddfa47a5ed8705055
child 321296 06e2f969c46e01058b96f1fc890ea236a9ede7dd
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1249094
milestone47.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 1249094 - Add UI Telemetry probes for application foreground / background changes r=margaret
mobile/android/base/java/org/mozilla/gecko/TelemetryContract.java
mobile/android/chrome/content/browser.js
mobile/android/docs/uitelemetry.rst
--- a/mobile/android/base/java/org/mozilla/gecko/TelemetryContract.java
+++ b/mobile/android/base/java/org/mozilla/gecko/TelemetryContract.java
@@ -183,16 +183,19 @@ public interface TelemetryContract {
         SETTINGS("settings"),
 
         // Actions triggered from the share overlay.
         SHARE_OVERLAY("shareoverlay"),
 
         // Action triggered from a suggestion provided to the user.
         SUGGESTION("suggestion"),
 
+        // Action triggered from an OS system action.
+        SYSTEM("system"),
+
         // Action triggered from the Tabs tray.
         TABSTRAY("tabstray"),
 
         // Action triggered from a SuperToast.
         // Note: Only used in JavaScript for now, but here for completeness.
         TOAST("toast"),
 
         // Action triggerred by pressing a SearchWidget button
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -6796,16 +6796,18 @@ var ActivityObserver = {
     Services.obs.addObserver(this, "application-background", false);
     Services.obs.addObserver(this, "application-foreground", false);
   },
 
   observe: function ao_observe(aSubject, aTopic, aData) {
     let isForeground = false;
     let tab = BrowserApp.selectedTab;
 
+    UITelemetry.addEvent("show.1", "system", null, aTopic);
+
     switch (aTopic) {
       case "application-background" :
         let doc = (tab ? tab.browser.contentDocument : null);
         if (doc && doc.fullscreenElement) {
           doc.exitFullscreen();
         }
         isForeground = false;
         break;
@@ -6823,17 +6825,16 @@ var ActivityObserver = {
 var Telemetry = {
   addData: function addData(aHistogramId, aValue) {
     let histogram = Services.telemetry.getHistogramById(aHistogramId);
     histogram.add(aValue);
   },
 };
 
 var Experiments = {
-
   // Enable malware download protection (bug 936041)
   MALWARE_DOWNLOAD_PROTECTION: "malware-download-protection",
 
   init() {
     Messaging.sendRequestForResult({
       type: "Experiments:GetActive"
     }).then(experiments => {
       let names = JSON.parse(experiments);
--- a/mobile/android/docs/uitelemetry.rst
+++ b/mobile/android/docs/uitelemetry.rst
@@ -225,16 +225,19 @@ Methods
   Action triggered from a content page.
 
 ``shareoverlay``
   Action triggered from a content page.
 
 ``suggestion``
   Action triggered from a suggested result, like those from search engines or default tiles.
 
+``system``
+  Action triggered from an OS level action, like application foreground / background.
+
 ``toast``
   Action triggered from an unobtrusive, temporary notification.
 
 ``widget``
   Action triggered from a widget placed on the homescreen.
 
 Sessions
 --------