GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Unverified Commit 72edaaf0 authored by Codrut Topliceanu's avatar Codrut Topliceanu Committed by GitHub
Browse files

For #11465 - Fix default engine for widget voice search (#14015)

For #11465  - Fix default engine for widget voice search
parent bf2ac22d
......@@ -76,6 +76,11 @@ abstract class SearchEngineListPreference @JvmOverloads constructor(
it.identifier == defaultEngine
} ?: searchEngineList.list.first()).identifier
context.components.search.searchEngineManager.defaultSearchEngine =
searchEngineList.list.find {
it.identifier == selectedEngine
}
searchEngineGroup!!.removeAllViews()
val layoutInflater = LayoutInflater.from(context)
......@@ -97,6 +102,10 @@ abstract class SearchEngineListPreference @JvmOverloads constructor(
engineItem.tag = engineId
if (engineId == selectedEngine) {
updateDefaultItem(engineItem.radio_button)
/* #11465 -> radio_button.isChecked = true does not trigger
* onSearchEngineSelected because searchEngineGroup has null views at that point.
* So we trigger it here.*/
onSearchEngineSelected(engine)
}
searchEngineGroup!!.addView(engineItem, layoutParams)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment