SyncConstraints
WorkManager constraints that must be met for sync to run.
Current constraints:
Network: CONNECTED (any network type - WiFi or cellular)
Additional constraints can be added:
val SyncConstraints = Constraints.Builder()
.setRequiredNetworkType(NetworkType.UNMETERED) // WiFi only
.setRequiresBatteryNotLow(true) // Battery not low
.setRequiresStorageNotLow(true) // Storage not low
.build()Content copied to clipboard