Bug 1004890 - Add UI telemetry for the Home Page contextmenu r=rnewman
authorMark Finkle <mfinkle@mozilla.com>
Fri, 02 May 2014 11:00:22 -0400
changeset 181835 62ead59d3f19
parent 181834 cfd4a86b9ea8
child 181836 bdf3bcd18660
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersrnewman
bugs1004890
milestone32.0a1
Bug 1004890 - Add UI telemetry for the Home Page contextmenu r=rnewman
mobile/android/base/home/HomeFragment.java
--- a/mobile/android/base/home/HomeFragment.java
+++ b/mobile/android/base/home/HomeFragment.java
@@ -122,16 +122,21 @@ abstract class HomeFragment extends Frag
         if (menuInfo == null || !(menuInfo instanceof HomeContextMenuInfo)) {
             return false;
         }
 
         final HomeContextMenuInfo info = (HomeContextMenuInfo) menuInfo;
         final Context context = getActivity();
 
         final int itemId = item.getItemId();
+
+        // Track the menu action. We don't know much about the context, but we can use this to determine
+        // the frequency of use for various actions.
+        Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, getResources().getResourceEntryName(itemId));
+
         if (itemId == R.id.home_share) {
             if (info.url == null) {
                 Log.e(LOGTAG, "Can't share because URL is null");
                 return false;
             } else {
                 GeckoAppShell.openUriExternal(info.url, SHARE_MIME_TYPE, "", "",
                                               Intent.ACTION_SEND, info.getDisplayTitle());