private fun updateSyncEngineStates() { val syncEnginesStatus = SyncEnginesStorage(requireContext()).getStatus() requirePreference<CheckBoxPreference>(R.string.pref_key_sync_bookmarks).apply { isEnabled = syncEnginesStatus.containsKey(SyncEngine.Bookmarks) isChecked = syncEnginesStatus.getOrElse(SyncEngine.Bookmarks) { true } } requirePreference<CheckBoxPreference>(R.string.pref_key_sync_credit_cards).apply { isEnabled = syncEnginesStatus.containsKey(SyncEngine.CreditCards) isChecked = syncEnginesStatus.getOrElse(SyncEngine.CreditCards) { true } } requirePreference<CheckBoxPreference>(R.string.pref_key_sync_history).apply { isEnabled = syncEnginesStatus.containsKey(SyncEngine.History) isChecked = syncEnginesStatus.getOrElse(SyncEngine.History) { true } } requirePreference<CheckBoxPreference>(R.string.pref_key_sync_logins).apply { isEnabled = syncEnginesStatus.containsKey(SyncEngine.Passwords) isChecked = syncEnginesStatus.getOrElse(SyncEngine.Passwords) { true } } requirePreference<CheckBoxPreference>(R.string.pref_key_sync_tabs).apply { isEnabled = syncEnginesStatus.containsKey(SyncEngine.Tabs) isChecked = syncEnginesStatus.getOrElse(SyncEngine.Tabs) { true } } requirePreference<CheckBoxPreference>(R.string.pref_key_sync_address).apply { isVisible = FeatureFlags.syncAddressesFeature isEnabled = syncEnginesStatus.containsKey(SyncEngine.Addresses) isChecked = syncEnginesStatus.getOrElse(SyncEngine.Addresses) { true } } }
Updates the status of all [SyncEngine] states.