FileDocCategorySizeDatePackage
UsimDataDownloadCommands.javaAPI DocAndroid 5.1 API19505Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony.gsm

UsimDataDownloadCommands

public class UsimDataDownloadCommands extends com.android.internal.telephony.BaseCommands
Dummy BaseCommands for UsimDataDownloadTest. Only implements UICC envelope and SMS acknowledgement commands.

Fields Summary
private static final String
TAG
private boolean
mExpectingAcknowledgeGsmSms
private boolean
mExpectingAcknowledgeGsmSmsSuccess
private int
mExpectingAcknowledgeGsmSmsFailureCause
private String
mExpectingAcknowledgeGsmSmsPdu
private boolean
mExpectingSendEnvelope
private String
mExpectingSendEnvelopeContents
private int
mExpectingSendEnvelopeResponseSw1
private int
mExpectingSendEnvelopeResponseSw2
private String
mExpectingSendEnvelopeResponse
Constructors Summary
UsimDataDownloadCommands(android.content.Context context)

  // Response string for Send Envelope

      
        super(context);
    
Methods Summary
public voidacceptCall(android.os.Message result)

    
public synchronized voidacknowledgeIncomingGsmSmsWithPdu(boolean success, java.lang.String ackPdu, android.os.Message response)

        Rlog.d(TAG, "acknowledgeLastIncomingGsmSmsWithPdu: success=" + success
                + ", ackPDU= " + ackPdu);
        Assert.assertTrue("unexpected call to acknowledge SMS", mExpectingAcknowledgeGsmSms);
        Assert.assertEquals(mExpectingAcknowledgeGsmSmsSuccess, success);
        Assert.assertEquals(mExpectingAcknowledgeGsmSmsPdu, ackPdu);
        mExpectingAcknowledgeGsmSms = false;
        if (response != null) {
            AsyncResult.forMessage(response);
            response.sendToTarget();
        }
        notifyAll();    // wake up assertExpectedMethodsCalled()
    
public voidacknowledgeLastIncomingCdmaSms(boolean success, int cause, android.os.Message response)

    
public synchronized voidacknowledgeLastIncomingGsmSms(boolean success, int cause, android.os.Message response)

        Rlog.d(TAG, "acknowledgeLastIncomingGsmSms: success=" + success + ", cause=" + cause);
        Assert.assertTrue("unexpected call to acknowledge SMS", mExpectingAcknowledgeGsmSms);
        Assert.assertEquals(mExpectingAcknowledgeGsmSmsSuccess, success);
        Assert.assertEquals(mExpectingAcknowledgeGsmSmsFailureCause, cause);
        mExpectingAcknowledgeGsmSms = false;
        if (response != null) {
            AsyncResult.forMessage(response);
            response.sendToTarget();
        }
        notifyAll();    // wake up assertExpectedMethodsCalled()
    
synchronized voidassertExpectedMethodsCalled()

        long stopTime = SystemClock.elapsedRealtime() + 5000;
        while ((mExpectingAcknowledgeGsmSms || mExpectingSendEnvelope)
                && SystemClock.elapsedRealtime() < stopTime) {
            try {
                wait();
            } catch (InterruptedException ignored) {}
        }
        Assert.assertFalse("expecting SMS acknowledge call", mExpectingAcknowledgeGsmSms);
        Assert.assertFalse("expecting send envelope call", mExpectingSendEnvelope);
    
public voidcancelPendingUssd(android.os.Message response)

    
public voidchangeBarringPassword(java.lang.String facility, java.lang.String oldPwd, java.lang.String newPwd, android.os.Message result)

    
public voidchangeIccPin(java.lang.String oldPin, java.lang.String newPin, android.os.Message result)

    
public voidchangeIccPin2(java.lang.String oldPin2, java.lang.String newPin2, android.os.Message result)

    
public voidchangeIccPin2ForApp(java.lang.String oldPin2, java.lang.String newPin2, java.lang.String aidPtr, android.os.Message result)

    
public voidchangeIccPinForApp(java.lang.String oldPin, java.lang.String newPin, java.lang.String aidPtr, android.os.Message result)

    
public voidconference(android.os.Message result)

    
public voiddeactivateDataCall(int cid, int reason, android.os.Message result)

    
public voiddeleteSmsOnRuim(int index, android.os.Message response)

    
public voiddeleteSmsOnSim(int index, android.os.Message response)

    
public voiddial(java.lang.String address, int clirMode, android.os.Message result)

    
public voiddial(java.lang.String address, int clirMode, com.android.internal.telephony.UUSInfo uusInfo, android.os.Message result)

    
public voidexitEmergencyCallbackMode(android.os.Message response)

    
synchronized voidexpectAcknowledgeGsmSms(boolean success, int cause)
Expect a call to acknowledgeLastIncomingGsmSms with success flag and failure cause.

