FileDocCategorySizeDatePackage
DcSwitchAsyncChannel.javaAPI DocAndroid 5.1 API7315Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony.dataconnection

DcSwitchAsyncChannel

public class DcSwitchAsyncChannel extends com.android.internal.util.AsyncChannel

Fields Summary
private static final boolean
DBG
private static final boolean
VDBG
private static final String
LOG_TAG
private int
tagId
private DcSwitchStateMachine
mDcSwitchState
private static final int
BASE
static final int
REQ_CONNECT
static final int
RSP_CONNECT
static final int
REQ_DISCONNECT
static final int
RSP_DISCONNECT
static final int
REQ_DISCONNECT_ALL
static final int
RSP_DISCONNECT_ALL
static final int
REQ_IS_IDLE_STATE
static final int
RSP_IS_IDLE_STATE
static final int
REQ_IS_IDLE_OR_DETACHING_STATE
static final int
RSP_IS_IDLE_OR_DETACHING_STATE
static final int
EVENT_DATA_ATTACHED
static final int
EVENT_DATA_DETACHED
private static final int
CMD_TO_STRING_COUNT
private static String[]
sCmdToString
Constructors Summary
public DcSwitchAsyncChannel(DcSwitchStateMachine dcSwitchState, int id)

        mDcSwitchState = dcSwitchState;
        tagId = id;
    
Methods Summary
protected static java.lang.StringcmdToString(int cmd)

        cmd -= BASE;
        if ((cmd >= 0) && (cmd < sCmdToString.length)) {
            return sCmdToString[cmd];
        } else {
            return AsyncChannel.cmdToString(cmd + BASE);
        }
    
public intconnectSync(com.android.internal.telephony.dataconnection.DcSwitchAsyncChannel$RequestInfo apnRequest)

        Message response = sendMessageSynchronously(REQ_CONNECT, apnRequest);
        if ((response != null) && (response.what == RSP_CONNECT)) {
            return rspConnect(response);
        } else {
            if (DBG) log("rspConnect error response=" + response);
            return PhoneConstants.APN_REQUEST_FAILED;
        }
    
public intdisconnectAllSync()

        Message response = sendMessageSynchronously(REQ_DISCONNECT_ALL);
        if ((response != null) && (response.what == RSP_DISCONNECT_ALL)) {
            return rspDisconnectAll(response);
        } else {
            if (DBG) log("rspDisconnectAll error response=" + response);
            return PhoneConstants.APN_REQUEST_FAILED;
        }
    
public intdisconnectSync(com.android.internal.telephony.dataconnection.DcSwitchAsyncChannel$RequestInfo apnRequest)

        Message response = sendMessageSynchronously(REQ_DISCONNECT, apnRequest);
        if ((response != null) && (response.what == RSP_DISCONNECT)) {
            return rspDisconnect(response);
        } else {
            if (DBG) log("rspDisconnect error response=" + response);
            return PhoneConstants.APN_REQUEST_FAILED;
        }
    
public booleanisIdleOrDetachingSync()

        Message response = sendMessageSynchronously(REQ_IS_IDLE_OR_DETACHING_STATE);
        if ((response != null) && (response.what == RSP_IS_IDLE_OR_DETACHING_STATE)) {
            return rspIsIdleOrDetaching(response);
        } else {
            if (DBG) log("rspIsIdleOrDetaching error response=" + response);
            return false;
        }
    
public booleanisIdleSync()

        Message response = sendMessageSynchronously(REQ_IS_IDLE_STATE);
        if ((response != null) && (response.what == RSP_IS_IDLE_STATE)) {
            return rspIsIdle(response);
        } else {
            if (DBG) log("rspIsIndle error response=" + response);
            return false;
        }
    
private voidlog(java.lang.String s)

        Rlog.d(LOG_TAG, "[DcSwitchAsyncChannel-" + tagId + "]: " + s);
    
public voidnotifyDataAttached()

        sendMessage(EVENT_DATA_ATTACHED);
        if (DBG) log("notifyDataAttached");
    
public voidnotifyDataDetached()

        sendMessage(EVENT_DATA_DETACHED);
        if (DBG) log("EVENT_DATA_DETACHED");
    
public voidreqIsIdleOrDetaching()

        sendMessage(REQ_IS_IDLE_OR_DETACHING_STATE);
        if (DBG) log("reqIsIdleOrDetaching");
    
private intrspConnect(android.os.Message response)

        int retVal = response.arg1;
        if (DBG) log("rspConnect=" + retVal);
        return retVal;
    
private intrspDisconnect(android.os.Message response)

        int retVal = response.arg1;
        if (DBG) log("rspDisconnect=" + retVal);
        return retVal;
    
private intrspDisconnectAll(android.os.Message response)

        int retVal = response.arg1;
        if (DBG) log("rspDisconnectAll=" + retVal);
        return retVal;
    
private booleanrspIsIdle(android.os.Message response)

        boolean retVal = response.arg1 == 1;
        if (DBG) log("rspIsIdle=" + retVal);
        return retVal;
    
public booleanrspIsIdleOrDetaching(android.os.Message response)

        boolean retVal = response.arg1 == 1;
        if (DBG) log("rspIsIdleOrDetaching=" + retVal);
        return retVal;
    
public java.lang.StringtoString()

        return mDcSwitchState.getName();