diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index d69b02bbc04..871677f04e7 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -13,9 +13,9 @@ import java.util.List; import java.util.Locale; import java.util.Vector; -import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; + import org.mozilla.gecko.DynamicToolbar.PinReason; import org.mozilla.gecko.DynamicToolbar.VisibilityTransition; import org.mozilla.gecko.GeckoProfileDirectories.NoMozillaDirectoryException; @@ -790,6 +790,7 @@ public class BrowserApp extends GeckoApp } if (itemId == R.id.add_search_engine) { + // This can be selected from either the browser menu or the contextmenu, depending on the size and version (v11+) of the phone. Tab tab = Tabs.getInstance().getSelectedTab(); if (tab != null && tab.hasOpenSearch()) { JSONObject args = new JSONObject(); @@ -800,6 +801,10 @@ public class BrowserApp extends GeckoApp return true; } GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("SearchEngines:Add", args.toString())); + + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "add_search_engine"); + } } return true; } diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 84af9e8120e..ea4d3954fc4 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -6820,6 +6820,7 @@ var SearchEngines = { icon: "drawable://ab_add_search_engine", selector: filter, action: function(aElement) { + UITelemetry.addEvent("action.1", "actionbar", null, "add_search_engine"); SearchEngines.addEngine(aElement); } });