Bug 1182918 - Tab Queue: Add telemetry for double tap action. r=mfinkle, a=sylvestre
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 27 Oct 2015 10:47:03 +0100
changeset 296656 ee8a828b4974
parent 296655 c26f56bea5e9
child 296657 90cae878a97e
push id5276
push usercbook@mozilla.com
push date2015-11-09 10:31 +0000
treeherdermozilla-beta@be9dcc3b97b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, sylvestre
bugs1182918
milestone43.0
Bug 1182918 - Tab Queue: Add telemetry for double tap action. r=mfinkle, a=sylvestre
mobile/android/base/tabqueue/TabQueueService.java
--- a/mobile/android/base/tabqueue/TabQueueService.java
+++ b/mobile/android/base/tabqueue/TabQueueService.java
@@ -141,16 +141,18 @@ public class TabQueueService extends Ser
                             tabQueueHandler.removeCallbacks(stopServiceRunnable);
                             stopSelfResult(stopServiceRunnable.getStartId());
                             stopServiceRunnable = null;
                             removeView();
                         } else {
                             TabQueueHelper.removeURLFromFile(applicationContext, intentUrl, TabQueueHelper.FILE_NAME);
                         }
                         openNow(safeIntent.getUnsafe());
+
+                        Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.INTENT, "tabqueue-doubletap");
                         stopSelfResult(startId);
                     }
                 });
 
                 return START_REDELIVER_INTENT;
             }
 
             sharedPreferences.edit().putString(GeckoPreferences.PREFS_TAB_QUEUE_LAST_SITE, intentUrl)
@@ -181,16 +183,18 @@ public class TabQueueService extends Ser
 
         openNowButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(final View view) {
                 tabQueueHandler.removeCallbacks(stopServiceRunnable);
                 stopServiceRunnable = null;
                 removeView();
                 openNow(intent);
+
+                Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.INTENT, "tabqueue-now");
                 stopSelfResult(startId);
             }
         });
 
         tabQueueHandler.postDelayed(stopServiceRunnable, TOAST_TIMEOUT);
 
         return START_REDELIVER_INTENT;
     }
@@ -202,18 +206,16 @@ public class TabQueueService extends Ser
         startActivity(forwardIntent);
 
         TabQueueHelper.removeNotification(getApplicationContext());
 
         GeckoSharedPrefs.forApp(getApplicationContext()).edit().remove(GeckoPreferences.PREFS_TAB_QUEUE_LAST_SITE)
                                                                .remove(GeckoPreferences.PREFS_TAB_QUEUE_LAST_TIME)
                                                                .apply();
 
-        Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.INTENT, "tabqueue-now");
-
         executorService.submit(new Runnable() {
             @Override
             public void run() {
                 int queuedTabCount = TabQueueHelper.getTabQueueLength(TabQueueService.this);
                 Telemetry.addToHistogram("FENNEC_TABQUEUE_QUEUESIZE", queuedTabCount);
             }
         });