Added in API level 30

ConnectivityReport


class ConnectivityReport : Parcelable
kotlin.Any
   ↳ android.net.ConnectivityDiagnosticsManager.ConnectivityReport

Class that includes connectivity information for a specific Network at a specific time.

Summary

Constants
static String

A bitmask of network validation probes that were attempted.

static String

A bitmask of network validation probes that succeeded.

static String

The overall validation result for the Network being reported on.

static Int

DNS probe.

static Int

Captive portal fallback probe.

static Int

HTTP probe.

static Int

HTTPS probe.

static Int

Private DNS (DNS over TLS) probd.

static Int

The overall status of the network is that it is invalid; it neither provides connectivity nor has been exempted from validation.

static Int

The overall status of the network is that it provides partial connectivity; some probed services succeeded but others failed.

static Int

Due to the properties of the network, validation was not performed.

static Int

The overall status of the network is that it is valid, this may be because it provides full Internet access (all probes succeeded), or because other properties of the network caused probes not to be run.

Inherited constants
Public constructors
ConnectivityReport(network: Network, reportTimestamp: Long, linkProperties: LinkProperties, networkCapabilities: NetworkCapabilities, additionalInfo: PersistableBundle)

Constructor for ConnectivityReport.

Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Boolean
equals(other: Any?)

Indicates whether some other object is "equal to" this one.

PersistableBundle

Returns a PersistableBundle with additional info for this report.

LinkProperties

Returns the LinkProperties available when this report was taken.

Network

Returns the Network for this ConnectivityReport.

NetworkCapabilities

Returns the NetworkCapabilities when this report was taken.

Long

Returns the epoch timestamp (milliseconds) for when this report was taken.

Int

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<ConnectivityDiagnosticsManager.ConnectivityReport!>

Implement the Parcelable interface

Constants

NETWORK_PROBE_DNS

Added in API level 30
static val NETWORK_PROBE_DNS: Int

DNS probe.

Value: 4

NETWORK_PROBE_FALLBACK

Added in API level 30
static val NETWORK_PROBE_FALLBACK: Int

Captive portal fallback probe.

Value: 32

NETWORK_PROBE_HTTP

Added in API level 30
static val NETWORK_PROBE_HTTP: Int

HTTP probe.

Value: 8

NETWORK_PROBE_HTTPS

Added in API level 30
static val NETWORK_PROBE_HTTPS: Int

HTTPS probe.

Value: 16

NETWORK_PROBE_PRIVATE_DNS

Added in API level 30
static val NETWORK_PROBE_PRIVATE_DNS: Int

Private DNS (DNS over TLS) probd.

Value: 64

NETWORK_VALIDATION_RESULT_INVALID

Added in API level 30
static val NETWORK_VALIDATION_RESULT_INVALID: Int

The overall status of the network is that it is invalid; it neither provides connectivity nor has been exempted from validation.

Value: 0

NETWORK_VALIDATION_RESULT_PARTIALLY_VALID

Added in API level 30
static val NETWORK_VALIDATION_RESULT_PARTIALLY_VALID: Int

The overall status of the network is that it provides partial connectivity; some probed services succeeded but others failed.

Value: 2

NETWORK_VALIDATION_RESULT_SKIPPED

Added in API level 30
static val NETWORK_VALIDATION_RESULT_SKIPPED: Int

Due to the properties of the network, validation was not performed.

Value: 3

NETWORK_VALIDATION_RESULT_VALID

Added in API level 30
static val NETWORK_VALIDATION_RESULT_VALID: Int

The overall status of the network is that it is valid, this may be because it provides full Internet access (all probes succeeded), or because other properties of the network caused probes not to be run.

Value: 1

Public constructors

ConnectivityReport

Added in API level 30
ConnectivityReport(
    network: Network,
    reportTimestamp: Long,
    linkProperties: LinkProperties,
    networkCapabilities: NetworkCapabilities,
    additionalInfo: PersistableBundle)

Constructor for ConnectivityReport.

Apps should obtain instances through android.net.ConnectivityDiagnosticsManager.ConnectivityDiagnosticsCallback#onConnectivityReportAvailable instead of instantiating their own instances (unless for testing purposes).

Parameters
network Network: The Network for which this ConnectivityReport applies This value cannot be null.
reportTimestamp Long: The timestamp for the report
linkProperties LinkProperties: The LinkProperties available on network at reportTimestamp This value cannot be null.
networkCapabilities NetworkCapabilities: The NetworkCapabilities available on network at reportTimestamp This value cannot be null.
additionalInfo PersistableBundle: A PersistableBundle that may contain additional info about the report This value cannot be null.

Public methods

describeContents

Added in API level 30
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

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 30
fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj the reference object with which to compare.
o This value may be null.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getAdditionalInfo

Added in API level 30
fun getAdditionalInfo(): PersistableBundle

Returns a PersistableBundle with additional info for this report.

Return
PersistableBundle PersistableBundle that may contain additional info about the report This value cannot be null.

getLinkProperties

Added in API level 30
fun getLinkProperties(): LinkProperties

Returns the LinkProperties available when this report was taken.

Return
LinkProperties LinkProperties available on the Network at the reported timestamp This value cannot be null.

getNetwork

Added in API level 30
fun getNetwork(): Network

Returns the Network for this ConnectivityReport.

Return
Network The Network for which this ConnectivityReport applied This value cannot be null.

getNetworkCapabilities

Added in API level 30
fun getNetworkCapabilities(): NetworkCapabilities

Returns the NetworkCapabilities when this report was taken.

Return
NetworkCapabilities NetworkCapabilities available on the Network at the reported timestamp This value cannot be null.

getReportTimestamp

Added in API level 30
fun getReportTimestamp(): Long

Returns the epoch timestamp (milliseconds) for when this report was taken.

Return
Long The timestamp for the report. Taken from System#currentTimeMillis.

hashCode

Added in API level 30
fun hashCode(): Int
Return
Int a hash code value for this object.

writeToParcel

Added in API level 30
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
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 30
static val CREATOR: Parcelable.Creator<ConnectivityDiagnosticsManager.ConnectivityReport!>

Implement the Parcelable interface