Google is committed to advancing racial equity for Black communities. See how.
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 NetworkRequest objects.

Inherited constants
Public methods
open Boolean

Returns true if and only if the capabilities requested in this NetworkRequest are satisfied by the provided NetworkCapabilities.

open Int

open Boolean
equals(other: Any?)

open NetworkSpecifier?

open Boolean
hasCapability(capability: Int)

open Boolean
hasTransport(transportType: Int)

open Int

open String

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 if and only if 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
Parameters
capability Int: Value is android.net.NetworkCapabilities#NET_CAPABILITY_MMS, android.net.NetworkCapabilities#NET_CAPABILITY_SUPL, android.net.NetworkCapabilities#NET_CAPABILITY_DUN, android.net.NetworkCapabilities#NET_CAPABILITY_FOTA, android.net.NetworkCapabilities#NET_CAPABILITY_IMS, android.net.NetworkCapabilities#NET_CAPABILITY_CBS, android.net.NetworkCapabilities#NET_CAPABILITY_WIFI_P2P, android.net.NetworkCapabilities#NET_CAPABILITY_IA, android.net.NetworkCapabilities#NET_CAPABILITY_RCS, android.net.NetworkCapabilities#NET_CAPABILITY_XCAP, android.net.NetworkCapabilities#NET_CAPABILITY_EIMS, android.net.NetworkCapabilities#NET_CAPABILITY_NOT_METERED, android.net.NetworkCapabilities#NET_CAPABILITY_INTERNET, android.net.NetworkCapabilities#NET_CAPABILITY_NOT_RESTRICTED, android.net.NetworkCapabilities#NET_CAPABILITY_TRUSTED, android.net.NetworkCapabilities#NET_CAPABILITY_NOT_VPN, android.net.NetworkCapabilities#NET_CAPABILITY_VALIDATED, android.net.NetworkCapabilities#NET_CAPABILITY_CAPTIVE_PORTAL, android.net.NetworkCapabilities#NET_CAPABILITY_NOT_ROAMING, android.net.NetworkCapabilities#NET_CAPABILITY_FOREGROUND, android.net.NetworkCapabilities#NET_CAPABILITY_NOT_CONGESTED, android.net.NetworkCapabilities#NET_CAPABILITY_NOT_SUSPENDED, android.net.NetworkCapabilities.NET_CAPABILITY_OEM_PAID, android.net.NetworkCapabilities#NET_CAPABILITY_MCX, android.net.NetworkCapabilities.NET_CAPABILITY_PARTIAL_CONNECTIVITY, or android.net.NetworkCapabilities#NET_CAPABILITY_TEMPORARILY_NOT_METERED

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

Properties

CREATOR

Added in API level 21
static val CREATOR: Parcelable.Creator<NetworkRequest!>