[fenix] For https://github.com/mozilla-mobile/fenix/issues/18836: replace StartupActi...
commit688a021a66a564f38bd16567d508708bc003968f
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 8 Apr 2021 00:16:31 +0000 (7 17:16 -0700)
committerMichael Comella <759372+mcomella@users.noreply.github.com>
Tue, 13 Apr 2021 22:10:36 +0000 (13 15:10 -0700)
treefd8f64875fdcad8694c641a42384366c5bff22f5
parenta3902842499c423ef99dcbf4123aec989098c466
[fenix] For https://github.com/mozilla-mobile/fenix/issues/18836: replace StartupActivityStateProvider with StartupStateProvider.

The StartupActivityStateProvider uses an imperative implementation,
driven by callbacks, to set the state of the application. This is hard
to follow as you need to understand which callbacks will be called in
which order. For example, to make sense of an implementation like this,
COLD, WARM, AND HOT would likely need to be implemented in separate
ActivityLifecycleCallbacks.

I feel the StartupStateProvider is an improvement because it leverages
the StartupActivityLog to query a linear state for a more understandable
implementation. Furthermore, it seems accessible to write COLD, WARM,
and HOT in the same class because they can all be approached the same
way.
mobile/android/fenix/app/metrics.yaml
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/perf/ColdStartupDurationTelemetry.kt
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/perf/StartupActivityStateProvider.kt [deleted file]
mobile/android/fenix/docs/metrics.md