Bug 1273689 - Elaborate on why we upload when we do. r=sebastian draft
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 31 May 2016 15:32:04 -0700
changeset 373605 0e13c316b6fc4a5522a52f75c5f00ffd54a7baab
parent 373604 a854facb606afd95764feac19fb5ef64f216addf
child 373606 8824624c524392c0178535c47bf9657ba9cf9168
push id19788
push usermichael.l.comella@gmail.com
push dateTue, 31 May 2016 22:41:35 +0000
reviewerssebastian
bugs1273689
milestone49.0a1
Bug 1273689 - Elaborate on why we upload when we do. r=sebastian MozReview-Commit-ID: DIxkY3F3Z6S
mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryCorePingUploadDelegate.java
--- a/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryCorePingUploadDelegate.java
+++ b/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryCorePingUploadDelegate.java
@@ -38,17 +38,18 @@ public class TelemetryCorePingUploadDele
     @Override
     public void onStart(final BrowserApp browserApp) {
         // We don't upload in onCreate because that's only called when the Activity needs to be instantiated
         // and it's possible the system will never free the Activity from memory.
         //
         // We don't upload in onResume/onPause because that will be called each time the Activity is obscured,
         // including by our own Activities/dialogs, and there is no reason to upload each time we're unobscured.
         //
-        // So we're left with onStart/onStop.
+        // We're left with onStart/onStop and we upload in onStart because onStop is not guaranteed to be called
+        // and we want to upload the first run ASAP (e.g. to get install data before the app may crash).
         final SearchEngineManager searchEngineManager = browserApp.getSearchEngineManager();
         searchEngineManager.getEngine(new UploadTelemetryCorePingCallback(browserApp));
     }
 
     @WorkerThread // via constructor
     private TelemetryDispatcher getTelemetryDispatcher(final BrowserApp browserApp) {
         if (telemetryDispatcher == null) {
             final String profilePath = browserApp.getProfile().getDir().getAbsolutePath();