Added in API level 21
NetworkRequest
open class NetworkRequest : Parcelable
| kotlin.Any | |
| ↳ | android.net.NetworkRequest |
Defines a request for a network, made through NetworkRequest.Builder and used to request a network via ConnectivityManager#requestNetwork or listen for changes via ConnectivityManager#registerNetworkCallback.
Summary
Nested classes |
|
|---|---|
| open |
Builder used to create |
Inherited constants |
|
|---|---|
Public methods |
|
|---|---|
| open Boolean |
Returns true iff. |
| open Int | |
| open Boolean | |
| open NetworkSpecifier? | |
| open Boolean |
hasCapability(capability: Int) |
| open Boolean |
hasTransport(transportType: Int) |
| open Int |
hashCode() |
| open String |
toString() |
| open Unit |
writeToParcel(dest: Parcel!, flags: Int) |
Properties |
|
|---|---|
| static Parcelable.Creator<NetworkRequest!> | |
Public methods
canBeSatisfiedBy
Added in API level 30
open fun canBeSatisfiedBy(nc: NetworkCapabilities?): Boolean
Returns true iff. the capabilities requested in this NetworkRequest are satisfied by the provided NetworkCapabilities.
| Parameters | |
|---|---|
nc |
NetworkCapabilities?: Capabilities that should satisfy this NetworkRequest. null capabilities do not satisfy any request. This value may be null. |
describeContents
Added in API level 21
open fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
Added in API level 21
open fun equals(other: Any?): Boolean
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getNetworkSpecifier
Added in API level 30
open fun getNetworkSpecifier(): NetworkSpecifier?
| Return | |
|---|---|
NetworkSpecifier? |
This value may be null. |
hasCapability
Added in API level 28
open fun hasCapability(capability: Int): Boolean
hasTransport
Added in API level 28
open fun hasTransport(transportType: Int): Boolean
| Parameters | |
|---|---|
transportType |
Int: Value is android.net.NetworkCapabilities#TRANSPORT_CELLULAR, android.net.NetworkCapabilities#TRANSPORT_WIFI, android.net.NetworkCapabilities#TRANSPORT_BLUETOOTH, android.net.NetworkCapabilities#TRANSPORT_ETHERNET, android.net.NetworkCapabilities#TRANSPORT_VPN, android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE, android.net.NetworkCapabilities#TRANSPORT_LOWPAN, or android.net.NetworkCapabilities.TRANSPORT_TEST |
hashCode
Added in API level 21
open fun hashCode(): Int
| Return | |
|---|---|
Int |
a hash code value for this object. |
toString
Added in API level 21
open fun toString(): String
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
Added in API level 21
open fun writeToParcel(
dest: Parcel!,
flags: Int
): Unit
| Parameters | |
|---|---|
dest |
Parcel!: The Parcel in which the object should be written. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |