Methods Summary |
---|
public void | bringUp(ApnContext apnContext, int initialMaxRetry, int profileId, int rilRadioTechnology, boolean retryWhenSSChange, android.os.Message onCompletedMsg)Bring up a connection to the apn and return an AsyncResult in onCompletedMsg.
Used for cellular networks that use Acesss Point Names (APN) such
as GSM networks.
if (DBG) {
log("bringUp: apnContext=" + apnContext + " initialMaxRetry=" + initialMaxRetry
+ " onCompletedMsg=" + onCompletedMsg);
}
sendMessage(DataConnection.EVENT_CONNECT,
new ConnectionParams(apnContext, initialMaxRetry, profileId,
rilRadioTechnology, retryWhenSSChange, onCompletedMsg));
|
protected static java.lang.String | cmdToString(int cmd)
sCmdToString[REQ_IS_INACTIVE - BASE] = "REQ_IS_INACTIVE";
sCmdToString[RSP_IS_INACTIVE - BASE] = "RSP_IS_INACTIVE";
sCmdToString[REQ_GET_CID - BASE] = "REQ_GET_CID";
sCmdToString[RSP_GET_CID - BASE] = "RSP_GET_CID";
sCmdToString[REQ_GET_APNSETTING - BASE] = "REQ_GET_APNSETTING";
sCmdToString[RSP_GET_APNSETTING - BASE] = "RSP_GET_APNSETTING";
sCmdToString[REQ_GET_LINK_PROPERTIES - BASE] = "REQ_GET_LINK_PROPERTIES";
sCmdToString[RSP_GET_LINK_PROPERTIES - BASE] = "RSP_GET_LINK_PROPERTIES";
sCmdToString[REQ_SET_LINK_PROPERTIES_HTTP_PROXY - BASE] =
"REQ_SET_LINK_PROPERTIES_HTTP_PROXY";
sCmdToString[RSP_SET_LINK_PROPERTIES_HTTP_PROXY - BASE] =
"RSP_SET_LINK_PROPERTIES_HTTP_PROXY";
sCmdToString[REQ_GET_NETWORK_CAPABILITIES - BASE] = "REQ_GET_NETWORK_CAPABILITIES";
sCmdToString[RSP_GET_NETWORK_CAPABILITIES - BASE] = "RSP_GET_NETWORK_CAPABILITIES";
sCmdToString[REQ_RESET - BASE] = "REQ_RESET";
sCmdToString[RSP_RESET - BASE] = "RSP_RESET";
cmd -= BASE;
if ((cmd >= 0) && (cmd < sCmdToString.length)) {
return sCmdToString[cmd];
} else {
return AsyncChannel.cmdToString(cmd + BASE);
}
|
public ApnSetting | getApnSettingSync()Get the connections ApnSetting.
ApnSetting value;
if (isCallerOnDifferentThread()) {
Message response = sendMessageSynchronously(REQ_GET_APNSETTING);
if ((response != null) && (response.what == RSP_GET_APNSETTING)) {
value = rspApnSetting(response);
} else {
log("getApnSetting error response=" + response);
value = null;
}
} else {
value = mDc.getApnSetting();
}
return value;
|
public int | getCidSync()
int value;
if (isCallerOnDifferentThread()) {
Message response = sendMessageSynchronously(REQ_GET_CID);
if ((response != null) && (response.what == RSP_GET_CID)) {
value = rspCid(response);
} else {
log("rspCid error response=" + response);
value = -1;
}
} else {
value = mDc.getCid();
}
return value;
|
public int | getDataConnectionIdSync()
// Safe because this is owned by the caller.
return mDc.getDataConnectionId();
|
public android.net.LinkProperties | getLinkPropertiesSync()Get the connections LinkProperties.
LinkProperties value;
if (isCallerOnDifferentThread()) {
Message response = sendMessageSynchronously(REQ_GET_LINK_PROPERTIES);
if ((response != null) && (response.what == RSP_GET_LINK_PROPERTIES)) {
value = rspLinkProperties(response);
} else {
log("getLinkProperties error response=" + response);
value = null;
}
} else {
value = mDc.getCopyLinkProperties();
}
return value;
|
public android.net.NetworkCapabilities | getNetworkCapabilitiesSync()Get the connections NetworkCapabilities.
NetworkCapabilities value;
if (isCallerOnDifferentThread()) {
Message response = sendMessageSynchronously(REQ_GET_NETWORK_CAPABILITIES);
if ((response != null) && (response.what == RSP_GET_NETWORK_CAPABILITIES)) {
value = rspNetworkCapabilities(response);
} else {
value = null;
}
} else {
value = mDc.getCopyNetworkCapabilities();
}
return value;
|
public java.lang.String[] | getPcscfAddr()
return mDc.mPcscfAddr;
|
private boolean | isCallerOnDifferentThread()
long curThreadId = Thread.currentThread().getId();
boolean value = mDcThreadId != curThreadId;
if (DBG) log("isCallerOnDifferentThread: " + value);
return value;
|
public boolean | isInactiveSync()
boolean value;
if (isCallerOnDifferentThread()) {
Message response = sendMessageSynchronously(REQ_IS_INACTIVE);
if ((response != null) && (response.what == RSP_IS_INACTIVE)) {
value = rspIsInactive(response);
} else {
log("rspIsInactive error response=" + response);
value = false;
}
} else {
value = mDc.getIsInactive();
}
return value;
|
private void | log(java.lang.String s)
android.telephony.Rlog.d(mLogTag, "DataConnectionAc " + s);
|
public void | reqApnSetting()Request the connections ApnSetting.
Response {@link #rspApnSetting}
sendMessage(REQ_GET_APNSETTING);
if (DBG) log("reqApnSetting");
|
public void | reqCid()Request the Connection ID.
Response {@link #rspCid}
sendMessage(REQ_GET_CID);
if (DBG) log("reqCid");
|
public void | reqIsInactive()Request if the state machine is in the inactive state.
Response {@link #rspIsInactive}
sendMessage(REQ_IS_INACTIVE);
if (DBG) log("reqIsInactive");
|
public void | reqLinkProperties()Request the connections LinkProperties.
Response {@link #rspLinkProperties}
sendMessage(REQ_GET_LINK_PROPERTIES);
if (DBG) log("reqLinkProperties");
|
public void | reqNetworkCapabilities()Request the connections NetworkCapabilities.
Response {@link #rspNetworkCapabilities}
sendMessage(REQ_GET_NETWORK_CAPABILITIES);
if (DBG) log("reqNetworkCapabilities");
|
public void | reqReset()Response RSP_RESET when complete
sendMessage(REQ_RESET);
if (DBG) log("reqReset");
|
public void | reqSetLinkPropertiesHttpProxy(android.net.ProxyInfo proxy)Request setting the connections LinkProperties.HttpProxy.
Response RSP_SET_LINK_PROPERTIES when complete.
sendMessage(REQ_SET_LINK_PROPERTIES_HTTP_PROXY, proxy);
if (DBG) log("reqSetLinkPropertiesHttpProxy proxy=" + proxy);
|
public ApnSetting | rspApnSetting(android.os.Message response)Evaluate a RSP_APN_SETTING message and return the ApnSetting.
ApnSetting retVal = (ApnSetting) response.obj;
if (DBG) log("rspApnSetting=" + retVal);
return retVal;
|
public int | rspCid(android.os.Message response)Evaluate a RSP_GET_CID message and return the cid.
int retVal = response.arg1;
if (DBG) log("rspCid=" + retVal);
return retVal;
|
public boolean | rspIsInactive(android.os.Message response)Evaluate RSP_IS_INACTIVE.
boolean retVal = response.arg1 == 1;
if (DBG) log("rspIsInactive=" + retVal);
return retVal;
|
public android.net.LinkProperties | rspLinkProperties(android.os.Message response)Evaluate RSP_GET_LINK_PROPERTIES
LinkProperties retVal = (LinkProperties) response.obj;
if (DBG) log("rspLinkProperties=" + retVal);
return retVal;
|
public android.net.NetworkCapabilities | rspNetworkCapabilities(android.os.Message response)Evaluate RSP_GET_NETWORK_CAPABILITIES
NetworkCapabilities retVal = (NetworkCapabilities) response.obj;
if (DBG) log("rspNetworkCapabilities=" + retVal);
return retVal;
|
public void | setLinkPropertiesHttpProxySync(android.net.ProxyInfo proxy)Set the connections LinkProperties.HttpProxy
if (isCallerOnDifferentThread()) {
Message response =
sendMessageSynchronously(REQ_SET_LINK_PROPERTIES_HTTP_PROXY, proxy);
if ((response != null) && (response.what == RSP_SET_LINK_PROPERTIES_HTTP_PROXY)) {
if (DBG) log("setLinkPropertiesHttpPoxy ok");
} else {
log("setLinkPropertiesHttpPoxy error response=" + response);
}
} else {
mDc.setLinkPropertiesHttpProxy(proxy);
}
|
public void | tearDown(ApnContext apnContext, java.lang.String reason, android.os.Message onCompletedMsg)Tear down the connection through the apn on the network.
if (DBG) {
log("tearDown: apnContext=" + apnContext
+ " reason=" + reason + " onCompletedMsg=" + onCompletedMsg);
}
sendMessage(DataConnection.EVENT_DISCONNECT,
new DisconnectParams(apnContext, reason, onCompletedMsg));
|
public void | tearDownAll(java.lang.String reason, android.os.Message onCompletedMsg)Tear down the connection through the apn on the network. Ignores refcount and
and always tears down.
if (DBG) log("tearDownAll: reason=" + reason + " onCompletedMsg=" + onCompletedMsg);
sendMessage(DataConnection.EVENT_DISCONNECT_ALL,
new DisconnectParams(null, reason, onCompletedMsg));
|
public java.lang.String | toString()
return mDc.getName();
|