public static final class RxNetworkInfoPredicate.Capabilities
extends java.lang.Object
RxNetwork
by various network capabilities.
Example usage:
rxnetwork.observe()
.subscribeOn(Schedulers.io())
.filter(hasCapability(NET_CAPABILITY_NOT_VPN, NET_CAPABILITY_NOT_METERED))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(...);
| Modifier and Type | Method and Description |
|---|---|
static io.reactivex.functions.Predicate<RxNetworkInfo> |
hasTransportType(int... transportTypes)
Determines if any of specified transport types occurred.
|
static io.reactivex.functions.Predicate<RxNetworkInfo> |
isSatisfiedByDownBandwidth(int downBandwidth)
Checks if given network satisfies minimum downstream bandwidth.
|
static io.reactivex.functions.Predicate<RxNetworkInfo> |
isSatisfiedByUpBandwidth(int upBandwidth)
Checks if given network satisfies minimum upstream bandwidth.
|
public static io.reactivex.functions.Predicate<RxNetworkInfo> hasTransportType(int... transportTypes)
transportTypes - one or many NetworkCapabilities#TRANSPORT_*true if any of the given transport types occurred, false otherwisepublic static io.reactivex.functions.Predicate<RxNetworkInfo> isSatisfiedByUpBandwidth(int upBandwidth)
Please understand that upstream bandwidth is never measured, but rather is inferred
from technology type and other link parameters as documented in
NetworkCapabilities.getLinkUpstreamBandwidthKbps()
upBandwidth - estimated first hop upstream (device to network) bandwidth in Kbpstrue if upstream bandwidth is satisfied, false otherwiseNetworkCapabilities.getLinkUpstreamBandwidthKbps()public static io.reactivex.functions.Predicate<RxNetworkInfo> isSatisfiedByDownBandwidth(int downBandwidth)
Please understand that downstream bandwidth is never measured, but rather is inferred
from technology type and other link parameters as documented in
NetworkCapabilities.getLinkDownstreamBandwidthKbps()
downBandwidth - estimated first hop downstream (device to network) bandwidth in Kbpstrue if downstream bandwidth is satisfied, false otherwiseNetworkCapabilities.getLinkDownstreamBandwidthKbps()