mirror of
https://github.com/element-hq/element-android
synced 2024-11-23 01:45:36 +03:00
Add a log when network constraint is disabled.
This commit is contained in:
parent
2a5e233e2c
commit
f13a15495b
1 changed files with 8 additions and 1 deletions
|
@ -33,6 +33,7 @@ import org.matrix.android.sdk.api.extensions.orFalse
|
|||
import org.matrix.android.sdk.internal.session.SessionScope
|
||||
import org.matrix.android.sdk.internal.session.homeserver.HomeServerCapabilitiesDataSource
|
||||
import org.matrix.android.sdk.internal.worker.MatrixWorkerFactory
|
||||
import timber.log.Timber
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -109,7 +110,13 @@ internal class WorkManagerProvider @Inject constructor(
|
|||
): Constraints {
|
||||
val withNetworkConstraint = homeServerCapabilitiesDataSource.getHomeServerCapabilities()?.disableNetworkConstraint.orFalse().not()
|
||||
return Constraints.Builder()
|
||||
.apply { if (withNetworkConstraint) setRequiredNetworkType(NetworkType.CONNECTED) }
|
||||
.apply {
|
||||
if (withNetworkConstraint) {
|
||||
setRequiredNetworkType(NetworkType.CONNECTED)
|
||||
} else {
|
||||
Timber.w("Network constraint is disabled")
|
||||
}
|
||||
}
|
||||
.build()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue