FileDocCategorySizeDatePackage
StkCmdMessage.javaAPI DocAndroid 1.5 API5454Wed May 06 22:42:02 BST 2009com.android.internal.telephony.gsm.stk

StkCmdMessage

public class StkCmdMessage extends Object implements android.os.Parcelable
Class used to pass STK messages from telephony to application. Application should call getXXX() to get commands's specific values.

Fields Summary
CommandDetails
mCmdDet
private TextMessage
mTextMsg
private Menu
mMenu
private Input
mInput
private BrowserSettings
mBrowserSettings
private ToneSettings
mToneSettings
private CallSettings
mCallSettings
public static final Parcelable.Creator
CREATOR
Constructors Summary
StkCmdMessage(CommandParams cmdParams)

    

      
        mCmdDet = cmdParams.cmdDet;
        switch(getCmdType()) {
        case SET_UP_MENU:
        case SELECT_ITEM:
            mMenu = ((SelectItemParams) cmdParams).menu;
            break;
        case DISPLAY_TEXT:
        case SET_UP_IDLE_MODE_TEXT:
        case SEND_DTMF:
        case SEND_SMS:
        case SEND_SS:
        case SEND_USSD:
            mTextMsg = ((DisplayTextParams) cmdParams).textMsg;
            break;
        case GET_INPUT:
        case GET_INKEY:
            mInput = ((GetInputParams) cmdParams).input;
            break;
        case LAUNCH_BROWSER:
            mTextMsg = ((LaunchBrowserParams) cmdParams).confirmMsg;
            mBrowserSettings = new BrowserSettings();
            mBrowserSettings.url = ((LaunchBrowserParams) cmdParams).url;
            mBrowserSettings.mode = ((LaunchBrowserParams) cmdParams).mode;
            break;
        case PLAY_TONE:
            PlayToneParams params = (PlayToneParams) cmdParams;
            mToneSettings = params.settings;
            mTextMsg = params.textMsg;
            break;
        case SET_UP_CALL:
            mCallSettings = new CallSettings();
            mCallSettings.confirmMsg = ((CallSetupParams) cmdParams).confirmMsg;
            mCallSettings.callMsg = ((CallSetupParams) cmdParams).callMsg;
            break;
        }
    
public StkCmdMessage(android.os.Parcel in)

        mCmdDet = in.readParcelable(null);
        mTextMsg = in.readParcelable(null);
        mMenu = in.readParcelable(null);
        mInput = in.readParcelable(null);
        switch (getCmdType()) {
        case LAUNCH_BROWSER:
            mBrowserSettings = new BrowserSettings();
            mBrowserSettings.url = in.readString();
            mBrowserSettings.mode = LaunchBrowserMode.values()[in.readInt()];
            break;
        case PLAY_TONE:
            mToneSettings = in.readParcelable(null);
            break;
        case SET_UP_CALL:
            mCallSettings = new CallSettings();
            mCallSettings.confirmMsg = in.readParcelable(null);
            mCallSettings.callMsg = in.readParcelable(null);
            break;
        }
    
Methods Summary
public intdescribeContents()


       
        return 0;
    
public InputgeInput()

        return mInput;
    
public TextMessagegeTextMessage()

        return mTextMsg;
    
public com.android.internal.telephony.gsm.stk.StkCmdMessage$BrowserSettingsgetBrowserSettings()

        return mBrowserSettings;
    
public com.android.internal.telephony.gsm.stk.StkCmdMessage$CallSettingsgetCallSettings()

        return mCallSettings;
    
public AppInterface.CommandTypegetCmdType()

        return AppInterface.CommandType.fromInt(mCmdDet.typeOfCommand);
    
public MenugetMenu()

        return mMenu;
    
public ToneSettingsgetToneSettings()

        return mToneSettings;
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

        dest.writeParcelable(mCmdDet, 0);
        dest.writeParcelable(mTextMsg, 0);
        dest.writeParcelable(mMenu, 0);
        dest.writeParcelable(mInput, 0);
        switch(getCmdType()) {
        case LAUNCH_BROWSER:
            dest.writeString(mBrowserSettings.url);
            dest.writeInt(mBrowserSettings.mode.ordinal());
            break;
        case PLAY_TONE:
            dest.writeParcelable(mToneSettings, 0);
            break;
        case SET_UP_CALL:
            dest.writeParcelable(mCallSettings.confirmMsg, 0);
            dest.writeParcelable(mCallSettings.callMsg, 0);
            break;
        }