Add a log when network constraint is disabled.
This commit is contained in:
parent
2a5e233e2c
commit
f13a15495b
|
@ -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.SessionScope
|
||||||
import org.matrix.android.sdk.internal.session.homeserver.HomeServerCapabilitiesDataSource
|
import org.matrix.android.sdk.internal.session.homeserver.HomeServerCapabilitiesDataSource
|
||||||
import org.matrix.android.sdk.internal.worker.MatrixWorkerFactory
|
import org.matrix.android.sdk.internal.worker.MatrixWorkerFactory
|
||||||
|
import timber.log.Timber
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ -109,7 +110,13 @@ internal class WorkManagerProvider @Inject constructor(
|
||||||
): Constraints {
|
): Constraints {
|
||||||
val withNetworkConstraint = homeServerCapabilitiesDataSource.getHomeServerCapabilities()?.disableNetworkConstraint.orFalse().not()
|
val withNetworkConstraint = homeServerCapabilitiesDataSource.getHomeServerCapabilities()?.disableNetworkConstraint.orFalse().not()
|
||||||
return Constraints.Builder()
|
return Constraints.Builder()
|
||||||
.apply { if (withNetworkConstraint) setRequiredNetworkType(NetworkType.CONNECTED) }
|
.apply {
|
||||||
|
if (withNetworkConstraint) {
|
||||||
|
setRequiredNetworkType(NetworkType.CONNECTED)
|
||||||
|
} else {
|
||||||
|
Timber.w("Network constraint is disabled")
|
||||||
|
}
|
||||||
|
}
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue