[fenix] For https://github.com/mozilla-mobile/fenix/issues/19804: checkDefaultBrowser moved to helper function

pull/600/head
Marc Leclair 3 years ago committed by mergify[bot]
parent 6c2115cf4a
commit e4d8d3e9a7

@ -311,16 +311,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
}
}
// Launch this on a background thread so as not to affect startup performance
lifecycleScope.launch(IO) {
if (
settings().checkDefaultBrowserAndSet()
) {
metrics.track(Event.ChangedToDefaultBrowser)
}
DefaultBrowserNotificationWorker.setDefaultBrowserNotificationIfNeeded(applicationContext)
}
trackDefaultBrowser()
}
override fun onStart() = PerfStartup.homeActivityOnStart.measureNoInline {
@ -955,6 +946,19 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
}
}
private fun trackDefaultBrowser(){
// Launch this on a background thread so as not to affect startup performance
lifecycleScope.launch(IO) {
if (
settings().checkDefaultBrowserAndSet()
) {
metrics.track(Event.ChangedToDefaultBrowser)
}
DefaultBrowserNotificationWorker.setDefaultBrowserNotificationIfNeeded(applicationContext)
}
}
@VisibleForTesting
internal fun isActivityColdStarted(startingIntent: Intent, activityIcicle: Bundle?): Boolean {
// First time opening this activity in the task.

Loading…
Cancel
Save