Bug 1075232 - Record which suggestion of the search screen was tapped in telemetry. r=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Fri, 03 Oct 2014 14:37:19 -0400
changeset 231954 d1094a154b4135ddda9650c6f82f9e990a675077
parent 231953 1cacd42c198b239221336559794dc3446e75ba80
child 231955 8abd3677f50529de7680678caf3021b6696215b5
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1075232
milestone35.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 1075232 - Record which suggestion of the search screen was tapped in telemetry. r=mfinkle
mobile/android/base/home/SearchEngineRow.java
--- a/mobile/android/base/home/SearchEngineRow.java
+++ b/mobile/android/base/home/SearchEngineRow.java
@@ -84,17 +84,18 @@ class SearchEngineRow extends AnimatedHe
                         Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.SUGGESTION, "url");
 
                         mUrlOpenListener.onUrlOpen(suggestion, EnumSet.noneOf(OnUrlOpenListener.Flags.class));
                     }
                 } else if (mSearchListener != null) {
                     if (v == mUserEnteredView) {
                         Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.SUGGESTION, "user");
                     } else {
-                        Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.SUGGESTION, "engine");
+                        final String extras = "engine." + (String) v.getTag();
+                        Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.SUGGESTION, extras);
                     }
                     mSearchListener.onSearch(mSearchEngine, suggestion);
                 }
             }
         };
 
         mLongClickListener = new OnLongClickListener() {
             @Override
@@ -193,16 +194,19 @@ class SearchEngineRow extends AnimatedHe
                 suggestionItem = mSuggestionView.getChildAt(suggestionCounter + 1);
                 suggestionItem.setVisibility(View.VISIBLE);
             } else {
                 suggestionItem = mInflater.inflate(R.layout.suggestion_item, null);
 
                 suggestionItem.setOnClickListener(mClickListener);
                 suggestionItem.setOnLongClickListener(mLongClickListener);
 
+                // Store the position of the suggestion for telemetry.
+                suggestionItem.setTag(String.valueOf(suggestionCounter));
+
                 final ImageView magnifier =
                         (ImageView) suggestionItem.findViewById(R.id.suggestion_magnifier);
                 magnifier.setVisibility(View.GONE);
 
                 mSuggestionView.addView(suggestionItem);
             }
 
             setSuggestionOnView(suggestionItem, suggestion);