Bug 1188145 - Add Telemetry for Voice input. r=liuche
authorKarim Benhmida <kbenhmida@mozilla.com>
Wed, 29 Jul 2015 15:26:10 -0700
changeset 255627 9bc14f82bac8d239b67cf3f939629d933a3cba14
parent 255626 593ea7ab46e20a3486b3212e55d5fdd874585add
child 255628 cb1cfa8cff278c306427311ccfd7e34136619831
child 255639 afa67b6957bb2ce63bd5eb3a4125c111335d4a2f
push id14347
push userryanvm@gmail.com
push dateFri, 31 Jul 2015 13:08:45 +0000
treeherderfx-team@9bc14f82bac8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche
bugs1188145
milestone42.0a1
Bug 1188145 - Add Telemetry for Voice input. r=liuche
mobile/android/base/toolbar/ToolbarEditLayout.java
--- a/mobile/android/base/toolbar/ToolbarEditLayout.java
+++ b/mobile/android/base/toolbar/ToolbarEditLayout.java
@@ -224,26 +224,28 @@ public class ToolbarEditLayout extends T
         if (!voiceIsSupported) {
             return false;
         }
         return GeckoSharedPrefs.forApp(context)
                 .getBoolean(GeckoPreferences.PREFS_VOICE_INPUT_ENABLED, true);
     }
 
     private void launchVoiceRecognizer() {
+        Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.ACTIONBAR, "voice_input_launch");
         final Intent intent = InputOptionsUtils.createVoiceRecognizerIntent(getResources().getString(R.string.voicesearch_prompt));
 
         Activity activity = GeckoAppShell.getGeckoInterface().getActivity();
         ActivityHandlerHelper.startIntentForActivity(activity, intent, new ActivityResultHandler() {
             @Override
             public void onActivityResult(int resultCode, Intent data) {
                 if (resultCode != Activity.RESULT_OK) {
                     return;
                 }
 
+                Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.ACTIONBAR, "voice_input_success");
                 // We have RESULT_OK, not RESULT_NO_MATCH so it should be safe to assume that
                 // we have at least one match. We only need one: this will be
                 // used for showing the user search engines with this search term in it.
                 List<String> voiceStrings = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
                 String text = voiceStrings.get(0);
                 mEditText.setText(text);
                 mEditText.setSelection(0, text.length());