For #19804: checkDefaultBrowser moved to helper function

upstream-sync
Marc Leclair 3 years ago committed by mergify[bot]
parent db01fab8a9
commit 871cde764e

@ -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