param
success true if expecting success; false if expecting failure
param
cause the failure cause, if success is false

        Assert.assertFalse("expectAcknowledgeGsmSms called twice", mExpectingAcknowledgeGsmSms);
        mExpectingAcknowledgeGsmSms = true;
        mExpectingAcknowledgeGsmSmsSuccess = success;
        mExpectingAcknowledgeGsmSmsFailureCause = cause;
    
synchronized voidexpectAcknowledgeGsmSmsWithPdu(boolean success, java.lang.String ackPdu)
Expect a call to acknowledgeLastIncomingGsmSmsWithPdu with success flag and PDU.

param
success true if expecting success; false if expecting failure
param
ackPdu the acknowledgement PDU to expect

        Assert.assertFalse("expectAcknowledgeGsmSms called twice", mExpectingAcknowledgeGsmSms);
        mExpectingAcknowledgeGsmSms = true;
        mExpectingAcknowledgeGsmSmsSuccess = success;
        mExpectingAcknowledgeGsmSmsPdu = ackPdu;
    
synchronized voidexpectSendEnvelope(java.lang.String contents, int sw1, int sw2, java.lang.String response)
Expect a call to sendEnvelopeWithStatus().

param
contents expected envelope contents to send
param
sw1 simulated SW1 status to return
param
sw2 simulated SW2 status to return
param
response simulated envelope response to return

        Assert.assertFalse("expectSendEnvelope called twice", mExpectingSendEnvelope);
        mExpectingSendEnvelope = true;
        mExpectingSendEnvelopeContents = contents;
        mExpectingSendEnvelopeResponseSw1 = sw1;
        mExpectingSendEnvelopeResponseSw2 = sw2;
        mExpectingSendEnvelopeResponse = response;
    
