2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] Use new async API to load and access search engines

Use the new asynchronous features of the search engine
manager from a-c to avoid the latency required to load
the default search engine.
This commit is contained in:
Will Hawkins 2019-08-29 15:48:46 -04:00 committed by Jeff Boek
parent dd5ec5b640
commit 2127d42c9d
2 changed files with 6 additions and 8 deletions

View File

@ -31,12 +31,11 @@ class Search(private val context: Context) {
).apply {
registerForLocaleUpdates(context)
GlobalScope.launch {
loadAsync(context).await()
defaultSearchEngine = getDefaultSearchEngineAsync(
context,
Settings.getInstance(context).defaultSearchEngineName
)
}
defaultSearchEngine = getDefaultSearchEngine(
context,
Settings.getInstance(context).defaultSearchEngineName
)
}
}
}

View File

@ -152,9 +152,8 @@ class AwesomeBarView(
defaultSearchSuggestionProvider =
SearchSuggestionProvider(
searchEngine = components.search.searchEngineManager.getDefaultSearchEngine(
this
),
context = this,
searchEngineManager = components.search.searchEngineManager,
searchUseCase = searchUseCase,
fetchClient = components.core.client,
mode = SearchSuggestionProvider.Mode.MULTIPLE_SUGGESTIONS,