Home | History | Annotate | Download | only in telephony
      1 /*
      2  * Copyright (C) 2006 The Android Open Source Project
      3  * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
      4  *
      5  * Licensed under the Apache License, Version 2.0 (the "License");
      6  * you may not use this file except in compliance with the License.
      7  * You may obtain a copy of the License at
      8  *
      9  *      http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  */
     17 
     18 package com.android.internal.telephony;
     19 
     20 import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
     21 import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
     22 import com.android.internal.telephony.uicc.IccCardStatus;
     23 
     24 import android.os.Message;
     25 import android.os.Handler;
     26 
     27 /**
     28  * {@hide}
     29  */
     30 public interface CommandsInterface {
     31     enum RadioState {
     32         RADIO_OFF,         /* Radio explicitly powered off (eg CFUN=0) */
     33         RADIO_UNAVAILABLE, /* Radio unavailable (eg, resetting or not booted) */
     34         RADIO_ON;          /* Radio is on */
     35 
     36         public boolean isOn() /* and available...*/ {
     37             return this == RADIO_ON;
     38         }
     39 
     40         public boolean isAvailable() {
     41             return this != RADIO_UNAVAILABLE;
     42         }
     43     }
     44 
     45     //***** Constants
     46 
     47     // Used as parameter to dial() and setCLIR() below
     48     static final int CLIR_DEFAULT = 0;      // "use subscription default value"
     49     static final int CLIR_INVOCATION = 1;   // (restrict CLI presentation)
     50     static final int CLIR_SUPPRESSION = 2;  // (allow CLI presentation)
     51 
     52 
     53     // Used as parameters for call forward methods below
     54     static final int CF_ACTION_DISABLE          = 0;
     55     static final int CF_ACTION_ENABLE           = 1;
     56 //  static final int CF_ACTION_UNUSED           = 2;
     57     static final int CF_ACTION_REGISTRATION     = 3;
     58     static final int CF_ACTION_ERASURE          = 4;
     59 
     60     static final int CF_REASON_UNCONDITIONAL    = 0;
     61     static final int CF_REASON_BUSY             = 1;
     62     static final int CF_REASON_NO_REPLY         = 2;
     63     static final int CF_REASON_NOT_REACHABLE    = 3;
     64     static final int CF_REASON_ALL              = 4;
     65     static final int CF_REASON_ALL_CONDITIONAL  = 5;
     66 
     67     // Used for call barring methods below
     68     static final String CB_FACILITY_BAOC         = "AO";
     69     static final String CB_FACILITY_BAOIC        = "OI";
     70     static final String CB_FACILITY_BAOICxH      = "OX";
     71     static final String CB_FACILITY_BAIC         = "AI";
     72     static final String CB_FACILITY_BAICr        = "IR";
     73     static final String CB_FACILITY_BA_ALL       = "AB";
     74     static final String CB_FACILITY_BA_MO        = "AG";
     75     static final String CB_FACILITY_BA_MT        = "AC";
     76     static final String CB_FACILITY_BA_SIM       = "SC";
     77     static final String CB_FACILITY_BA_FD        = "FD";
     78 
     79 
     80     // Used for various supp services apis
     81     // See 27.007 +CCFC or +CLCK
     82     static final int SERVICE_CLASS_NONE     = 0; // no user input
     83     static final int SERVICE_CLASS_VOICE    = (1 << 0);
     84     static final int SERVICE_CLASS_DATA     = (1 << 1); //synonym for 16+32+64+128
     85     static final int SERVICE_CLASS_FAX      = (1 << 2);
     86     static final int SERVICE_CLASS_SMS      = (1 << 3);
     87     static final int SERVICE_CLASS_DATA_SYNC = (1 << 4);
     88     static final int SERVICE_CLASS_DATA_ASYNC = (1 << 5);
     89     static final int SERVICE_CLASS_PACKET   = (1 << 6);
     90     static final int SERVICE_CLASS_PAD      = (1 << 7);
     91     static final int SERVICE_CLASS_MAX      = (1 << 7); // Max SERVICE_CLASS value
     92 
     93     // Numeric representation of string values returned
     94     // by messages sent to setOnUSSD handler
     95     static final int USSD_MODE_NOTIFY       = 0;
     96     static final int USSD_MODE_REQUEST      = 1;
     97 
     98     // GSM SMS fail cause for acknowledgeLastIncomingSMS. From TS 23.040, 9.2.3.22.
     99     static final int GSM_SMS_FAIL_CAUSE_MEMORY_CAPACITY_EXCEEDED    = 0xD3;
    100     static final int GSM_SMS_FAIL_CAUSE_USIM_APP_TOOLKIT_BUSY       = 0xD4;
    101     static final int GSM_SMS_FAIL_CAUSE_USIM_DATA_DOWNLOAD_ERROR    = 0xD5;
    102     static final int GSM_SMS_FAIL_CAUSE_UNSPECIFIED_ERROR           = 0xFF;
    103 
    104     // CDMA SMS fail cause for acknowledgeLastIncomingCdmaSms.  From TS N.S0005, 6.5.2.125.
    105     static final int CDMA_SMS_FAIL_CAUSE_INVALID_TELESERVICE_ID     = 4;
    106     static final int CDMA_SMS_FAIL_CAUSE_RESOURCE_SHORTAGE          = 35;
    107     static final int CDMA_SMS_FAIL_CAUSE_OTHER_TERMINAL_PROBLEM     = 39;
    108     static final int CDMA_SMS_FAIL_CAUSE_ENCODING_PROBLEM           = 96;
    109 
    110     //***** Methods
    111     RadioState getRadioState();
    112 
    113     /**
    114      * response.obj.result is an int[2]
    115      *
    116      * response.obj.result[0] is registration state
    117      *                        0 - Not registered
    118      *                        1 - Registered
    119      * response.obj.result[1] is of type const RIL_IMS_SMS_Format,
    120      *                        corresponds to sms format used for SMS over IMS.
    121      */
    122     void getImsRegistrationState(Message result);
    123 
    124     /**
    125      * Fires on any RadioState transition
    126      * Always fires immediately as well
    127      *
    128      * do not attempt to calculate transitions by storing getRadioState() values
    129      * on previous invocations of this notification. Instead, use the other
    130      * registration methods
    131      */
    132     void registerForRadioStateChanged(Handler h, int what, Object obj);
    133     void unregisterForRadioStateChanged(Handler h);
    134 
    135     void registerForVoiceRadioTechChanged(Handler h, int what, Object obj);
    136     void unregisterForVoiceRadioTechChanged(Handler h);
    137     void registerForImsNetworkStateChanged(Handler h, int what, Object obj);
    138     void unregisterForImsNetworkStateChanged(Handler h);
    139 
    140     /**
    141      * Fires on any transition into RadioState.isOn()
    142      * Fires immediately if currently in that state
    143      * In general, actions should be idempotent. State may change
    144      * before event is received.
    145      */
    146     void registerForOn(Handler h, int what, Object obj);
    147     void unregisterForOn(Handler h);
    148 
    149     /**
    150      * Fires on any transition out of RadioState.isAvailable()
    151      * Fires immediately if currently in that state
    152      * In general, actions should be idempotent. State may change
    153      * before event is received.
    154      */
    155     void registerForAvailable(Handler h, int what, Object obj);
    156     void unregisterForAvailable(Handler h);
    157 
    158     /**
    159      * Fires on any transition into !RadioState.isAvailable()
    160      * Fires immediately if currently in that state
    161      * In general, actions should be idempotent. State may change
    162      * before event is received.
    163      */
    164     void registerForNotAvailable(Handler h, int what, Object obj);
    165     void unregisterForNotAvailable(Handler h);
    166 
    167     /**
    168      * Fires on any transition into RADIO_OFF or !RadioState.isAvailable()
    169      * Fires immediately if currently in that state
    170      * In general, actions should be idempotent. State may change
    171      * before event is received.
    172      */
    173     void registerForOffOrNotAvailable(Handler h, int what, Object obj);
    174     void unregisterForOffOrNotAvailable(Handler h);
    175 
    176     /**
    177      * Fires on any change in ICC status
    178      */
    179     void registerForIccStatusChanged(Handler h, int what, Object obj);
    180     void unregisterForIccStatusChanged(Handler h);
    181 
    182     void registerForCallStateChanged(Handler h, int what, Object obj);
    183     void unregisterForCallStateChanged(Handler h);
    184     void registerForVoiceNetworkStateChanged(Handler h, int what, Object obj);
    185     void unregisterForVoiceNetworkStateChanged(Handler h);
    186     void registerForDataNetworkStateChanged(Handler h, int what, Object obj);
    187     void unregisterForDataNetworkStateChanged(Handler h);
    188 
    189     /** InCall voice privacy notifications */
    190     void registerForInCallVoicePrivacyOn(Handler h, int what, Object obj);
    191     void unregisterForInCallVoicePrivacyOn(Handler h);
    192     void registerForInCallVoicePrivacyOff(Handler h, int what, Object obj);
    193     void unregisterForInCallVoicePrivacyOff(Handler h);
    194 
    195     /**
    196      * unlike the register* methods, there's only one new 3GPP format SMS handler.
    197      * if you need to unregister, you should also tell the radio to stop
    198      * sending SMS's to you (via AT+CNMI)
    199      *
    200      * AsyncResult.result is a String containing the SMS PDU
    201      */
    202     void setOnNewGsmSms(Handler h, int what, Object obj);
    203     void unSetOnNewGsmSms(Handler h);
    204 
    205     /**
    206      * unlike the register* methods, there's only one new 3GPP2 format SMS handler.
    207      * if you need to unregister, you should also tell the radio to stop
    208      * sending SMS's to you (via AT+CNMI)
    209      *
    210      * AsyncResult.result is a String containing the SMS PDU
    211      */
    212     void setOnNewCdmaSms(Handler h, int what, Object obj);
    213     void unSetOnNewCdmaSms(Handler h);
    214 
    215     /**
    216      * Set the handler for SMS Cell Broadcast messages.
    217      *
    218      * AsyncResult.result is a byte array containing the SMS-CB PDU
    219      */
    220     void setOnNewGsmBroadcastSms(Handler h, int what, Object obj);
    221     void unSetOnNewGsmBroadcastSms(Handler h);
    222 
    223     /**
    224      * Register for NEW_SMS_ON_SIM unsolicited message
    225      *
    226      * AsyncResult.result is an int array containing the index of new SMS
    227      */
    228     void setOnSmsOnSim(Handler h, int what, Object obj);
    229     void unSetOnSmsOnSim(Handler h);
    230 
    231     /**
    232      * Register for NEW_SMS_STATUS_REPORT unsolicited message
    233      *
    234      * AsyncResult.result is a String containing the status report PDU
    235      */
    236     void setOnSmsStatus(Handler h, int what, Object obj);
    237     void unSetOnSmsStatus(Handler h);
    238 
    239     /**
    240      * unlike the register* methods, there's only one NITZ time handler
    241      *
    242      * AsyncResult.result is an Object[]
    243      * ((Object[])AsyncResult.result)[0] is a String containing the NITZ time string
    244      * ((Object[])AsyncResult.result)[1] is a Long containing the milliseconds since boot as
    245      *                                   returned by elapsedRealtime() when this NITZ time
    246      *                                   was posted.
    247      *
    248      * Please note that the delivery of this message may be delayed several
    249      * seconds on system startup
    250      */
    251     void setOnNITZTime(Handler h, int what, Object obj);
    252     void unSetOnNITZTime(Handler h);
    253 
    254     /**
    255      * unlike the register* methods, there's only one USSD notify handler
    256      *
    257      * Represents the arrival of a USSD "notify" message, which may
    258      * or may not have been triggered by a previous USSD send
    259      *
    260      * AsyncResult.result is a String[]
    261      * ((String[])(AsyncResult.result))[0] contains status code
    262      *      "0"   USSD-Notify -- text in ((const char **)data)[1]
    263      *      "1"   USSD-Request -- text in ((const char **)data)[1]
    264      *      "2"   Session terminated by network
    265      *      "3"   other local client (eg, SIM Toolkit) has responded
    266      *      "4"   Operation not supported
    267      *      "5"   Network timeout
    268      *
    269      * ((String[])(AsyncResult.result))[1] contains the USSD message
    270      * The numeric representations of these are in USSD_MODE_*
    271      */
    272 
    273     void setOnUSSD(Handler h, int what, Object obj);
    274     void unSetOnUSSD(Handler h);
    275 
    276     /**
    277      * unlike the register* methods, there's only one signal strength handler
    278      * AsyncResult.result is an int[2]
    279      * response.obj.result[0] is received signal strength (0-31, 99)
    280      * response.obj.result[1] is  bit error rate (0-7, 99)
    281      * as defined in TS 27.007 8.5
    282      */
    283 
    284     void setOnSignalStrengthUpdate(Handler h, int what, Object obj);
    285     void unSetOnSignalStrengthUpdate(Handler h);
    286 
    287     /**
    288      * Sets the handler for SIM/RUIM SMS storage full unsolicited message.
    289      * Unlike the register* methods, there's only one notification handler
    290      *
    291      * @param h Handler for notification message.
    292      * @param what User-defined message code.
    293      * @param obj User object.
    294      */
    295     void setOnIccSmsFull(Handler h, int what, Object obj);
    296     void unSetOnIccSmsFull(Handler h);
    297 
    298     /**
    299      * Sets the handler for SIM Refresh notifications.
    300      *
    301      * @param h Handler for notification message.
    302      * @param what User-defined message code.
    303      * @param obj User object.
    304      */
    305     void registerForIccRefresh(Handler h, int what, Object obj);
    306     void unregisterForIccRefresh(Handler h);
    307 
    308     void setOnIccRefresh(Handler h, int what, Object obj);
    309     void unsetOnIccRefresh(Handler h);
    310 
    311     /**
    312      * Sets the handler for RING notifications.
    313      * Unlike the register* methods, there's only one notification handler
    314      *
    315      * @param h Handler for notification message.
    316      * @param what User-defined message code.
    317      * @param obj User object.
    318      */
    319     void setOnCallRing(Handler h, int what, Object obj);
    320     void unSetOnCallRing(Handler h);
    321 
    322     /**
    323      * Sets the handler for RESTRICTED_STATE changed notification,
    324      * eg, for Domain Specific Access Control
    325      * unlike the register* methods, there's only one signal strength handler
    326      *
    327      * AsyncResult.result is an int[1]
    328      * response.obj.result[0] is a bitmask of RIL_RESTRICTED_STATE_* values
    329      */
    330 
    331     void setOnRestrictedStateChanged(Handler h, int what, Object obj);
    332     void unSetOnRestrictedStateChanged(Handler h);
    333 
    334     /**
    335      * Sets the handler for Supplementary Service Notifications.
    336      * Unlike the register* methods, there's only one notification handler
    337      *
    338      * @param h Handler for notification message.
    339      * @param what User-defined message code.
    340      * @param obj User object.
    341      */
    342     void setOnSuppServiceNotification(Handler h, int what, Object obj);
    343     void unSetOnSuppServiceNotification(Handler h);
    344 
    345     /**
    346      * Sets the handler for Session End Notifications for CAT.
    347      * Unlike the register* methods, there's only one notification handler
    348      *
    349      * @param h Handler for notification message.
    350      * @param what User-defined message code.
    351      * @param obj User object.
    352      */
    353     void setOnCatSessionEnd(Handler h, int what, Object obj);
    354     void unSetOnCatSessionEnd(Handler h);
    355 
    356     /**
    357      * Sets the handler for Proactive Commands for CAT.
    358      * Unlike the register* methods, there's only one notification handler
    359      *
    360      * @param h Handler for notification message.
    361      * @param what User-defined message code.
    362      * @param obj User object.
    363      */
    364     void setOnCatProactiveCmd(Handler h, int what, Object obj);
    365     void unSetOnCatProactiveCmd(Handler h);
    366 
    367     /**
    368      * Sets the handler for Event Notifications for CAT.
    369      * Unlike the register* methods, there's only one notification handler
    370      *
    371      * @param h Handler for notification message.
    372      * @param what User-defined message code.
    373      * @param obj User object.
    374      */
    375     void setOnCatEvent(Handler h, int what, Object obj);
    376     void unSetOnCatEvent(Handler h);
    377 
    378     /**
    379      * Sets the handler for Call Set Up Notifications for CAT.
    380      * Unlike the register* methods, there's only one notification handler
    381      *
    382      * @param h Handler for notification message.
    383      * @param what User-defined message code.
    384      * @param obj User object.
    385      */
    386     void setOnCatCallSetUp(Handler h, int what, Object obj);
    387     void unSetOnCatCallSetUp(Handler h);
    388 
    389     /**
    390      * Enables/disbables supplementary service related notifications from
    391      * the network.
    392      *
    393      * @param enable true to enable notifications, false to disable.
    394      * @param result Message to be posted when command completes.
    395      */
    396     void setSuppServiceNotifications(boolean enable, Message result);
    397     //void unSetSuppServiceNotifications(Handler h);
    398 
    399     /**
    400      * Sets the handler for Event Notifications for CDMA Display Info.
    401      * Unlike the register* methods, there's only one notification handler
    402      *
    403      * @param h Handler for notification message.
    404      * @param what User-defined message code.
    405      * @param obj User object.
    406      */
    407     void registerForDisplayInfo(Handler h, int what, Object obj);
    408     void unregisterForDisplayInfo(Handler h);
    409 
    410     /**
    411      * Sets the handler for Event Notifications for CallWaiting Info.
    412      * Unlike the register* methods, there's only one notification handler
    413      *
    414      * @param h Handler for notification message.
    415      * @param what User-defined message code.
    416      * @param obj User object.
    417      */
    418     void registerForCallWaitingInfo(Handler h, int what, Object obj);
    419     void unregisterForCallWaitingInfo(Handler h);
    420 
    421     /**
    422      * Sets the handler for Event Notifications for Signal Info.
    423      * Unlike the register* methods, there's only one notification handler
    424      *
    425      * @param h Handler for notification message.
    426      * @param what User-defined message code.
    427      * @param obj User object.
    428      */
    429     void registerForSignalInfo(Handler h, int what, Object obj);
    430     void unregisterForSignalInfo(Handler h);
    431 
    432     /**
    433      * Registers the handler for CDMA number information record
    434      * Unlike the register* methods, there's only one notification handler
    435      *
    436      * @param h Handler for notification message.
    437      * @param what User-defined message code.
    438      * @param obj User object.
    439      */
    440     void registerForNumberInfo(Handler h, int what, Object obj);
    441     void unregisterForNumberInfo(Handler h);
    442 
    443     /**
    444      * Registers the handler for CDMA redirected number Information record
    445      * Unlike the register* methods, there's only one notification handler
    446      *
    447      * @param h Handler for notification message.
    448      * @param what User-defined message code.
    449      * @param obj User object.
    450      */
    451     void registerForRedirectedNumberInfo(Handler h, int what, Object obj);
    452     void unregisterForRedirectedNumberInfo(Handler h);
    453 
    454     /**
    455      * Registers the handler for CDMA line control information record
    456      * Unlike the register* methods, there's only one notification handler
    457      *
    458      * @param h Handler for notification message.
    459      * @param what User-defined message code.
    460      * @param obj User object.
    461      */
    462     void registerForLineControlInfo(Handler h, int what, Object obj);
    463     void unregisterForLineControlInfo(Handler h);
    464 
    465     /**
    466      * Registers the handler for CDMA T53 CLIR information record
    467      * Unlike the register* methods, there's only one notification handler
    468      *
    469      * @param h Handler for notification message.
    470      * @param what User-defined message code.
    471      * @param obj User object.
    472      */
    473     void registerFoT53ClirlInfo(Handler h, int what, Object obj);
    474     void unregisterForT53ClirInfo(Handler h);
    475 
    476     /**
    477      * Registers the handler for CDMA T53 audio control information record
    478      * Unlike the register* methods, there's only one notification handler
    479      *
    480      * @param h Handler for notification message.
    481      * @param what User-defined message code.
    482      * @param obj User object.
    483      */
    484     void registerForT53AudioControlInfo(Handler h, int what, Object obj);
    485     void unregisterForT53AudioControlInfo(Handler h);
    486 
    487     /**
    488      * Fires on if Modem enters Emergency Callback mode
    489      */
    490     void setEmergencyCallbackMode(Handler h, int what, Object obj);
    491 
    492      /**
    493       * Fires on any CDMA OTA provision status change
    494       */
    495      void registerForCdmaOtaProvision(Handler h,int what, Object obj);
    496      void unregisterForCdmaOtaProvision(Handler h);
    497 
    498      /**
    499       * Registers the handler when out-band ringback tone is needed.<p>
    500       *
    501       *  Messages received from this:
    502       *  Message.obj will be an AsyncResult
    503       *  AsyncResult.userObj = obj
    504       *  AsyncResult.result = boolean. <p>
    505       */
    506      void registerForRingbackTone(Handler h, int what, Object obj);
    507      void unregisterForRingbackTone(Handler h);
    508 
    509      /**
    510       * Registers the handler when mute/unmute need to be resent to get
    511       * uplink audio during a call.<p>
    512       *
    513       * @param h Handler for notification message.
    514       * @param what User-defined message code.
    515       * @param obj User object.
    516       *
    517       */
    518      void registerForResendIncallMute(Handler h, int what, Object obj);
    519      void unregisterForResendIncallMute(Handler h);
    520 
    521      /**
    522       * Registers the handler for when Cdma subscription changed events
    523       *
    524       * @param h Handler for notification message.
    525       * @param what User-defined message code.
    526       * @param obj User object.
    527       *
    528       */
    529      void registerForCdmaSubscriptionChanged(Handler h, int what, Object obj);
    530      void unregisterForCdmaSubscriptionChanged(Handler h);
    531 
    532      /**
    533       * Registers the handler for when Cdma prl changed events
    534       *
    535       * @param h Handler for notification message.
    536       * @param what User-defined message code.
    537       * @param obj User object.
    538       *
    539       */
    540      void registerForCdmaPrlChanged(Handler h, int what, Object obj);
    541      void unregisterForCdmaPrlChanged(Handler h);
    542 
    543      /**
    544       * Registers the handler for when Cdma prl changed events
    545       *
    546       * @param h Handler for notification message.
    547       * @param what User-defined message code.
    548       * @param obj User object.
    549       *
    550       */
    551      void registerForExitEmergencyCallbackMode(Handler h, int what, Object obj);
    552      void unregisterForExitEmergencyCallbackMode(Handler h);
    553 
    554      /**
    555       * Registers the handler for RIL_UNSOL_RIL_CONNECT events.
    556       *
    557       * When ril connects or disconnects a message is sent to the registrant
    558       * which contains an AsyncResult, ar, in msg.obj. The ar.result is an
    559       * Integer which is the version of the ril or -1 if the ril disconnected.
    560       *
    561       * @param h Handler for notification message.
    562       * @param what User-defined message code.
    563       * @param obj User object.
    564       */
    565      void registerForRilConnected(Handler h, int what, Object obj);
    566      void unregisterForRilConnected(Handler h);
    567 
    568     /**
    569      * Supply the ICC PIN to the ICC card
    570      *
    571      *  returned message
    572      *  retMsg.obj = AsyncResult ar
    573      *  ar.exception carries exception on failure
    574      *  This exception is CommandException with an error of PASSWORD_INCORRECT
    575      *  if the password is incorrect
    576      *
    577      * ar.exception and ar.result are null on success
    578      */
    579 
    580     void supplyIccPin(String pin, Message result);
    581 
    582     /**
    583      * Supply the PIN for the app with this AID on the ICC card
    584      *
    585      *  AID (Application ID), See ETSI 102.221 8.1 and 101.220 4
    586      *
    587      *  returned message
    588      *  retMsg.obj = AsyncResult ar
    589      *  ar.exception carries exception on failure
    590      *  This exception is CommandException with an error of PASSWORD_INCORRECT
    591      *  if the password is incorrect
    592      *
    593      * ar.exception and ar.result are null on success
    594      */
    595 
    596     void supplyIccPinForApp(String pin, String aid, Message result);
    597 
    598     /**
    599      * Supply the ICC PUK and newPin to the ICC card
    600      *
    601      *  returned message
    602      *  retMsg.obj = AsyncResult ar
    603      *  ar.exception carries exception on failure
    604      *  This exception is CommandException with an error of PASSWORD_INCORRECT
    605      *  if the password is incorrect
    606      *
    607      * ar.exception and ar.result are null on success
    608      */
    609 
    610     void supplyIccPuk(String puk, String newPin, Message result);
    611 
    612     /**
    613      * Supply the PUK, new pin for the app with this AID on the ICC card
    614      *
    615      *  AID (Application ID), See ETSI 102.221 8.1 and 101.220 4
    616      *
    617      *  returned message
    618      *  retMsg.obj = AsyncResult ar
    619      *  ar.exception carries exception on failure
    620      *  This exception is CommandException with an error of PASSWORD_INCORRECT
    621      *  if the password is incorrect
    622      *
    623      * ar.exception and ar.result are null on success
    624      */
    625 
    626     void supplyIccPukForApp(String puk, String newPin, String aid, Message result);
    627 
    628     /**
    629      * Supply the ICC PIN2 to the ICC card
    630      * Only called following operation where ICC_PIN2 was
    631      * returned as a a failure from a previous operation
    632      *
    633      *  returned message
    634      *  retMsg.obj = AsyncResult ar
    635      *  ar.exception carries exception on failure
    636      *  This exception is CommandException with an error of PASSWORD_INCORRECT
    637      *  if the password is incorrect
    638      *
    639      * ar.exception and ar.result are null on success
    640      */
    641 
    642     void supplyIccPin2(String pin2, Message result);
    643 
    644     /**
    645      * Supply the PIN2 for the app with this AID on the ICC card
    646      * Only called following operation where ICC_PIN2 was
    647      * returned as a a failure from a previous operation
    648      *
    649      *  AID (Application ID), See ETSI 102.221 8.1 and 101.220 4
    650      *
    651      *  returned message
    652      *  retMsg.obj = AsyncResult ar
    653      *  ar.exception carries exception on failure
    654      *  This exception is CommandException with an error of PASSWORD_INCORRECT
    655      *  if the password is incorrect
    656      *
    657      * ar.exception and ar.result are null on success
    658      */
    659 
    660     void supplyIccPin2ForApp(String pin2, String aid, Message result);
    661 
    662     /**
    663      * Supply the SIM PUK2 to the SIM card
    664      * Only called following operation where SIM_PUK2 was
    665      * returned as a a failure from a previous operation
    666      *
    667      *  returned message
    668      *  retMsg.obj = AsyncResult ar
    669      *  ar.exception carries exception on failure
    670      *  This exception is CommandException with an error of PASSWORD_INCORRECT
    671      *  if the password is incorrect
    672      *
    673      * ar.exception and ar.result are null on success
    674      */
    675 
    676     void supplyIccPuk2(String puk2, String newPin2, Message result);
    677 
    678     /**
    679      * Supply the PUK2, newPin2 for the app with this AID on the ICC card
    680      * Only called following operation where SIM_PUK2 was
    681      * returned as a a failure from a previous operation
    682      *
    683      *  AID (Application ID), See ETSI 102.221 8.1 and 101.220 4
    684      *
    685      *  returned message
    686      *  retMsg.obj = AsyncResult ar
    687      *  ar.exception carries exception on failure
    688      *  This exception is CommandException with an error of PASSWORD_INCORRECT
    689      *  if the password is incorrect
    690      *
    691      * ar.exception and ar.result are null on success
    692      */
    693 
    694     void supplyIccPuk2ForApp(String puk2, String newPin2, String aid, Message result);
    695 
    696     void changeIccPin(String oldPin, String newPin, Message result);
    697     void changeIccPinForApp(String oldPin, String newPin, String aidPtr, Message result);
    698     void changeIccPin2(String oldPin2, String newPin2, Message result);
    699     void changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr, Message result);
    700 
    701     void changeBarringPassword(String facility, String oldPwd, String newPwd, Message result);
    702 
    703     void supplyNetworkDepersonalization(String netpin, Message result);
    704 
    705     /**
    706      *  returned message
    707      *  retMsg.obj = AsyncResult ar
    708      *  ar.exception carries exception on failure
    709      *  ar.userObject contains the orignal value of result.obj
    710      *  ar.result contains a List of DriverCall
    711      *      The ar.result List is sorted by DriverCall.index
    712      */
    713     void getCurrentCalls (Message result);
    714 
    715     /**
    716      *  returned message
    717      *  retMsg.obj = AsyncResult ar
    718      *  ar.exception carries exception on failure
    719      *  ar.userObject contains the orignal value of result.obj
    720      *  ar.result contains a List of DataCallResponse
    721      *  @deprecated Do not use.
    722      */
    723     @Deprecated
    724     void getPDPContextList(Message result);
    725 
    726     /**
    727      *  returned message
    728      *  retMsg.obj = AsyncResult ar
    729      *  ar.exception carries exception on failure
    730      *  ar.userObject contains the orignal value of result.obj
    731      *  ar.result contains a List of DataCallResponse
    732      */
    733     void getDataCallList(Message result);
    734 
    735     /**
    736      *  returned message
    737      *  retMsg.obj = AsyncResult ar
    738      *  ar.exception carries exception on failure
    739      *  ar.userObject contains the orignal value of result.obj
    740      *  ar.result is null on success and failure
    741      *
    742      * CLIR_DEFAULT     == on "use subscription default value"
    743      * CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation)
    744      * CLIR_INVOCATION  == on "CLIR invocation" (restrict CLI presentation)
    745      */
    746     void dial (String address, int clirMode, Message result);
    747 
    748     /**
    749      *  returned message
    750      *  retMsg.obj = AsyncResult ar
    751      *  ar.exception carries exception on failure
    752      *  ar.userObject contains the orignal value of result.obj
    753      *  ar.result is null on success and failure
    754      *
    755      * CLIR_DEFAULT     == on "use subscription default value"
    756      * CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation)
    757      * CLIR_INVOCATION  == on "CLIR invocation" (restrict CLI presentation)
    758      */
    759     void dial(String address, int clirMode, UUSInfo uusInfo, Message result);
    760 
    761     /**
    762      *  returned message
    763      *  retMsg.obj = AsyncResult ar
    764      *  ar.exception carries exception on failure
    765      *  ar.userObject contains the orignal value of result.obj
    766      *  ar.result is String containing IMSI on success
    767      */
    768     void getIMSI(Message result);
    769 
    770     /**
    771      *  returned message
    772      *  retMsg.obj = AsyncResult ar
    773      *  ar.exception carries exception on failure
    774      *  ar.userObject contains the orignal value of result.obj
    775      *  ar.result is String containing IMSI on success
    776      */
    777     void getIMSIForApp(String aid, Message result);
    778 
    779     /**
    780      *  returned message
    781      *  retMsg.obj = AsyncResult ar
    782      *  ar.exception carries exception on failure
    783      *  ar.userObject contains the orignal value of result.obj
    784      *  ar.result is String containing IMEI on success
    785      */
    786     void getIMEI(Message result);
    787 
    788     /**
    789      *  returned message
    790      *  retMsg.obj = AsyncResult ar
    791      *  ar.exception carries exception on failure
    792      *  ar.userObject contains the orignal value of result.obj
    793      *  ar.result is String containing IMEISV on success
    794      */
    795     void getIMEISV(Message result);
    796 
    797     /**
    798      * Hang up one individual connection.
    799      *  returned message
    800      *  retMsg.obj = AsyncResult ar
    801      *  ar.exception carries exception on failure
    802      *  ar.userObject contains the orignal value of result.obj
    803      *  ar.result is null on success and failure
    804      *
    805      *  3GPP 22.030 6.5.5
    806      *  "Releases a specific active call X"
    807      */
    808     void hangupConnection (int gsmIndex, Message result);
    809 
    810     /**
    811      * 3GPP 22.030 6.5.5
    812      *  "Releases all held calls or sets User Determined User Busy (UDUB)
    813      *   for a waiting call."
    814      *  ar.exception carries exception on failure
    815      *  ar.userObject contains the orignal value of result.obj
    816      *  ar.result is null on success and failure
    817      */
    818     void hangupWaitingOrBackground (Message result);
    819 
    820     /**
    821      * 3GPP 22.030 6.5.5
    822      * "Releases all active calls (if any exist) and accepts
    823      *  the other (held or waiting) call."
    824      *
    825      *  ar.exception carries exception on failure
    826      *  ar.userObject contains the orignal value of result.obj
    827      *  ar.result is null on success and failure
    828      */
    829     void hangupForegroundResumeBackground (Message result);
    830 
    831     /**
    832      * 3GPP 22.030 6.5.5
    833      * "Places all active calls (if any exist) on hold and accepts
    834      *  the other (held or waiting) call."
    835      *
    836      *  ar.exception carries exception on failure
    837      *  ar.userObject contains the orignal value of result.obj
    838      *  ar.result is null on success and failure
    839      */
    840     void switchWaitingOrHoldingAndActive (Message result);
    841 
    842     /**
    843      * 3GPP 22.030 6.5.5
    844      * "Adds a held call to the conversation"
    845      *
    846      *  ar.exception carries exception on failure
    847      *  ar.userObject contains the orignal value of result.obj
    848      *  ar.result is null on success and failure
    849      */
    850     void conference (Message result);
    851 
    852     /**
    853      * Set preferred Voice Privacy (VP).
    854      *
    855      * @param enable true is enhanced and false is normal VP
    856      * @param result is a callback message
    857      */
    858     void setPreferredVoicePrivacy(boolean enable, Message result);
    859 
    860     /**
    861      * Get currently set preferred Voice Privacy (VP) mode.
    862      *
    863      * @param result is a callback message
    864      */
    865     void getPreferredVoicePrivacy(Message result);
    866 
    867     /**
    868      * 3GPP 22.030 6.5.5
    869      * "Places all active calls on hold except call X with which
    870      *  communication shall be supported."
    871      */
    872     void separateConnection (int gsmIndex, Message result);
    873 
    874     /**
    875      *
    876      *  ar.exception carries exception on failure
    877      *  ar.userObject contains the orignal value of result.obj
    878      *  ar.result is null on success and failure
    879      */
    880     void acceptCall (Message result);
    881 
    882     /**
    883      *  also known as UDUB
    884      *  ar.exception carries exception on failure
    885      *  ar.userObject contains the orignal value of result.obj
    886      *  ar.result is null on success and failure
    887      */
    888     void rejectCall (Message result);
    889 
    890     /**
    891      * 3GPP 22.030 6.5.5
    892      * "Connects the two calls and disconnects the subscriber from both calls"
    893      *
    894      *  ar.exception carries exception on failure
    895      *  ar.userObject contains the orignal value of result.obj
    896      *  ar.result is null on success and failure
    897      */
    898     void explicitCallTransfer (Message result);
    899 
    900     /**
    901      * cause code returned as int[0] in Message.obj.response
    902      * Returns integer cause code defined in TS 24.008
    903      * Annex H or closest approximation.
    904      * Most significant codes:
    905      * - Any defined in 22.001 F.4 (for generating busy/congestion)
    906      * - Cause 68: ACM >= ACMMax
    907      */
    908     void getLastCallFailCause (Message result);
    909 
    910 
    911     /**
    912      * Reason for last PDP context deactivate or failure to activate
    913      * cause code returned as int[0] in Message.obj.response
    914      * returns an integer cause code defined in TS 24.008
    915      * section 6.1.3.1.3 or close approximation
    916      * @deprecated Do not use.
    917      */
    918     @Deprecated
    919     void getLastPdpFailCause (Message result);
    920 
    921     /**
    922      * The preferred new alternative to getLastPdpFailCause
    923      * that is also CDMA-compatible.
    924      */
    925     void getLastDataCallFailCause (Message result);
    926 
    927     void setMute (boolean enableMute, Message response);
    928 
    929     void getMute (Message response);
    930 
    931     /**
    932      * response.obj is an AsyncResult
    933      * response.obj.result is an int[2]
    934      * response.obj.result[0] is received signal strength (0-31, 99)
    935      * response.obj.result[1] is  bit error rate (0-7, 99)
    936      * as defined in TS 27.007 8.5
    937      */
    938     void getSignalStrength (Message response);
    939 
    940 
    941     /**
    942      * response.obj.result is an int[3]
    943      * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2
    944      * response.obj.result[1] is LAC if registered or -1 if not
    945      * response.obj.result[2] is CID if registered or -1 if not
    946      * valid LAC and CIDs are 0x0000 - 0xffff
    947      *
    948      * Please note that registration state 4 ("unknown") is treated
    949      * as "out of service" above
    950      */
    951     void getVoiceRegistrationState (Message response);
    952 
    953     /**
    954      * response.obj.result is an int[3]
    955      * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2
    956      * response.obj.result[1] is LAC if registered or -1 if not
    957      * response.obj.result[2] is CID if registered or -1 if not
    958      * valid LAC and CIDs are 0x0000 - 0xffff
    959      *
    960      * Please note that registration state 4 ("unknown") is treated
    961      * as "out of service" above
    962      */
    963     void getDataRegistrationState (Message response);
    964 
    965     /**
    966      * response.obj.result is a String[3]
    967      * response.obj.result[0] is long alpha or null if unregistered
    968      * response.obj.result[1] is short alpha or null if unregistered
    969      * response.obj.result[2] is numeric or null if unregistered
    970      */
    971     void getOperator(Message response);
    972 
    973     /**
    974      *  ar.exception carries exception on failure
    975      *  ar.userObject contains the orignal value of result.obj
    976      *  ar.result is null on success and failure
    977      */
    978     void sendDtmf(char c, Message result);
    979 
    980 
    981     /**
    982      *  ar.exception carries exception on failure
    983      *  ar.userObject contains the orignal value of result.obj
    984      *  ar.result is null on success and failure
    985      */
    986     void startDtmf(char c, Message result);
    987 
    988     /**
    989      *  ar.exception carries exception on failure
    990      *  ar.userObject contains the orignal value of result.obj
    991      *  ar.result is null on success and failure
    992      */
    993     void stopDtmf(Message result);
    994 
    995     /**
    996      *  ar.exception carries exception on failure
    997      *  ar.userObject contains the orignal value of result.obj
    998      *  ar.result is null on success and failure
    999      */
   1000     void sendBurstDtmf(String dtmfString, int on, int off, Message result);
   1001 
   1002     /**
   1003      * smscPDU is smsc address in PDU form GSM BCD format prefixed
   1004      *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
   1005      * pdu is SMS in PDU format as an ASCII hex string
   1006      *      less the SMSC address
   1007      */
   1008     void sendSMS (String smscPDU, String pdu, Message response);
   1009 
   1010     /**
   1011      * @param pdu is CDMA-SMS in internal pseudo-PDU format
   1012      * @param response sent when operation completes
   1013      */
   1014     void sendCdmaSms(byte[] pdu, Message response);
   1015 
   1016     /**
   1017      * send SMS over IMS with 3GPP/GSM SMS format
   1018      * @param smscPDU is smsc address in PDU form GSM BCD format prefixed
   1019      *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
   1020      * @param pdu is SMS in PDU format as an ASCII hex string
   1021      *      less the SMSC address
   1022      * @param retry indicates if this is a retry; 0 == not retry, nonzero = retry
   1023      * @param messageRef valid field if retry is set to nonzero.
   1024      *        Contains messageRef from RIL_SMS_Response corresponding to failed MO SMS
   1025      * @param response sent when operation completes
   1026      */
   1027     void sendImsGsmSms (String smscPDU, String pdu, int retry, int messageRef,
   1028             Message response);
   1029 
   1030     /**
   1031      * send SMS over IMS with 3GPP2/CDMA SMS format
   1032      * @param pdu is CDMA-SMS in internal pseudo-PDU format
   1033      * @param response sent when operation completes
   1034      * @param retry indicates if this is a retry; 0 == not retry, nonzero = retry
   1035      * @param messageRef valid field if retry is set to nonzero.
   1036      *        Contains messageRef from RIL_SMS_Response corresponding to failed MO SMS
   1037      * @param response sent when operation completes
   1038      */
   1039     void sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message response);
   1040 
   1041     /**
   1042      * Deletes the specified SMS record from SIM memory (EF_SMS).
   1043      *
   1044      * @param index index of the SMS record to delete
   1045      * @param response sent when operation completes
   1046      */
   1047     void deleteSmsOnSim(int index, Message response);
   1048 
   1049     /**
   1050      * Deletes the specified SMS record from RUIM memory (EF_SMS in DF_CDMA).
   1051      *
   1052      * @param index index of the SMS record to delete
   1053      * @param response sent when operation completes
   1054      */
   1055     void deleteSmsOnRuim(int index, Message response);
   1056 
   1057     /**
   1058      * Writes an SMS message to SIM memory (EF_SMS).
   1059      *
   1060      * @param status status of message on SIM.  One of:
   1061      *                  SmsManger.STATUS_ON_ICC_READ
   1062      *                  SmsManger.STATUS_ON_ICC_UNREAD
   1063      *                  SmsManger.STATUS_ON_ICC_SENT
   1064      *                  SmsManger.STATUS_ON_ICC_UNSENT
   1065      * @param pdu message PDU, as hex string
   1066      * @param response sent when operation completes.
   1067      *                  response.obj will be an AsyncResult, and will indicate
   1068      *                  any error that may have occurred (eg, out of memory).
   1069      */
   1070     void writeSmsToSim(int status, String smsc, String pdu, Message response);
   1071 
   1072     void writeSmsToRuim(int status, String pdu, Message response);
   1073 
   1074     void setRadioPower(boolean on, Message response);
   1075 
   1076     void acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response);
   1077 
   1078     void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response);
   1079 
   1080     /**
   1081      * Acknowledge successful or failed receipt of last incoming SMS,
   1082      * including acknowledgement TPDU to send as the RP-User-Data element
   1083      * of the RP-ACK or RP-ERROR PDU.
   1084      *
   1085      * @param success true to send RP-ACK, false to send RP-ERROR
   1086      * @param ackPdu the acknowledgement TPDU in hexadecimal format
   1087      * @param response sent when operation completes.
   1088      */
   1089     void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response);
   1090 
   1091     /**
   1092      * parameters equivalent to 27.007 AT+CRSM command
   1093      * response.obj will be an AsyncResult
   1094      * response.obj.result will be an IccIoResult on success
   1095      */
   1096     void iccIO (int command, int fileid, String path, int p1, int p2, int p3,
   1097             String data, String pin2, Message response);
   1098 
   1099     /**
   1100      * parameters equivalent to 27.007 AT+CRSM command
   1101      * response.obj will be an AsyncResult
   1102      * response.obj.userObj will be a IccIoResult on success
   1103      */
   1104     void iccIOForApp (int command, int fileid, String path, int p1, int p2, int p3,
   1105             String data, String pin2, String aid, Message response);
   1106 
   1107     /**
   1108      * (AsyncResult)response.obj).result is an int[] with element [0] set to
   1109      * 1 for "CLIP is provisioned", and 0 for "CLIP is not provisioned".
   1110      *
   1111      * @param response is callback message
   1112      */
   1113 
   1114     void queryCLIP(Message response);
   1115 
   1116     /**
   1117      * response.obj will be a an int[2]
   1118      *
   1119      * response.obj[0] will be TS 27.007 +CLIR parameter 'n'
   1120      *  0 presentation indicator is used according to the subscription of the CLIR service
   1121      *  1 CLIR invocation
   1122      *  2 CLIR suppression
   1123      *
   1124      * response.obj[1] will be TS 27.007 +CLIR parameter 'm'
   1125      *  0 CLIR not provisioned
   1126      *  1 CLIR provisioned in permanent mode
   1127      *  2 unknown (e.g. no network, etc.)
   1128      *  3 CLIR temporary mode presentation restricted
   1129      *  4 CLIR temporary mode presentation allowed
   1130      */
   1131 
   1132     void getCLIR(Message response);
   1133 
   1134     /**
   1135      * clirMode is one of the CLIR_* constants above
   1136      *
   1137      * response.obj is null
   1138      */
   1139 
   1140     void setCLIR(int clirMode, Message response);
   1141 
   1142     /**
   1143      * (AsyncResult)response.obj).result is an int[] with element [0] set to
   1144      * 0 for disabled, 1 for enabled.
   1145      *
   1146      * @param serviceClass is a sum of SERVICE_CLASS_*
   1147      * @param response is callback message
   1148      */
   1149 
   1150     void queryCallWaiting(int serviceClass, Message response);
   1151 
   1152     /**
   1153      * @param enable is true to enable, false to disable
   1154      * @param serviceClass is a sum of SERVICE_CLASS_*
   1155      * @param response is callback message
   1156      */
   1157 
   1158     void setCallWaiting(boolean enable, int serviceClass, Message response);
   1159 
   1160     /**
   1161      * @param action is one of CF_ACTION_*
   1162      * @param cfReason is one of CF_REASON_*
   1163      * @param serviceClass is a sum of SERVICE_CLASSS_*
   1164      */
   1165     void setCallForward(int action, int cfReason, int serviceClass,
   1166                 String number, int timeSeconds, Message response);
   1167 
   1168     /**
   1169      * cfReason is one of CF_REASON_*
   1170      *
   1171      * ((AsyncResult)response.obj).result will be an array of
   1172      * CallForwardInfo's
   1173      *
   1174      * An array of length 0 means "disabled for all codes"
   1175      */
   1176     void queryCallForwardStatus(int cfReason, int serviceClass,
   1177             String number, Message response);
   1178 
   1179     void setNetworkSelectionModeAutomatic(Message response);
   1180 
   1181     void setNetworkSelectionModeManual(String operatorNumeric, Message response);
   1182 
   1183     /**
   1184      * Queries whether the current network selection mode is automatic
   1185      * or manual
   1186      *
   1187      * ((AsyncResult)response.obj).result  is an int[] with element [0] being
   1188      * a 0 for automatic selection and a 1 for manual selection
   1189      */
   1190 
   1191     void getNetworkSelectionMode(Message response);
   1192 
   1193     /**
   1194      * Queries the currently available networks
   1195      *
   1196      * ((AsyncResult)response.obj).result  is a List of NetworkInfo objects
   1197      */
   1198     void getAvailableNetworks(Message response);
   1199 
   1200     void getBasebandVersion (Message response);
   1201 
   1202 
   1203     /**
   1204      * (AsyncResult)response.obj).result will be an Integer representing
   1205      * the sum of enabled service classes (sum of SERVICE_CLASS_*)
   1206      *
   1207      * @param facility one of CB_FACILTY_*
   1208      * @param password password or "" if not required
   1209      * @param serviceClass is a sum of SERVICE_CLASS_*
   1210      * @param response is callback message
   1211      */
   1212 
   1213     void queryFacilityLock (String facility, String password, int serviceClass,
   1214         Message response);
   1215 
   1216     /**
   1217      * (AsyncResult)response.obj).result will be an Integer representing
   1218      * the sum of enabled service classes (sum of SERVICE_CLASS_*) for the
   1219      * application with appId.
   1220      *
   1221      * @param facility one of CB_FACILTY_*
   1222      * @param password password or "" if not required
   1223      * @param serviceClass is a sum of SERVICE_CLASS_*
   1224      * @param appId is application Id or null if none
   1225      * @param response is callback message
   1226      */
   1227 
   1228     void queryFacilityLockForApp(String facility, String password, int serviceClass, String appId,
   1229         Message response);
   1230 
   1231     /**
   1232      * @param facility one of CB_FACILTY_*
   1233      * @param lockState true means lock, false means unlock
   1234      * @param password password or "" if not required
   1235      * @param serviceClass is a sum of SERVICE_CLASS_*
   1236      * @param response is callback message
   1237      */
   1238     void setFacilityLock (String facility, boolean lockState, String password,
   1239         int serviceClass, Message response);
   1240 
   1241     /**
   1242      * Set the facility lock for the app with this AID on the ICC card.
   1243      *
   1244      * @param facility one of CB_FACILTY_*
   1245      * @param lockState true means lock, false means unlock
   1246      * @param password password or "" if not required
   1247      * @param serviceClass is a sum of SERVICE_CLASS_*
   1248      * @param appId is application Id or null if none
   1249      * @param response is callback message
   1250      */
   1251     void setFacilityLockForApp(String facility, boolean lockState, String password,
   1252         int serviceClass, String appId, Message response);
   1253 
   1254     void sendUSSD (String ussdString, Message response);
   1255 
   1256     /**
   1257      * Cancels a pending USSD session if one exists.
   1258      * @param response callback message
   1259      */
   1260     void cancelPendingUssd (Message response);
   1261 
   1262     void resetRadio(Message result);
   1263 
   1264     /**
   1265      * Assign a specified band for RF configuration.
   1266      *
   1267      * @param bandMode one of BM_*_BAND
   1268      * @param response is callback message
   1269      */
   1270     void setBandMode (int bandMode, Message response);
   1271 
   1272     /**
   1273      * Query the list of band mode supported by RF.
   1274      *
   1275      * @param response is callback message
   1276      *        ((AsyncResult)response.obj).result  is an int[] with every
   1277      *        element representing one avialable BM_*_BAND
   1278      */
   1279     void queryAvailableBandMode (Message response);
   1280 
   1281     /**
   1282      * Set the current preferred network type. This will be the last
   1283      * networkType that was passed to setPreferredNetworkType.
   1284      */
   1285     void setCurrentPreferredNetworkType();
   1286 
   1287     /**
   1288      *  Requests to set the preferred network type for searching and registering
   1289      * (CS/PS domain, RAT, and operation mode)
   1290      * @param networkType one of  NT_*_TYPE
   1291      * @param response is callback message
   1292      */
   1293     void setPreferredNetworkType(int networkType , Message response);
   1294 
   1295      /**
   1296      *  Query the preferred network type setting
   1297      *
   1298      * @param response is callback message to report one of  NT_*_TYPE
   1299      */
   1300     void getPreferredNetworkType(Message response);
   1301 
   1302     /**
   1303      * Query neighboring cell ids
   1304      *
   1305      * @param response s callback message to cell ids
   1306      */
   1307     void getNeighboringCids(Message response);
   1308 
   1309     /**
   1310      * Request to enable/disable network state change notifications when
   1311      * location information (lac and/or cid) has changed.
   1312      *
   1313      * @param enable true to enable, false to disable
   1314      * @param response callback message
   1315      */
   1316     void setLocationUpdates(boolean enable, Message response);
   1317 
   1318     /**
   1319      * Gets the default SMSC address.
   1320      *
   1321      * @param result Callback message contains the SMSC address.
   1322      */
   1323     void getSmscAddress(Message result);
   1324 
   1325     /**
   1326      * Sets the default SMSC address.
   1327      *
   1328      * @param address new SMSC address
   1329      * @param result Callback message is empty on completion
   1330      */
   1331     void setSmscAddress(String address, Message result);
   1332 
   1333     /**
   1334      * Indicates whether there is storage available for new SMS messages.
   1335      * @param available true if storage is available
   1336      * @param result callback message
   1337      */
   1338     void reportSmsMemoryStatus(boolean available, Message result);
   1339 
   1340     /**
   1341      * Indicates to the vendor ril that StkService is running
   1342      * and is ready to receive RIL_UNSOL_STK_XXXX commands.
   1343      *
   1344      * @param result callback message
   1345      */
   1346     void reportStkServiceIsRunning(Message result);
   1347 
   1348     void invokeOemRilRequestRaw(byte[] data, Message response);
   1349 
   1350     void invokeOemRilRequestStrings(String[] strings, Message response);
   1351 
   1352 
   1353     /**
   1354      * Send TERMINAL RESPONSE to the SIM, after processing a proactive command
   1355      * sent by the SIM.
   1356      *
   1357      * @param contents  String containing SAT/USAT response in hexadecimal
   1358      *                  format starting with first byte of response data. See
   1359      *                  TS 102 223 for details.
   1360      * @param response  Callback message
   1361      */
   1362     public void sendTerminalResponse(String contents, Message response);
   1363 
   1364     /**
   1365      * Send ENVELOPE to the SIM, after processing a proactive command sent by
   1366      * the SIM.
   1367      *
   1368      * @param contents  String containing SAT/USAT response in hexadecimal
   1369      *                  format starting with command tag. See TS 102 223 for
   1370      *                  details.
   1371      * @param response  Callback message
   1372      */
   1373     public void sendEnvelope(String contents, Message response);
   1374 
   1375     /**
   1376      * Send ENVELOPE to the SIM, such as an SMS-PP data download envelope
   1377      * for a SIM data download message. This method has one difference
   1378      * from {@link #sendEnvelope}: The SW1 and SW2 status bytes from the UICC response
   1379      * are returned along with the response data.
   1380      *
   1381      * response.obj will be an AsyncResult
   1382      * response.obj.result will be an IccIoResult on success
   1383      *
   1384      * @param contents  String containing SAT/USAT response in hexadecimal
   1385      *                  format starting with command tag. See TS 102 223 for
   1386      *                  details.
   1387      * @param response  Callback message
   1388      */
   1389     public void sendEnvelopeWithStatus(String contents, Message response);
   1390 
   1391     /**
   1392      * Accept or reject the call setup request from SIM.
   1393      *
   1394      * @param accept   true if the call is to be accepted, false otherwise.
   1395      * @param response Callback message
   1396      */
   1397     public void handleCallSetupRequestFromSim(boolean accept, Message response);
   1398 
   1399     /**
   1400      * Activate or deactivate cell broadcast SMS for GSM.
   1401      *
   1402      * @param activate
   1403      *            true = activate, false = deactivate
   1404      * @param result Callback message is empty on completion
   1405      */
   1406     public void setGsmBroadcastActivation(boolean activate, Message result);
   1407 
   1408     /**
   1409      * Configure cell broadcast SMS for GSM.
   1410      *
   1411      * @param response Callback message is empty on completion
   1412      */
   1413     public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response);
   1414 
   1415     /**
   1416      * Query the current configuration of cell broadcast SMS of GSM.
   1417      *
   1418      * @param response
   1419      *        Callback message contains the configuration from the modem
   1420      *        on completion
   1421      */
   1422     public void getGsmBroadcastConfig(Message response);
   1423 
   1424     //***** new Methods for CDMA support
   1425 
   1426     /**
   1427      * Request the device ESN / MEID / IMEI / IMEISV.
   1428      * "response" is const char **
   1429      *   [0] is IMEI if GSM subscription is available
   1430      *   [1] is IMEISV if GSM subscription is available
   1431      *   [2] is ESN if CDMA subscription is available
   1432      *   [3] is MEID if CDMA subscription is available
   1433      */
   1434     public void getDeviceIdentity(Message response);
   1435 
   1436     /**
   1437      * Request the device MDN / H_SID / H_NID / MIN.
   1438      * "response" is const char **
   1439      *   [0] is MDN if CDMA subscription is available
   1440      *   [1] is a comma separated list of H_SID (Home SID) in decimal format
   1441      *       if CDMA subscription is available
   1442      *   [2] is a comma separated list of H_NID (Home NID) in decimal format
   1443      *       if CDMA subscription is available
   1444      *   [3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
   1445      */
   1446     public void getCDMASubscription(Message response);
   1447 
   1448     /**
   1449      * Send Flash Code.
   1450      * "response" is is NULL
   1451      *   [0] is a FLASH string
   1452      */
   1453     public void sendCDMAFeatureCode(String FeatureCode, Message response);
   1454 
   1455     /** Set the Phone type created */
   1456     void setPhoneType(int phoneType);
   1457 
   1458     /**
   1459      *  Query the CDMA roaming preference setting
   1460      *
   1461      * @param response is callback message to report one of  CDMA_RM_*
   1462      */
   1463     void queryCdmaRoamingPreference(Message response);
   1464 
   1465     /**
   1466      *  Requests to set the CDMA roaming preference
   1467      * @param cdmaRoamingType one of  CDMA_RM_*
   1468      * @param response is callback message
   1469      */
   1470     void setCdmaRoamingPreference(int cdmaRoamingType, Message response);
   1471 
   1472     /**
   1473      *  Requests to set the CDMA subscription mode
   1474      * @param cdmaSubscriptionType one of  CDMA_SUBSCRIPTION_*
   1475      * @param response is callback message
   1476      */
   1477     void setCdmaSubscriptionSource(int cdmaSubscriptionType, Message response);
   1478 
   1479     /**
   1480      *  Requests to get the CDMA subscription srouce
   1481      * @param response is callback message
   1482      */
   1483     void getCdmaSubscriptionSource(Message response);
   1484 
   1485     /**
   1486      *  Set the TTY mode
   1487      *
   1488      * @param ttyMode one of the following:
   1489      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
   1490      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
   1491      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
   1492      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
   1493      * @param response is callback message
   1494      */
   1495     void setTTYMode(int ttyMode, Message response);
   1496 
   1497     /**
   1498      *  Query the TTY mode
   1499      * (AsyncResult)response.obj).result is an int[] with element [0] set to
   1500      * tty mode:
   1501      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
   1502      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
   1503      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
   1504      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
   1505      * @param response is callback message
   1506      */
   1507     void queryTTYMode(Message response);
   1508 
   1509     /**
   1510      * Setup a packet data connection On successful completion, the result
   1511      * message will return a {@link com.android.internal.telephony.dataconnection.DataCallResponse}
   1512      * object containing the connection information.
   1513      *
   1514      * @param radioTechnology
   1515      *            indicates whether to setup connection on radio technology CDMA
   1516      *            (0) or GSM/UMTS (1)
   1517      * @param profile
   1518      *            Profile Number or NULL to indicate default profile
   1519      * @param apn
   1520      *            the APN to connect to if radio technology is GSM/UMTS.
   1521      *            Otherwise null for CDMA.
   1522      * @param user
   1523      *            the username for APN, or NULL
   1524      * @param password
   1525      *            the password for APN, or NULL
   1526      * @param authType
   1527      *            the PAP / CHAP auth type. Values is one of SETUP_DATA_AUTH_*
   1528      * @param protocol
   1529      *            one of the PDP_type values in TS 27.007 section 10.1.1.
   1530      *            For example, "IP", "IPV6", "IPV4V6", or "PPP".
   1531      * @param result
   1532      *            Callback message
   1533      */
   1534     public void setupDataCall(String radioTechnology, String profile,
   1535             String apn, String user, String password, String authType,
   1536             String protocol, Message result);
   1537 
   1538     /**
   1539      * Deactivate packet data connection
   1540      *
   1541      * @param cid
   1542      *            The connection ID
   1543      * @param reason
   1544      *            Data disconnect reason.
   1545      * @param result
   1546      *            Callback message is empty on completion
   1547      */
   1548     public void deactivateDataCall(int cid, int reason, Message result);
   1549 
   1550     /**
   1551      * Activate or deactivate cell broadcast SMS for CDMA.
   1552      *
   1553      * @param activate
   1554      *            true = activate, false = deactivate
   1555      * @param result
   1556      *            Callback message is empty on completion
   1557      */
   1558     public void setCdmaBroadcastActivation(boolean activate, Message result);
   1559 
   1560     /**
   1561      * Configure cdma cell broadcast SMS.
   1562      *
   1563      * @param response
   1564      *            Callback message is empty on completion
   1565      */
   1566     public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response);
   1567 
   1568     /**
   1569      * Query the current configuration of cdma cell broadcast SMS.
   1570      *
   1571      * @param result
   1572      *            Callback message contains the configuration from the modem on completion
   1573      */
   1574     public void getCdmaBroadcastConfig(Message result);
   1575 
   1576     /**
   1577      *  Requests the radio's system selection module to exit emergency callback mode.
   1578      *  This function should only be called from CDMAPHone.java.
   1579      *
   1580      * @param response callback message
   1581      */
   1582     public void exitEmergencyCallbackMode(Message response);
   1583 
   1584     /**
   1585      * Request the status of the ICC and UICC cards.
   1586      *
   1587      * @param result
   1588      *          Callback message containing {@link IccCardStatus} structure for the card.
   1589      */
   1590     public void getIccCardStatus(Message result);
   1591 
   1592     /**
   1593      * Return if the current radio is LTE on CDMA. This
   1594      * is a tri-state return value as for a period of time
   1595      * the mode may be unknown.
   1596      *
   1597      * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE}
   1598      * or {@link PhoneConstants#LTE_ON_CDMA_TRUE}
   1599      */
   1600     public int getLteOnCdmaMode();
   1601 
   1602     /**
   1603      * Request the ISIM application on the UICC to perform the AKA
   1604      * challenge/response algorithm for IMS authentication. The nonce string
   1605      * and challenge response are Base64 encoded Strings.
   1606      *
   1607      * @param nonce the nonce string to pass with the ISIM authentication request
   1608      * @param response a callback message with the String response in the obj field
   1609      */
   1610     public void requestIsimAuthentication(String nonce, Message response);
   1611 
   1612     /**
   1613      * Get the current Voice Radio Technology.
   1614      *
   1615      * AsyncResult.result is an int array with the first value
   1616      * being one of the ServiceState.RIL_RADIO_TECHNOLOGY_xxx values.
   1617      *
   1618      * @param result is sent back to handler and result.obj is a AsyncResult
   1619      */
   1620     void getVoiceRadioTechnology(Message result);
   1621 
   1622     /**
   1623      * Return the current set of CellInfo records
   1624      *
   1625      * AsyncResult.result is a of Collection<CellInfo>
   1626      *
   1627      * @param result is sent back to handler and result.obj is a AsyncResult
   1628      */
   1629     void getCellInfoList(Message result);
   1630 
   1631     /**
   1632      * Sets the minimum time in milli-seconds between when RIL_UNSOL_CELL_INFO_LIST
   1633      * should be invoked.
   1634      *
   1635      * The default, 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported
   1636      * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
   1637      * A RIL_UNSOL_CELL_INFO_LIST.
   1638      *
   1639      *
   1640 
   1641      * @param rateInMillis is sent back to handler and result.obj is a AsyncResult
   1642      * @param response.obj is AsyncResult ar when sent to associated handler
   1643      *                        ar.exception carries exception on failure or null on success
   1644      *                        otherwise the error.
   1645      */
   1646     void setCellInfoListRate(int rateInMillis, Message response);
   1647 
   1648     /**
   1649      * Fires when RIL_UNSOL_CELL_INFO_LIST is received from the RIL.
   1650      */
   1651     void registerForCellInfoList(Handler h, int what, Object obj);
   1652     void unregisterForCellInfoList(Handler h);
   1653 
   1654     /**
   1655      * Set Initial Attach Apn
   1656      *
   1657      * @param apn
   1658      *            the APN to connect to if radio technology is GSM/UMTS.
   1659      * @param protocol
   1660      *            one of the PDP_type values in TS 27.007 section 10.1.1.
   1661      *            For example, "IP", "IPV6", "IPV4V6", or "PPP".
   1662      * @param authType
   1663      *            authentication protocol used for this PDP context
   1664      *            (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3)
   1665      * @param username
   1666      *            the username for APN, or NULL
   1667      * @param password
   1668      *            the password for APN, or NULL
   1669      * @param result
   1670      *            callback message contains the information of SUCCESS/FAILURE
   1671      */
   1672     public void setInitialAttachApn(String apn, String protocol, int authType, String username,
   1673             String password, Message result);
   1674 
   1675     /**
   1676      * Notifiy that we are testing an emergency call
   1677      */
   1678     public void testingEmergencyCall();
   1679 
   1680 
   1681     /**
   1682      * @return version of the ril.
   1683      */
   1684     int getRilVersion();
   1685 }
   1686