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.master
parent
ab57bfd46f
commit
3abffd5d77
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue