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 |
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 |
hashCode() |
Unit |
writeToParcel(dest: Parcel, flags: Int) Flatten this object in to a Parcel. |
Properties | |
---|---|
static Parcelable.Creator<ConnectivityDiagnosticsManager.ConnectivityReport!> |
Implement the Parcelable interface |
Constants
KEY_NETWORK_PROBES_ATTEMPTED_BITMASK
static val KEY_NETWORK_PROBES_ATTEMPTED_BITMASK: String
A bitmask of network validation probes that were attempted.
These probes may have failed or may be incomplete at the time of this report.
The possible bits values reported by this key are: NETWORK_PROBE_DNS
, NETWORK_PROBE_HTTP
, NETWORK_PROBE_HTTPS
, NETWORK_PROBE_FALLBACK
, NETWORK_PROBE_PRIVATE_DNS
.
Value is android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_DNS
, android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_HTTP
, android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_HTTPS
, android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_FALLBACK
, or android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_PRIVATE_DNS
Value: "networkProbesAttempted"
KEY_NETWORK_PROBES_SUCCEEDED_BITMASK
static val KEY_NETWORK_PROBES_SUCCEEDED_BITMASK: String
A bitmask of network validation probes that succeeded.
The possible bits values reported by this key are: NETWORK_PROBE_DNS
, NETWORK_PROBE_HTTP
, NETWORK_PROBE_HTTPS
, NETWORK_PROBE_FALLBACK
, NETWORK_PROBE_PRIVATE_DNS
.
Value is android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_DNS
, android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_HTTP
, android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_HTTPS
, android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_FALLBACK
, or android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_PROBE_PRIVATE_DNS
Value: "networkProbesSucceeded"
KEY_NETWORK_VALIDATION_RESULT
static val KEY_NETWORK_VALIDATION_RESULT: String
The overall validation result for the Network being reported on.
The possible values for this key are: NETWORK_VALIDATION_RESULT_INVALID
, NETWORK_VALIDATION_RESULT_VALID
, NETWORK_VALIDATION_RESULT_PARTIALLY_VALID
, NETWORK_VALIDATION_RESULT_SKIPPED
.
Value is android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_VALIDATION_RESULT_INVALID
, android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_VALIDATION_RESULT_VALID
, android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_VALIDATION_RESULT_PARTIALLY_VALID
, or android.net.ConnectivityDiagnosticsManager.ConnectivityReport#NETWORK_VALIDATION_RESULT_SKIPPED
Value: "networkValidationResult"
NETWORK_PROBE_FALLBACK
static val NETWORK_PROBE_FALLBACK: Int
Captive portal fallback probe.
Value: 32
NETWORK_PROBE_HTTPS
static val NETWORK_PROBE_HTTPS: Int
HTTPS probe.
Value: 16
NETWORK_PROBE_PRIVATE_DNS
static val NETWORK_PROBE_PRIVATE_DNS: Int
Private DNS (DNS over TLS) probd.
Value: 64
NETWORK_VALIDATION_RESULT_INVALID
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
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
static val NETWORK_VALIDATION_RESULT_SKIPPED: Int
Due to the properties of the network, validation was not performed.
Value: 3
NETWORK_VALIDATION_RESULT_VALID
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
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
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
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 returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
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
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
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
fun getNetwork(): Network
Returns the Network for this ConnectivityReport.
Return | |
---|---|
Network |
The Network for which this ConnectivityReport applied This value cannot be null . |
getNetworkCapabilities
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
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 . |
writeToParcel
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
static val CREATOR: Parcelable.Creator<ConnectivityDiagnosticsManager.ConnectivityReport!>
Implement the Parcelable interface