private fun updateSyncEngineState(engine: SyncEngine, newValue: Boolean) { SyncEnginesStorage(requireContext()).setStatus(engine, newValue) viewLifecycleOwner.lifecycleScope.launch { requireContext().components.backgroundServices.accountManager.syncNow(SyncReason.EngineChange) } }
Updates the sync engine status with the new state of the preference and triggers a sync event.