NetworkInfopublic class NetworkInfo extends Object implements android.os.Parcelable
Fields Summary |
---|
String | operatorAlphaLong | String | operatorAlphaShort | String | operatorNumeric | State | state | public static final Creator | CREATORImplement the Parcelable interface
Method to deserialize a NetworkInfo object, or an array thereof. |
Constructors Summary |
---|
NetworkInfo(String operatorAlphaLong, String operatorAlphaShort, String operatorNumeric, State state)
this.operatorAlphaLong = operatorAlphaLong;
this.operatorAlphaShort = operatorAlphaShort;
this.operatorNumeric = operatorNumeric;
this.state = state;
| NetworkInfo(String operatorAlphaLong, String operatorAlphaShort, String operatorNumeric, String stateString)
this (operatorAlphaLong, operatorAlphaShort,
operatorNumeric, rilStateToState(stateString));
|
Methods Summary |
---|
public int | describeContents()Parcelable interface implemented below.
This is a simple effort to make NetworkInfo parcelable rather than
trying to make the conventional containing object (AsyncResult),
implement parcelable. This functionality is needed for the
NetworkQueryService to fix 1128695.
return 0;
| public java.lang.String | getOperatorAlphaLong()
return operatorAlphaLong;
| public java.lang.String | getOperatorAlphaShort()
return operatorAlphaShort;
| public java.lang.String | getOperatorNumeric()
return operatorNumeric;
| public com.android.internal.telephony.gsm.NetworkInfo$State | getState()
return state;
| private static com.android.internal.telephony.gsm.NetworkInfo$State | rilStateToState(java.lang.String s)See state strings defined in ril.h RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
if (s.equals("unknown")) {
return State.UNKNOWN;
} else if (s.equals("available")) {
return State.AVAILABLE;
} else if (s.equals("current")) {
return State.CURRENT;
} else if (s.equals("forbidden")) {
return State.FORBIDDEN;
} else {
throw new RuntimeException(
"RIL impl error: Invalid network state '" + s + "'");
}
| public java.lang.String | toString()
return "NetworkInfo " + operatorAlphaLong
+ "/" + operatorAlphaShort
+ "/" + operatorNumeric
+ "/" + state;
| public void | writeToParcel(android.os.Parcel dest, int flags)Implement the Parcelable interface.
Method to serialize a NetworkInfo object.
dest.writeString(operatorAlphaLong);
dest.writeString(operatorAlphaShort);
dest.writeString(operatorNumeric);
dest.writeSerializable(state);
|
|