PreciseDataConnectionState
public
final
class
PreciseDataConnectionState
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.telephony.PreciseDataConnectionState |
Contains precise data connection state. The following data connection information is included in returned PreciseDataConnectionState:
- Data connection state.
- Network type of the connection.
- APN types.
- APN.
- The properties of the network link.
- Data connection fail cause.
Summary
Constants | |
|---|---|
int |
NETWORK_VALIDATION_FAILURE
Failure. |
int |
NETWORK_VALIDATION_IN_PROGRESS
In progress. |
int |
NETWORK_VALIDATION_NOT_REQUESTED
Not Requested. |
int |
NETWORK_VALIDATION_SUCCESS
Success. |
int |
NETWORK_VALIDATION_UNSUPPORTED
Unsupported. |
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<PreciseDataConnectionState> |
CREATOR
|
Public methods | |
|---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
boolean
|
equals(Object o)
Indicates whether some other object is "equal to" this one. |
ApnSetting
|
getApnSetting()
Return the APN Settings for this data connection. |
int
|
getId()
|
int
|
getLastCauseCode()
Returns the cause code generated by the most recent state change. |
LinkProperties
|
getLinkProperties()
Get the properties of the network link |
int
|
getNetworkType()
Get the network type associated with this data connection. |
int
|
getNetworkValidationStatus()
Returns the network validation state. |
int
|
getState()
|
int
|
getTransportType()
|
int
|
hashCode()
Returns a hash code value for the object. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel out, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
|---|---|
Constants
NETWORK_VALIDATION_FAILURE
public static final int NETWORK_VALIDATION_FAILURE
Failure. The Failure status is used when network validation has been completed for the data network and the result is failure.
Constant Value: 4 (0x00000004)
NETWORK_VALIDATION_IN_PROGRESS
public static final int NETWORK_VALIDATION_IN_PROGRESS
In progress. The in progress state is used when the network validation process for the data network is in progress. This state is followed by either success or failure.
Constant Value: 2 (0x00000002)
NETWORK_VALIDATION_NOT_REQUESTED
public static final int NETWORK_VALIDATION_NOT_REQUESTED
Not Requested. The not requested status is used when the data network supports the network validation function, but no network validation is being performed yet.
Constant Value: 1 (0x00000001)
NETWORK_VALIDATION_SUCCESS
public static final int NETWORK_VALIDATION_SUCCESS
Success. The Success status is used when network validation has been completed for the data network and the result is successful.
Constant Value: 3 (0x00000003)
NETWORK_VALIDATION_UNSUPPORTED
public static final int NETWORK_VALIDATION_UNSUPPORTED
Unsupported. The unsupported state is used when the data network cannot support the network validation function for the current data connection state.
Constant Value: 0 (0x00000000)
Fields
Public methods
describeContents
public int describeContents ()
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.
| Returns | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or
|
equals
public boolean equals (Object o)
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
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons 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 | |
|---|---|
o |
Object: the reference object with which to compare. |
| Returns | |
|---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
getApnSetting
public ApnSetting getApnSetting ()
Return the APN Settings for this data connection.
| Returns | |
|---|---|
ApnSetting |
the ApnSetting that was used to configure this data connection. Note that a data
connection cannot be established without a valid ApnSetting. The return value would
never be null even though it has Nullable annotation. |
getId
public int getId ()
| Returns | |
|---|---|
int |
The unique id of the data connection
Note this is the id assigned by the data service.
The id remains the same for data connection handover between
AccessNetworkConstants.TRANSPORT_TYPE_WLAN and
AccessNetworkConstants.TRANSPORT_TYPE_WWAN |
getLastCauseCode
public int getLastCauseCode ()
Returns the cause code generated by the most recent state change.
Return the cause code for the most recent change in getState(). In the event of an
error, this cause code will be non-zero.
getLinkProperties
public LinkProperties getLinkProperties ()
Get the properties of the network link LinkProperties.
| Returns | |
|---|---|
LinkProperties |
This value may be null. |
getNetworkType
public int getNetworkType ()
Get the network type associated with this data connection.
getNetworkValidationStatus
public int getNetworkValidationStatus ()
Returns the network validation state.
| Returns | |
|---|---|
int |
the network validation status of the data call.
Value is one of the following: |
getState
public int getState ()
| Returns | |
|---|---|
int |
The high-level state of this data connection.
Value is one of the following: |
getTransportType
public int getTransportType ()
| Returns | |
|---|---|
int |
The transport type of this data connection.
Value is one of the following: |
hashCode
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap.
The general contract of hashCode is:
- Whenever it is invoked on the same object more than once during
an execution of a Java application, the
hashCodemethod must consistently return the same integer, provided no information used inequalscomparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal
according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
| Returns | |
|---|---|
int |
a hash code value for this object. |
toString
public String toString ()
Returns a string representation of the object.
| Returns | |
|---|---|
String |
This value cannot be null. |
writeToParcel
public void writeToParcel (Parcel out, int flags)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
out |
Parcel: This value cannot be null. |
flags |
int: Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:
|