Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthew Finkel
fenix
Commits
d2d8f4e8
Unverified
Commit
d2d8f4e8
authored
Oct 15, 2020
by
Stefan Arentz
Committed by
GitHub
Oct 15, 2020
Browse files
For #15711: Also add custom engines to fallback list. (#15938)
Co-authored-by:
mcarare
<
mihai.carare.dev@gmail.com
>
parent
39ac009c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/components/searchengine/FenixSearchEngineProvider.kt
View file @
d2d8f4e8
...
...
@@ -92,7 +92,7 @@ open class FenixSearchEngineProvider(
CustomSearchEngineProvider
().
loadSearchEngines
(
context
)
}
private
var
loadedSearchEngines
=
refreshAsync
()
private
var
loadedSearchEngines
=
refreshAsync
(
baseSearchEngines
)
// https://github.com/mozilla-mobile/fenix/issues/9935
// Create new getter that will return the fallback SearchEngineList if
...
...
@@ -102,7 +102,7 @@ open class FenixSearchEngineProvider(
if
(
isRegionCachedByLocationService
)
{
loadedSearchEngines
}
else
{
fallbackEngines
refreshAsync
(
fallbackEngines
)
}
fun
getDefaultEngine
(
context
:
Context
):
SearchEngine
{
...
...
@@ -176,7 +176,7 @@ open class FenixSearchEngineProvider(
fun
reload
()
{
launch
{
customSearchEngines
=
async
{
CustomSearchEngineProvider
().
loadSearchEngines
(
context
)
}
loadedSearchEngines
=
refreshAsync
()
loadedSearchEngines
=
refreshAsync
(
baseSearchEngines
)
}
}
...
...
@@ -188,8 +188,8 @@ open class FenixSearchEngineProvider(
}
}
private
fun
refreshAsync
()
=
async
{
val
engineList
=
base
SearchEngines
.
await
()
private
fun
refreshAsync
(
baseList
:
Deferred
<
SearchEngineList
>
)
=
async
{
val
engineList
=
base
List
.
await
()
val
bundledList
=
bundledSearchEngines
.
await
().
list
val
customList
=
customSearchEngines
.
await
().
list
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment