Bug 1182918 - Tab Queue: Add telemetry for double tap action. r=mfinkle
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 27 Oct 2015 10:47:03 +0100
changeset 270837 f222336ab85f4940fd649cf7009d712cca9b3753
parent 270836 83ee1cb04baaedfa97074a651ce34c58973ff5e4
child 270838 be3cc4130caf8aca30c28f6c3978c86119e8ec0e
push id86
push usercbook@mozilla.com
push dateWed, 04 Nov 2015 14:00:24 +0000
reviewersmfinkle
bugs1182918
milestone45.0a1
Bug 1182918 - Tab Queue: Add telemetry for double tap action. r=mfinkle
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);
             }
         });