public voidexplicitCallTransfer(android.os.Message result)

    
public voidgetAvailableNetworks(android.os.Message response)

    
public voidgetBasebandVersion(android.os.Message response)

    
public voidgetCDMASubscription(android.os.Message response)

    
public voidgetCLIR(android.os.Message response)

    
public voidgetCdmaBroadcastConfig(android.os.Message result)

    
public voidgetCdmaSubscriptionSource(android.os.Message response)

    
public voidgetCellInfoList(android.os.Message result)

    
public voidgetCurrentCalls(android.os.Message result)

    
public voidgetDataCallList(android.os.Message result)

    
public voidgetDataRegistrationState(android.os.Message response)

    
public voidgetDeviceIdentity(android.os.Message response)

    
public voidgetGsmBroadcastConfig(android.os.Message response)

    
public voidgetIMEI(android.os.Message result)

    
public voidgetIMEISV(android.os.Message result)

    
public voidgetIMSI(android.os.Message result)

    
public voidgetIMSIForApp(java.lang.String aid, android.os.Message result)

    
public voidgetIccCardStatus(android.os.Message result)

    
public voidgetImsRegistrationState(android.os.Message result)

    
public voidgetLastCallFailCause(android.os.Message result)

    
public voidgetLastDataCallFailCause(android.os.Message result)

    
public voidgetLastPdpFailCause(android.os.Message result)

    
public voidgetMute(android.os.Message response)

    
public voidgetNeighboringCids(android.os.Message response)

    
public voidgetNetworkSelectionMode(android.os.Message response)

    
public voidgetOperator(android.os.Message response)

    
public voidgetPDPContextList(android.os.Message result)

    
public voidgetPreferredNetworkType(android.os.Message response)

    
public voidgetPreferredVoicePrivacy(android.os.Message result)

    
public voidgetSignalStrength(android.os.Message response)

    
public voidgetSmscAddress(android.os.Message result)

    
public voidgetVoiceRadioTechnology(android.os.Message response)

    
public voidgetVoiceRegistrationState(android.os.Message response)

    
public voidhandleCallSetupRequestFromSim(boolean accept, android.os.Message response)

    
public voidhangupConnection(int gsmIndex, android.os.Message result)

    
public voidhangupForegroundResumeBackground(android.os.Message result)

    
public voidhangupWaitingOrBackground(android.os.Message result)

    
public voidiccCloseLogicalChannel(int channel, android.os.Message response)

    
public voidiccIO(int command, int fileid, java.lang.String path, int p1, int p2, int p3, java.lang.String data, java.lang.String pin2, android.os.Message response)

    
public voidiccIOForApp(int command, int fileid, java.lang.String path, int p1, int p2, int p3, java.lang.String data, java.lang.String pin2, java.lang.String aid, android.os.Message response)

    
public voidiccOpenLogicalChannel(java.lang.String AID, android.os.Message response)

    
public voidiccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, java.lang.String data, android.os.Message response)

    
public voidiccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, java.lang.String data, android.os.Message response)

    
public voidinvokeOemRilRequestRaw(byte[] data, android.os.Message response)

    
public voidinvokeOemRilRequestStrings(java.lang.String[] strings, android.os.Message response)

    
public voidnvReadItem(int itemID, android.os.Message response)

    
public voidnvResetConfig(int resetType, android.os.Message response)

    
public voidnvWriteCdmaPrl(byte[] preferredRoamingList, android.os.Message response)

    
public voidnvWriteItem(int itemID, java.lang.String itemValue, android.os.Message response)

    
public voidqueryAvailableBandMode(android.os.Message response)

    
public voidqueryCLIP(android.os.Message response)

    
public voidqueryCallForwardStatus(int cfReason, int serviceClass, java.lang.String number, android.os.Message response)

    
public voidqueryCallWaiting(int serviceClass, android.os.Message response)

    
public voidqueryCdmaRoamingPreference(android.os.Message response)

    
public voidqueryFacilityLock(java.lang.String facility, java.lang.String password, int serviceClass, android.os.Message response)

    
public voidqueryFacilityLockForApp(java.lang.String facility, java.lang.String password, int serviceClass, java.lang.String appId, android.os.Message response)

    
public voidqueryTTYMode(android.os.Message response)

    
public voidrejectCall(android.os.Message result)

    
public voidreportSmsMemoryStatus(boolean available, android.os.Message result)

    
public voidreportStkServiceIsRunning(android.os.Message result)

    
public voidrequestIccSimAuthentication(java.lang.String data, android.os.Message response)

    
public voidrequestIsimAuthentication(java.lang.String nonce, android.os.Message response)

    
public voidresetRadio(android.os.Message result)

    
public voidsendBurstDtmf(java.lang.String dtmfString, int on, int off, android.os.Message result)

    
public voidsendCDMAFeatureCode(java.lang.String FeatureCode, android.os.Message response)

    
public voidsendCdmaSms(byte[] pdu, android.os.Message response)

    
public voidsendDtmf(char c, android.os.Message result)

    
public voidsendEnvelope(java.lang.String contents, android.os.Message response)

    
public synchronized voidsendEnvelopeWithStatus(java.lang.String contents, android.os.Message response)

        // Add spaces between hex bytes for readability
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < contents.length(); i += 2) {
            builder.append(contents.charAt(i)).append(contents.charAt(i+1)).append(' ");
        }
        Rlog.d(TAG, "sendEnvelopeWithStatus: " + builder.toString());

        Assert.assertTrue("unexpected call to send envelope", mExpectingSendEnvelope);
        Assert.assertEquals(mExpectingSendEnvelopeContents, contents);
        mExpectingSendEnvelope = false;

        IccIoResult result = new IccIoResult(mExpectingSendEnvelopeResponseSw1,
                mExpectingSendEnvelopeResponseSw2, mExpectingSendEnvelopeResponse);

        if (response != null) {
            AsyncResult.forMessage(response, result, null);
            response.sendToTarget();
        }
        notifyAll();    // wake up assertExpectedMethodsCalled()
    
public voidsendImsCdmaSms(byte[] pdu, int retry, int messageRef, android.os.Message response)

    
public voidsendImsGsmSms(java.lang.String smscPDU, java.lang.String pdu, int retry, int messageRef, android.os.Message response)

    
public voidsendSMS(java.lang.String smscPDU, java.lang.String pdu, android.os.Message response)

    
public voidsendSMSExpectMore(java.lang.String smscPDU, java.lang.String pdu, android.os.Message response)

    
public voidsendTerminalResponse(java.lang.String contents, android.os.Message response)

    
public voidsendUSSD(java.lang.String ussdString, android.os.Message response)

    
public voidseparateConnection(int gsmIndex, android.os.Message result)

    
public voidsetBandMode(int bandMode, android.os.Message response)

    
public voidsetCLIR(int clirMode, android.os.Message response)

    
public voidsetCallForward(int action, int cfReason, int serviceClass, java.lang.String number, int timeSeconds, android.os.Message response)

    
public voidsetCallWaiting(boolean enable, int serviceClass, android.os.Message response)

    
public voidsetCdmaBroadcastActivation(boolean activate, android.os.Message result)

    
public voidsetCdmaBroadcastConfig(com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo[] configs, android.os.Message response)

    
public voidsetCdmaRoamingPreference(int cdmaRoamingType, android.os.Message response)

    
public voidsetCdmaSubscriptionSource(int cdmaSubscriptionType, android.os.Message response)

    
public voidsetCellInfoListRate(int rateInMillis, android.os.Message response)

    
public voidsetDataProfile(DataProfile[] dps, android.os.Message result)

    
public voidsetFacilityLock(java.lang.String facility, boolean lockState, java.lang.String password, int serviceClass, android.os.Message response)

    
public voidsetFacilityLockForApp(java.lang.String facility, boolean lockState, java.lang.String password, int serviceClass, java.lang.String appId, android.os.Message response)

    
public voidsetGsmBroadcastActivation(boolean activate, android.os.Message result)

    
public voidsetGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, android.os.Message response)

    
public voidsetInitialAttachApn(java.lang.String apn, java.lang.String protocol, int authType, java.lang.String username, java.lang.String password, android.os.Message result)

    
public voidsetLocationUpdates(boolean enable, android.os.Message response)

    
public voidsetMute(boolean enableMute, android.os.Message response)

    
public voidsetNetworkSelectionModeAutomatic(android.os.Message response)

    
public voidsetNetworkSelectionModeManual(java.lang.String operatorNumeric, android.os.Message response)

    
public voidsetPhoneType(int phoneType)

    
public voidsetPreferredNetworkType(int networkType, android.os.Message response)

    
public voidsetPreferredVoicePrivacy(boolean enable, android.os.Message result)

    
public voidsetRadioPower(boolean on, android.os.Message response)

    
public voidsetSmscAddress(java.lang.String address, android.os.Message result)

    
public voidsetSuppServiceNotifications(boolean enable, android.os.Message result)

    
public voidsetTTYMode(int ttyMode, android.os.Message response)

    
public voidsetupDataCall(java.lang.String radioTechnology, java.lang.String profile, java.lang.String apn, java.lang.String user, java.lang.String password, java.lang.String authType, java.lang.String protocol, android.os.Message result)

    
public voidstartDtmf(char c, android.os.Message result)

    
public voidstopDtmf(android.os.Message result)

    
public voidsupplyIccPin(java.lang.String pin, android.os.Message result)

    
public voidsupplyIccPin2(java.lang.String pin2, android.os.Message result)

    
public voidsupplyIccPin2ForApp(java.lang.String pin2, java.lang.String aid, android.os.Message result)

    
public voidsupplyIccPinForApp(java.lang.String pin, java.lang.String aid, android.os.Message result)

    
public voidsupplyIccPuk(java.lang.String puk, java.lang.String newPin, android.os.Message result)

    
public voidsupplyIccPuk2(java.lang.String puk2, java.lang.String newPin2, android.os.Message result)

    
public voidsupplyIccPuk2ForApp(java.lang.String puk2, java.lang.String newPin2, java.lang.String aid, android.os.Message result)

    
public voidsupplyIccPukForApp(java.lang.String puk, java.lang.String newPin, java.lang.String aid, android.os.Message result)

    
public voidsupplyNetworkDepersonalization(java.lang.String netpin, android.os.Message result)

    
public voidswitchWaitingOrHoldingAndActive(android.os.Message result)

    
public voidwriteSmsToRuim(int status, java.lang.String pdu, android.os.Message response)

    
public voidwriteSmsToSim(int status, java.lang.String smsc, java.lang.String pdu, android.os.Message response)