FileDocCategorySizeDatePackage
PreciseDataConnectionState.javaAPI DocAndroid 5.1 API8141Thu Mar 12 22:22:42 GMT 2015android.telephony

PreciseDataConnectionState

public class PreciseDataConnectionState extends Object implements android.os.Parcelable
Contains precise data connection state. The following data connection information is included in returned PreciseDataConnectionState:
  • Data connection state.
  • Network type of the connection.
  • APN type.
  • APN.
  • Data connection change reason.
  • The properties of the network link.
  • Data connection fail cause.
hide

Fields Summary
private int
mState
private int
mNetworkType
private String
mAPNType
private String
mAPN
private String
mReason
private android.net.LinkProperties
mLinkProperties
private String
mFailCause
public static final Parcelable.Creator
CREATOR
Constructors Summary
public PreciseDataConnectionState(int state, int networkType, String apnType, String apn, String reason, android.net.LinkProperties linkProperties, String failCause)
Constructor

hide


           
        
                 
                
        mState = state;
        mNetworkType = networkType;
        mAPNType = apnType;
        mAPN = apn;
        mReason = reason;
        mLinkProperties = linkProperties;
        mFailCause = failCause;
    
public PreciseDataConnectionState()
Empty Constructor

hide

    
private PreciseDataConnectionState(android.os.Parcel in)
Construct a PreciseDataConnectionState object from the given parcel.

        mState = in.readInt();
        mNetworkType = in.readInt();
        mAPNType = in.readString();
        mAPN = in.readString();
        mReason = in.readString();
        mLinkProperties = (LinkProperties)in.readParcelable(null);
        mFailCause = in.readString();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public booleanequals(java.lang.Object obj)

        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        PreciseDataConnectionState other = (PreciseDataConnectionState) obj;
        if (mAPN == null) {
            if (other.mAPN != null) {
                return false;
            }
        } else if (!mAPN.equals(other.mAPN)) {
            return false;
        }
        if (mAPNType == null) {
            if (other.mAPNType != null) {
                return false;
            }
        } else if (!mAPNType.equals(other.mAPNType)) {
            return false;
        }
        if (mFailCause == null) {
            if (other.mFailCause != null) {
                return false;
            }
        } else if (!mFailCause.equals(other.mFailCause)) {
            return false;
        }
        if (mLinkProperties == null) {
            if (other.mLinkProperties != null) {
                return false;
            }
        } else if (!mLinkProperties.equals(other.mLinkProperties)) {
            return false;
        }
        if (mNetworkType != other.mNetworkType) {
            return false;
        }
        if (mReason == null) {
            if (other.mReason != null) {
                return false;
            }
        } else if (!mReason.equals(other.mReason)) {
            return false;
        }
        if (mState != other.mState) {
            return false;
        }
        return true;
    
public java.lang.StringgetDataConnectionAPN()
Get data connection APN.

        return mAPN;
    
public java.lang.StringgetDataConnectionAPNType()
Get data connection APN type

        return mAPNType;
    
public java.lang.StringgetDataConnectionChangeReason()
Get data connection change reason.

        return mReason;
    
public java.lang.StringgetDataConnectionFailCause()
Get data connection fail cause, in case there was a failure.

        return mFailCause;
    
public android.net.LinkPropertiesgetDataConnectionLinkProperties()
Get the properties of the network link.

        return mLinkProperties;
    
public intgetDataConnectionNetworkType()
Get data connection network type

see
TelephonyManager#NETWORK_TYPE_UNKNOWN
see
TelephonyManager#NETWORK_TYPE_GPRS
see
TelephonyManager#NETWORK_TYPE_EDGE
see
TelephonyManager#NETWORK_TYPE_UMTS
see
TelephonyManager#NETWORK_TYPE_CDMA
see
TelephonyManager#NETWORK_TYPE_EVDO_0
see
TelephonyManager#NETWORK_TYPE_EVDO_A
see
TelephonyManager#NETWORK_TYPE_1xRTT
see
TelephonyManager#NETWORK_TYPE_HSDPA
see
TelephonyManager#NETWORK_TYPE_HSUPA
see
TelephonyManager#NETWORK_TYPE_HSPA
see
TelephonyManager#NETWORK_TYPE_IDEN
see
TelephonyManager#NETWORK_TYPE_EVDO_B
see
TelephonyManager#NETWORK_TYPE_LTE
see
TelephonyManager#NETWORK_TYPE_EHRPD
see
TelephonyManager#NETWORK_TYPE_HSPAP

        return mNetworkType;
    
public intgetDataConnectionState()
Get data connection state

see
TelephonyManager#DATA_UNKNOWN
see
TelephonyManager#DATA_DISCONNECTED
see
TelephonyManager#DATA_CONNECTING
see
TelephonyManager#DATA_CONNECTED
see
TelephonyManager#DATA_SUSPENDED

        return mState;
    
public inthashCode()


    
       
        final int prime = 31;
        int result = 1;
        result = prime * result + mState;
        result = prime * result + mNetworkType;
        result = prime * result + ((mAPNType == null) ? 0 : mAPNType.hashCode());
        result = prime * result + ((mAPN == null) ? 0 : mAPN.hashCode());
        result = prime * result + ((mReason == null) ? 0 : mReason.hashCode());
        result = prime * result + ((mLinkProperties == null) ? 0 : mLinkProperties.hashCode());
        result = prime * result + ((mFailCause == null) ? 0 : mFailCause.hashCode());
        return result;
    
public java.lang.StringtoString()

        StringBuilder sb = new StringBuilder();

        sb.append("Data Connection state: " + mState);
        sb.append(", Network type: " + mNetworkType);
        sb.append(", APN type: " + mAPNType);
        sb.append(", APN: " + mAPN);
        sb.append(", Change reason: " + mReason);
        sb.append(", Link properties: " + mLinkProperties);
        sb.append(", Fail cause: " + mFailCause);

        return sb.toString();
    
public voidwriteToParcel(android.os.Parcel out, int flags)

        out.writeInt(mState);
        out.writeInt(mNetworkType);
        out.writeString(mAPNType);
        out.writeString(mAPN);
        out.writeString(mReason);
        out.writeParcelable(mLinkProperties, flags);
        out.writeString(mFailCause);