private fun syncNow() { viewLifecycleOwner.lifecycleScope.launch { SyncAccount.syncNow.record(NoExtras()) // Trigger a sync. requireComponents.backgroundServices.accountManager.syncNow(SyncReason.User) // Poll for device events & update devices. accountManager.authenticatedAccount() ?.deviceConstellation()?.run { refreshDevices() pollForCommands() } } }
Manual sync triggered by the user. This also checks account authentication and refreshes the device list.