mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/19804: checkDefaultBrowser moved to helper function
This commit is contained in:
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…
Reference in New Issue
Block a user