Bug 1273689 - Elaborate on why we upload when we do. r=sebastian
MozReview-Commit-ID: DIxkY3F3Z6S
--- 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();