Merge pull request #3636 from mozilla-mobile/mergify/bp/releases_v118/pr-3281

Bug 1845613 – restore hidden engines for unified search settings (backport #3281)
fenix/118.0
Pascal Chevrel 8 months ago committed by GitHub
commit 9cc4d5a322

@ -366,6 +366,11 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
components.core.contileTopSitesUpdater.startPeriodicWork()
}
if (settings().enableUnifiedSearchSettingsUI && !settings().hiddenEnginesRestored) {
settings().hiddenEnginesRestored = true
components.useCases.searchUseCases.restoreHiddenSearchEngines.invoke()
}
// To assess whether the Pocket stories are to be downloaded or not multiple SharedPreferences
// are read possibly needing to load them on the current thread. Move that to a background thread.
lifecycleScope.launch(IO) {

@ -1830,4 +1830,14 @@ class Settings(private val appContext: Context) : PreferencesHolder {
* Indicates if the new Search settings UI is enabled.
*/
var enableUnifiedSearchSettingsUI: Boolean = showUnifiedSearchFeature && FeatureFlags.unifiedSearchSettings
/**
* Indicates if hidden engines were restored due to migration to unified search settings UI.
* Should be removed once we expect the majority of the users to migrate.
* Tracking: https://bugzilla.mozilla.org/show_bug.cgi?id=1850767
*/
var hiddenEnginesRestored: Boolean by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_hidden_engines_restored),
default = false,
)
}

@ -75,6 +75,7 @@
<string name="pref_key_is_first_splash_screen_shown" translatable="false">pref_key_is_first_splash_screen_shown</string>
<string name="pref_key_nimbus_last_fetch" translatable="false">pref_key_nimbus_last_fetch</string>
<string name="pref_key_home_blocklist">pref_key_home_blocklist</string>
<string name="pref_key_hidden_engines_restored" translatable="false">pref_key_hidden_engines_restored</string>
<!-- Data Choices -->
<string name="pref_key_telemetry" translatable="false">pref_key_telemetry</string>

Loading…
Cancel
Save