Bug 1573868 - Upload Mobile activation ping in onStart. r=nalexander

Bug 1534451 added a non-trivial amount of background computation during
onCreate. This introduced regressions by tickling the balance of existing
race conditions.

We're changing this by now uploading in onStart. Ideally we want to send
this mobile activation ping at least once from every client at startup. This change
should have minimal impact and keep the same consistency with the core ping.

Differential Revision: https://phabricator.services.mozilla.com/D41980

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Vlad Baicu 2019-08-16 22:55:38 +00:00
Родитель 0da3f383c0
Коммит 9b9c9fbffe
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -27,9 +27,17 @@ public class TelemetryActivationPingDelegate extends BrowserAppDelegate {
private TelemetryDispatcher telemetryDispatcher; // lazy
// 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.
//
// 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).
@Override
public void onCreate(BrowserApp browserApp, Bundle savedInstanceState) {
super.onCreate(browserApp, savedInstanceState);
public void onStart(BrowserApp browserApp) {
super.onStart(browserApp);
uploadActivationPing(browserApp);
}