Home | History | Annotate | Download | only in telephony
      1 /*
      2  * Copyright (C) 2006 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef ANDROID_RIL_H
     18 #define ANDROID_RIL_H 1
     19 
     20 #include <stdlib.h>
     21 #include <stdint.h>
     22 #include <telephony/ril_cdma_sms.h>
     23 #include <telephony/ril_nv_items.h>
     24 #include <telephony/ril_msim.h>
     25 
     26 #ifndef FEATURE_UNIT_TEST
     27 #include <sys/time.h>
     28 #endif /* !FEATURE_UNIT_TEST */
     29 
     30 #ifdef __cplusplus
     31 extern "C" {
     32 #endif
     33 
     34 #ifndef SIM_COUNT
     35 #if defined(ANDROID_SIM_COUNT_2)
     36 #define SIM_COUNT 2
     37 #elif defined(ANDROID_SIM_COUNT_3)
     38 #define SIM_COUNT 3
     39 #elif defined(ANDROID_SIM_COUNT_4)
     40 #define SIM_COUNT 4
     41 #else
     42 #define SIM_COUNT 1
     43 #endif
     44 
     45 #ifndef ANDROID_MULTI_SIM
     46 #define SIM_COUNT 1
     47 #endif
     48 #endif
     49 
     50 /*
     51  * RIL version.
     52  * Value of RIL_VERSION should not be changed in future. Here onwards,
     53  * when a new change is supposed to be introduced  which could involve new
     54  * schemes added like Wakelocks, data structures added/updated, etc, we would
     55  * just document RIL version associated with that change below. When OEM updates its
     56  * RIL with those changes, they would return that new RIL version during RIL_REGISTER.
     57  * We should make use of the returned version by vendor to identify appropriate scheme
     58  * or data structure version to use.
     59  *
     60  * Documentation of RIL version and associated changes
     61  * RIL_VERSION = 12 : This version corresponds to updated data structures namely
     62  *                    RIL_Data_Call_Response_v11, RIL_SIM_IO_v6, RIL_CardStatus_v6,
     63  *                    RIL_SimRefreshResponse_v7, RIL_CDMA_CallWaiting_v6,
     64  *                    RIL_LTE_SignalStrength_v8, RIL_SignalStrength_v10, RIL_CellIdentityGsm_v12
     65  *                    RIL_CellIdentityWcdma_v12, RIL_CellIdentityLte_v12,RIL_CellInfoGsm_v12,
     66  *                    RIL_CellInfoWcdma_v12, RIL_CellInfoLte_v12, RIL_CellInfo_v12.
     67  *
     68  * RIL_VERSION = 13 : This version includes new wakelock semantics and as the first
     69  *                    strongly versioned version it enforces structure use.
     70  *
     71  * RIL_VERSION = 14 : New data structures are added, namely RIL_CarrierMatchType,
     72  *                    RIL_Carrier, RIL_CarrierRestrictions and RIL_PCO_Data.
     73  *                    New commands added: RIL_REQUEST_SET_CARRIER_RESTRICTIONS,
     74  *                    RIL_REQUEST_SET_CARRIER_RESTRICTIONS and RIL_UNSOL_PCO_DATA.
     75  *
     76  * RIL_VERSION = 15 : New commands added:
     77  *                    RIL_UNSOL_MODEM_RESTART,
     78  *                    RIL_REQUEST_SEND_DEVICE_STATE,
     79  *                    RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER,
     80  *                    RIL_REQUEST_SET_SIM_CARD_POWER
     81  *                    The new parameters for RIL_REQUEST_SETUP_DATA_CALL,
     82  *                    Updated data structures: RIL_DataProfileInfo_v15, RIL_InitialAttachApn_v15
     83  *                    New data structure RIL_DataRegistrationStateResponse,
     84  *                    RIL_VoiceRegistrationStateResponse same is
     85  *                    used in RIL_REQUEST_DATA_REGISTRATION_STATE and
     86  *                    RIL_REQUEST_VOICE_REGISTRATION_STATE respectively.
     87  *                    New data structure RIL_OpenChannelParams.
     88  */
     89 #define RIL_VERSION 12
     90 #define LAST_IMPRECISE_RIL_VERSION 12 // Better self-documented name
     91 #define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */
     92 
     93 #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
     94 #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
     95 
     96 #define MAX_RILDS 3
     97 #define MAX_SERVICE_NAME_LENGTH 6
     98 #define MAX_CLIENT_ID_LENGTH 2
     99 #define MAX_DEBUG_SOCKET_NAME_LENGTH 12
    100 #define MAX_QEMU_PIPE_NAME_LENGTH  11
    101 #define MAX_UUID_LENGTH 64
    102 
    103 
    104 typedef void * RIL_Token;
    105 
    106 typedef enum {
    107     RIL_SOCKET_1,
    108 #if (SIM_COUNT >= 2)
    109     RIL_SOCKET_2,
    110 #if (SIM_COUNT >= 3)
    111     RIL_SOCKET_3,
    112 #endif
    113 #if (SIM_COUNT >= 4)
    114     RIL_SOCKET_4,
    115 #endif
    116 #endif
    117     RIL_SOCKET_NUM
    118 } RIL_SOCKET_ID;
    119 
    120 
    121 typedef enum {
    122     RIL_E_SUCCESS = 0,
    123     RIL_E_RADIO_NOT_AVAILABLE = 1,     /* If radio did not start or is resetting */
    124     RIL_E_GENERIC_FAILURE = 2,
    125     RIL_E_PASSWORD_INCORRECT = 3,      /* for PIN/PIN2 methods only! */
    126     RIL_E_SIM_PIN2 = 4,                /* Operation requires SIM PIN2 to be entered */
    127     RIL_E_SIM_PUK2 = 5,                /* Operation requires SIM PIN2 to be entered */
    128     RIL_E_REQUEST_NOT_SUPPORTED = 6,
    129     RIL_E_CANCELLED = 7,
    130     RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
    131                                                    call on a Class C GPRS device */
    132     RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  /* data ops are not allowed before device
    133                                                    registers in network */
    134     RIL_E_SMS_SEND_FAIL_RETRY = 10,             /* fail to send sms and need retry */
    135     RIL_E_SIM_ABSENT = 11,                      /* fail to set the location where CDMA subscription
    136                                                    shall be retrieved because of SIM or RUIM
    137                                                    card absent */
    138     RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12,      /* fail to find CDMA subscription from specified
    139                                                    location */
    140     RIL_E_MODE_NOT_SUPPORTED = 13,              /* HW does not support preferred network type */
    141     RIL_E_FDN_CHECK_FAILURE = 14,               /* command failed because recipient is not on FDN list */
    142     RIL_E_ILLEGAL_SIM_OR_ME = 15,               /* network selection failed due to
    143                                                    illegal SIM or ME */
    144     RIL_E_MISSING_RESOURCE = 16,                /* no logical channel available */
    145     RIL_E_NO_SUCH_ELEMENT = 17,                  /* application not found on SIM */
    146     RIL_E_DIAL_MODIFIED_TO_USSD = 18,           /* DIAL request modified to USSD */
    147     RIL_E_DIAL_MODIFIED_TO_SS = 19,             /* DIAL request modified to SS */
    148     RIL_E_DIAL_MODIFIED_TO_DIAL = 20,           /* DIAL request modified to DIAL with different
    149                                                    data */
    150     RIL_E_USSD_MODIFIED_TO_DIAL = 21,           /* USSD request modified to DIAL */
    151     RIL_E_USSD_MODIFIED_TO_SS = 22,             /* USSD request modified to SS */
    152     RIL_E_USSD_MODIFIED_TO_USSD = 23,           /* USSD request modified to different USSD
    153                                                    request */
    154     RIL_E_SS_MODIFIED_TO_DIAL = 24,             /* SS request modified to DIAL */
    155     RIL_E_SS_MODIFIED_TO_USSD = 25,             /* SS request modified to USSD */
    156     RIL_E_SUBSCRIPTION_NOT_SUPPORTED = 26,      /* Subscription not supported by RIL */
    157     RIL_E_SS_MODIFIED_TO_SS = 27,               /* SS request modified to different SS request */
    158     RIL_E_LCE_NOT_SUPPORTED = 36,               /* LCE service not supported(36 in RILConstants.java) */
    159     RIL_E_NO_MEMORY = 37,                       /* Not sufficient memory to process the request */
    160     RIL_E_INTERNAL_ERR = 38,                    /* Modem hit unexpected error scenario while handling
    161                                                    this request */
    162     RIL_E_SYSTEM_ERR = 39,                      /* Hit platform or system error */
    163     RIL_E_MODEM_ERR = 40,                       /* Vendor RIL got unexpected or incorrect response
    164                                                    from modem for this request */
    165     RIL_E_INVALID_STATE = 41,                   /* Unexpected request for the current state */
    166     RIL_E_NO_RESOURCES = 42,                    /* Not sufficient resource to process the request */
    167     RIL_E_SIM_ERR = 43,                         /* Received error from SIM card */
    168     RIL_E_INVALID_ARGUMENTS = 44,               /* Received invalid arguments in request */
    169     RIL_E_INVALID_SIM_STATE = 45,               /* Can not process the request in current SIM state */
    170     RIL_E_INVALID_MODEM_STATE = 46,             /* Can not process the request in current Modem state */
    171     RIL_E_INVALID_CALL_ID = 47,                 /* Received invalid call id in request */
    172     RIL_E_NO_SMS_TO_ACK = 48,                   /* ACK received when there is no SMS to ack */
    173     RIL_E_NETWORK_ERR = 49,                     /* Received error from network */
    174     RIL_E_REQUEST_RATE_LIMITED = 50,            /* Operation denied due to overly-frequent requests */
    175     RIL_E_SIM_BUSY = 51,                        /* SIM is busy */
    176     RIL_E_SIM_FULL = 52,                        /* The target EF is full */
    177     RIL_E_NETWORK_REJECT = 53,                  /* Request is rejected by network */
    178     RIL_E_OPERATION_NOT_ALLOWED = 54,           /* Not allowed the request now */
    179     RIL_E_EMPTY_RECORD = 55,                    /* The request record is empty */
    180     RIL_E_INVALID_SMS_FORMAT = 56,              /* Invalid sms format */
    181     RIL_E_ENCODING_ERR = 57,                    /* Message not encoded properly */
    182     RIL_E_INVALID_SMSC_ADDRESS = 58,            /* SMSC address specified is invalid */
    183     RIL_E_NO_SUCH_ENTRY = 59,                   /* No such entry present to perform the request */
    184     RIL_E_NETWORK_NOT_READY = 60,               /* Network is not ready to perform the request */
    185     RIL_E_NOT_PROVISIONED = 61,                 /* Device doesnot have this value provisioned */
    186     RIL_E_NO_SUBSCRIPTION = 62,                 /* Device doesnot have subscription */
    187     RIL_E_NO_NETWORK_FOUND = 63,                /* Network cannot be found */
    188     RIL_E_DEVICE_IN_USE = 64,                   /* Operation cannot be performed because the device
    189                                                    is currently in use */
    190     RIL_E_ABORTED = 65,                         /* Operation aborted */
    191     RIL_E_INVALID_RESPONSE = 66,                /* Invalid response sent by vendor code */
    192     // OEM specific error codes. To be used by OEM when they don't want to reveal
    193     // specific error codes which would be replaced by Generic failure.
    194     RIL_E_OEM_ERROR_1 = 501,
    195     RIL_E_OEM_ERROR_2 = 502,
    196     RIL_E_OEM_ERROR_3 = 503,
    197     RIL_E_OEM_ERROR_4 = 504,
    198     RIL_E_OEM_ERROR_5 = 505,
    199     RIL_E_OEM_ERROR_6 = 506,
    200     RIL_E_OEM_ERROR_7 = 507,
    201     RIL_E_OEM_ERROR_8 = 508,
    202     RIL_E_OEM_ERROR_9 = 509,
    203     RIL_E_OEM_ERROR_10 = 510,
    204     RIL_E_OEM_ERROR_11 = 511,
    205     RIL_E_OEM_ERROR_12 = 512,
    206     RIL_E_OEM_ERROR_13 = 513,
    207     RIL_E_OEM_ERROR_14 = 514,
    208     RIL_E_OEM_ERROR_15 = 515,
    209     RIL_E_OEM_ERROR_16 = 516,
    210     RIL_E_OEM_ERROR_17 = 517,
    211     RIL_E_OEM_ERROR_18 = 518,
    212     RIL_E_OEM_ERROR_19 = 519,
    213     RIL_E_OEM_ERROR_20 = 520,
    214     RIL_E_OEM_ERROR_21 = 521,
    215     RIL_E_OEM_ERROR_22 = 522,
    216     RIL_E_OEM_ERROR_23 = 523,
    217     RIL_E_OEM_ERROR_24 = 524,
    218     RIL_E_OEM_ERROR_25 = 525
    219 } RIL_Errno;
    220 
    221 typedef enum {
    222     RIL_CALL_ACTIVE = 0,
    223     RIL_CALL_HOLDING = 1,
    224     RIL_CALL_DIALING = 2,    /* MO call only */
    225     RIL_CALL_ALERTING = 3,   /* MO call only */
    226     RIL_CALL_INCOMING = 4,   /* MT call only */
    227     RIL_CALL_WAITING = 5     /* MT call only */
    228 } RIL_CallState;
    229 
    230 typedef enum {
    231     RADIO_STATE_OFF = 0,                   /* Radio explictly powered off (eg CFUN=0) */
    232     RADIO_STATE_UNAVAILABLE = 1,           /* Radio unavailable (eg, resetting or not booted) */
    233     RADIO_STATE_ON = 10                    /* Radio is on */
    234 } RIL_RadioState;
    235 
    236 typedef enum {
    237     RADIO_TECH_UNKNOWN = 0,
    238     RADIO_TECH_GPRS = 1,
    239     RADIO_TECH_EDGE = 2,
    240     RADIO_TECH_UMTS = 3,
    241     RADIO_TECH_IS95A = 4,
    242     RADIO_TECH_IS95B = 5,
    243     RADIO_TECH_1xRTT =  6,
    244     RADIO_TECH_EVDO_0 = 7,
    245     RADIO_TECH_EVDO_A = 8,
    246     RADIO_TECH_HSDPA = 9,
    247     RADIO_TECH_HSUPA = 10,
    248     RADIO_TECH_HSPA = 11,
    249     RADIO_TECH_EVDO_B = 12,
    250     RADIO_TECH_EHRPD = 13,
    251     RADIO_TECH_LTE = 14,
    252     RADIO_TECH_HSPAP = 15, // HSPA+
    253     RADIO_TECH_GSM = 16, // Only supports voice
    254     RADIO_TECH_TD_SCDMA = 17,
    255     RADIO_TECH_IWLAN = 18,
    256     RADIO_TECH_LTE_CA = 19
    257 } RIL_RadioTechnology;
    258 
    259 typedef enum {
    260     RAF_UNKNOWN =  (1 <<  RADIO_TECH_UNKNOWN),
    261     RAF_GPRS = (1 << RADIO_TECH_GPRS),
    262     RAF_EDGE = (1 << RADIO_TECH_EDGE),
    263     RAF_UMTS = (1 << RADIO_TECH_UMTS),
    264     RAF_IS95A = (1 << RADIO_TECH_IS95A),
    265     RAF_IS95B = (1 << RADIO_TECH_IS95B),
    266     RAF_1xRTT = (1 << RADIO_TECH_1xRTT),
    267     RAF_EVDO_0 = (1 << RADIO_TECH_EVDO_0),
    268     RAF_EVDO_A = (1 << RADIO_TECH_EVDO_A),
    269     RAF_HSDPA = (1 << RADIO_TECH_HSDPA),
    270     RAF_HSUPA = (1 << RADIO_TECH_HSUPA),
    271     RAF_HSPA = (1 << RADIO_TECH_HSPA),
    272     RAF_EVDO_B = (1 << RADIO_TECH_EVDO_B),
    273     RAF_EHRPD = (1 << RADIO_TECH_EHRPD),
    274     RAF_LTE = (1 << RADIO_TECH_LTE),
    275     RAF_HSPAP = (1 << RADIO_TECH_HSPAP),
    276     RAF_GSM = (1 << RADIO_TECH_GSM),
    277     RAF_TD_SCDMA = (1 << RADIO_TECH_TD_SCDMA),
    278     RAF_LTE_CA = (1 << RADIO_TECH_LTE_CA)
    279 } RIL_RadioAccessFamily;
    280 
    281 typedef enum {
    282     BAND_MODE_UNSPECIFIED = 0,      //"unspecified" (selected by baseband automatically)
    283     BAND_MODE_EURO = 1,             //"EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
    284     BAND_MODE_USA = 2,              //"US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
    285     BAND_MODE_JPN = 3,              //"JPN band" (WCDMA-800 / WCDMA-IMT-2000)
    286     BAND_MODE_AUS = 4,              //"AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
    287     BAND_MODE_AUS_2 = 5,            //"AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
    288     BAND_MODE_CELL_800 = 6,         //"Cellular" (800-MHz Band)
    289     BAND_MODE_PCS = 7,              //"PCS" (1900-MHz Band)
    290     BAND_MODE_JTACS = 8,            //"Band Class 3" (JTACS Band)
    291     BAND_MODE_KOREA_PCS = 9,        //"Band Class 4" (Korean PCS Band)
    292     BAND_MODE_5_450M = 10,          //"Band Class 5" (450-MHz Band)
    293     BAND_MODE_IMT2000 = 11,         //"Band Class 6" (2-GMHz IMT2000 Band)
    294     BAND_MODE_7_700M_2 = 12,        //"Band Class 7" (Upper 700-MHz Band)
    295     BAND_MODE_8_1800M = 13,         //"Band Class 8" (1800-MHz Band)
    296     BAND_MODE_9_900M = 14,          //"Band Class 9" (900-MHz Band)
    297     BAND_MODE_10_800M_2 = 15,       //"Band Class 10" (Secondary 800-MHz Band)
    298     BAND_MODE_EURO_PAMR_400M = 16,  //"Band Class 11" (400-MHz European PAMR Band)
    299     BAND_MODE_AWS = 17,             //"Band Class 15" (AWS Band)
    300     BAND_MODE_USA_2500M = 18        //"Band Class 16" (US 2.5-GHz Band)
    301 } RIL_RadioBandMode;
    302 
    303 typedef enum {
    304     RC_PHASE_CONFIGURED = 0,  // LM is configured is initial value and value after FINISH completes
    305     RC_PHASE_START      = 1,  // START is sent before Apply and indicates that an APPLY will be
    306                               // forthcoming with these same parameters
    307     RC_PHASE_APPLY      = 2,  // APPLY is sent after all LM's receive START and returned
    308                               // RIL_RadioCapability.status = 0, if any START's fail no
    309                               // APPLY will be sent
    310     RC_PHASE_UNSOL_RSP  = 3,  // UNSOL_RSP is sent with RIL_UNSOL_RADIO_CAPABILITY
    311     RC_PHASE_FINISH     = 4   // FINISH is sent after all commands have completed. If an error
    312                               // occurs in any previous command the RIL_RadioAccessesFamily and
    313                               // logicalModemUuid fields will be the prior configuration thus
    314                               // restoring the configuration to the previous value. An error
    315                               // returned by this command will generally be ignored or may
    316                               // cause that logical modem to be removed from service.
    317 } RadioCapabilityPhase;
    318 
    319 typedef enum {
    320     RC_STATUS_NONE       = 0, // This parameter has no meaning with RC_PHASE_START,
    321                               // RC_PHASE_APPLY
    322     RC_STATUS_SUCCESS    = 1, // Tell modem the action transaction of set radio
    323                               // capability was success with RC_PHASE_FINISH
    324     RC_STATUS_FAIL       = 2, // Tell modem the action transaction of set radio
    325                               // capability is fail with RC_PHASE_FINISH.
    326 } RadioCapabilityStatus;
    327 
    328 #define RIL_RADIO_CAPABILITY_VERSION 1
    329 typedef struct {
    330     int version;            // Version of structure, RIL_RADIO_CAPABILITY_VERSION
    331     int session;            // Unique session value defined by framework returned in all "responses/unsol"
    332     int phase;              // CONFIGURED, START, APPLY, FINISH
    333     int rat;                // RIL_RadioAccessFamily for the radio
    334     char logicalModemUuid[MAX_UUID_LENGTH]; // A UUID typically "com.xxxx.lmX where X is the logical modem.
    335     int status;             // Return status and an input parameter for RC_PHASE_FINISH
    336 } RIL_RadioCapability;
    337 
    338 // Do we want to split Data from Voice and the use
    339 // RIL_RadioTechnology for get/setPreferredVoice/Data ?
    340 typedef enum {
    341     PREF_NET_TYPE_GSM_WCDMA                = 0, /* GSM/WCDMA (WCDMA preferred) */
    342     PREF_NET_TYPE_GSM_ONLY                 = 1, /* GSM only */
    343     PREF_NET_TYPE_WCDMA                    = 2, /* WCDMA  */
    344     PREF_NET_TYPE_GSM_WCDMA_AUTO           = 3, /* GSM/WCDMA (auto mode, according to PRL) */
    345     PREF_NET_TYPE_CDMA_EVDO_AUTO           = 4, /* CDMA and EvDo (auto mode, according to PRL) */
    346     PREF_NET_TYPE_CDMA_ONLY                = 5, /* CDMA only */
    347     PREF_NET_TYPE_EVDO_ONLY                = 6, /* EvDo only */
    348     PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */
    349     PREF_NET_TYPE_LTE_CDMA_EVDO            = 8, /* LTE, CDMA and EvDo */
    350     PREF_NET_TYPE_LTE_GSM_WCDMA            = 9, /* LTE, GSM/WCDMA */
    351     PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA  = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */
    352     PREF_NET_TYPE_LTE_ONLY                 = 11, /* LTE only */
    353     PREF_NET_TYPE_LTE_WCDMA                = 12,  /* LTE/WCDMA */
    354     PREF_NET_TYPE_TD_SCDMA_ONLY            = 13, /* TD-SCDMA only */
    355     PREF_NET_TYPE_TD_SCDMA_WCDMA           = 14, /* TD-SCDMA and WCDMA */
    356     PREF_NET_TYPE_TD_SCDMA_LTE             = 15, /* TD-SCDMA and LTE */
    357     PREF_NET_TYPE_TD_SCDMA_GSM             = 16, /* TD-SCDMA and GSM */
    358     PREF_NET_TYPE_TD_SCDMA_GSM_LTE         = 17, /* TD-SCDMA,GSM and LTE */
    359     PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA       = 18, /* TD-SCDMA, GSM/WCDMA */
    360     PREF_NET_TYPE_TD_SCDMA_WCDMA_LTE       = 19, /* TD-SCDMA, WCDMA and LTE */
    361     PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_LTE   = 20, /* TD-SCDMA, GSM/WCDMA and LTE */
    362     PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO  = 21, /* TD-SCDMA, GSM/WCDMA, CDMA and EvDo */
    363     PREF_NET_TYPE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA   = 22  /* TD-SCDMA, LTE, CDMA, EvDo GSM/WCDMA */
    364 } RIL_PreferredNetworkType;
    365 
    366 /* Source for cdma subscription */
    367 typedef enum {
    368    CDMA_SUBSCRIPTION_SOURCE_RUIM_SIM = 0,
    369    CDMA_SUBSCRIPTION_SOURCE_NV = 1
    370 } RIL_CdmaSubscriptionSource;
    371 
    372 /* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
    373 typedef enum {
    374     RIL_UUS_TYPE1_IMPLICIT = 0,
    375     RIL_UUS_TYPE1_REQUIRED = 1,
    376     RIL_UUS_TYPE1_NOT_REQUIRED = 2,
    377     RIL_UUS_TYPE2_REQUIRED = 3,
    378     RIL_UUS_TYPE2_NOT_REQUIRED = 4,
    379     RIL_UUS_TYPE3_REQUIRED = 5,
    380     RIL_UUS_TYPE3_NOT_REQUIRED = 6
    381 } RIL_UUS_Type;
    382 
    383 /* User-to-User Signaling Information data coding schemes. Possible values for
    384  * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
    385  * specified in section 10.5.4.25 of 3GPP TS 24.008 */
    386 typedef enum {
    387     RIL_UUS_DCS_USP = 0,          /* User specified protocol */
    388     RIL_UUS_DCS_OSIHLP = 1,       /* OSI higher layer protocol */
    389     RIL_UUS_DCS_X244 = 2,         /* X.244 */
    390     RIL_UUS_DCS_RMCF = 3,         /* Reserved for system mangement
    391                                      convergence function */
    392     RIL_UUS_DCS_IA5c = 4          /* IA5 characters */
    393 } RIL_UUS_DCS;
    394 
    395 /* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
    396  * This data is passed in RIL_ExtensionRecord and rec contains this
    397  * structure when type is RIL_UUS_INFO_EXT_REC */
    398 typedef struct {
    399   RIL_UUS_Type    uusType;    /* UUS Type */
    400   RIL_UUS_DCS     uusDcs;     /* UUS Data Coding Scheme */
    401   int             uusLength;  /* Length of UUS Data */
    402   char *          uusData;    /* UUS Data */
    403 } RIL_UUS_Info;
    404 
    405 /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
    406 typedef struct {
    407   char isPresent;    /* non-zero if signal information record is present */
    408   char signalType;   /* as defined 3.7.5.5-1 */
    409   char alertPitch;   /* as defined 3.7.5.5-2 */
    410   char signal;       /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */
    411 } RIL_CDMA_SignalInfoRecord;
    412 
    413 typedef struct {
    414     RIL_CallState   state;
    415     int             index;      /* Connection Index for use with, eg, AT+CHLD */
    416     int             toa;        /* type of address, eg 145 = intl */
    417     char            isMpty;     /* nonzero if is mpty call */
    418     char            isMT;       /* nonzero if call is mobile terminated */
    419     char            als;        /* ALS line indicator if available
    420                                    (0 = line 1) */
    421     char            isVoice;    /* nonzero if this is is a voice call */
    422     char            isVoicePrivacy;     /* nonzero if CDMA voice privacy mode is active */
    423     char *          number;     /* Remote party number */
    424     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
    425     char *          name;       /* Remote party name */
    426     int             namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
    427     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
    428 } RIL_Call;
    429 
    430 /* Deprecated, use RIL_Data_Call_Response_v6 */
    431 typedef struct {
    432     int             cid;        /* Context ID, uniquely identifies this call */
    433     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
    434     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
    435                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". */
    436     char *          apn;        /* ignored */
    437     char *          address;    /* An address, e.g., "192.0.1.3" or "2001:db8::1". */
    438 } RIL_Data_Call_Response_v4;
    439 
    440 /*
    441  * Returned by RIL_REQUEST_SETUP_DATA_CALL, RIL_REQUEST_DATA_CALL_LIST
    442  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED, on error status != 0.
    443  */
    444 typedef struct {
    445     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
    446     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
    447                                            back-off timer value RIL wants to override the one
    448                                            pre-configured in FW.
    449                                            The unit is miliseconds.
    450                                            The value < 0 means no value is suggested.
    451                                            The value 0 means retry should be done ASAP.
    452                                            The value of INT_MAX(0x7fffffff) means no retry. */
    453     int             cid;        /* Context ID, uniquely identifies this call */
    454     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
    455     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
    456                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
    457                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
    458                                    such as "IP" or "IPV6" */
    459     char *          ifname;     /* The network interface name */
    460     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
    461                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
    462                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
    463                                    one of each. If the prefix length is absent the addresses
    464                                    are assumed to be point to point with IPv4 having a prefix
    465                                    length of 32 and IPv6 128. */
    466     char *          dnses;      /* A space-delimited list of DNS server addresses,
    467                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
    468                                    May be empty. */
    469     char *          gateways;   /* A space-delimited list of default gateway addresses,
    470                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
    471                                    May be empty in which case the addresses represent point
    472                                    to point connections. */
    473 } RIL_Data_Call_Response_v6;
    474 
    475 typedef struct {
    476     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
    477     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
    478                                            back-off timer value RIL wants to override the one
    479                                            pre-configured in FW.
    480                                            The unit is miliseconds.
    481                                            The value < 0 means no value is suggested.
    482                                            The value 0 means retry should be done ASAP.
    483                                            The value of INT_MAX(0x7fffffff) means no retry. */
    484     int             cid;        /* Context ID, uniquely identifies this call */
    485     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
    486     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
    487                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
    488                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
    489                                    such as "IP" or "IPV6" */
    490     char *          ifname;     /* The network interface name */
    491     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
    492                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
    493                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
    494                                    one of each. If the prefix length is absent the addresses
    495                                    are assumed to be point to point with IPv4 having a prefix
    496                                    length of 32 and IPv6 128. */
    497     char *          dnses;      /* A space-delimited list of DNS server addresses,
    498                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
    499                                    May be empty. */
    500     char *          gateways;   /* A space-delimited list of default gateway addresses,
    501                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
    502                                    May be empty in which case the addresses represent point
    503                                    to point connections. */
    504     char *          pcscf;    /* the Proxy Call State Control Function address
    505                                  via PCO(Protocol Configuration Option) for IMS client. */
    506 } RIL_Data_Call_Response_v9;
    507 
    508 typedef struct {
    509     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
    510     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
    511                                            back-off timer value RIL wants to override the one
    512                                            pre-configured in FW.
    513                                            The unit is miliseconds.
    514                                            The value < 0 means no value is suggested.
    515                                            The value 0 means retry should be done ASAP.
    516                                            The value of INT_MAX(0x7fffffff) means no retry. */
    517     int             cid;        /* Context ID, uniquely identifies this call */
    518     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
    519     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
    520                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
    521                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
    522                                    such as "IP" or "IPV6" */
    523     char *          ifname;     /* The network interface name */
    524     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
    525                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
    526                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
    527                                    one of each. If the prefix length is absent the addresses
    528                                    are assumed to be point to point with IPv4 having a prefix
    529                                    length of 32 and IPv6 128. */
    530     char *          dnses;      /* A space-delimited list of DNS server addresses,
    531                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
    532                                    May be empty. */
    533     char *          gateways;   /* A space-delimited list of default gateway addresses,
    534                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
    535                                    May be empty in which case the addresses represent point
    536                                    to point connections. */
    537     char *          pcscf;    /* the Proxy Call State Control Function address
    538                                  via PCO(Protocol Configuration Option) for IMS client. */
    539     int             mtu;        /* MTU received from network
    540                                    Value <= 0 means network has either not sent a value or
    541                                    sent an invalid value */
    542 } RIL_Data_Call_Response_v11;
    543 
    544 typedef enum {
    545     RADIO_TECH_3GPP = 1, /* 3GPP Technologies - GSM, WCDMA */
    546     RADIO_TECH_3GPP2 = 2 /* 3GPP2 Technologies - CDMA */
    547 } RIL_RadioTechnologyFamily;
    548 
    549 typedef struct {
    550     RIL_RadioTechnologyFamily tech;
    551     unsigned char             retry;       /* 0 == not retry, nonzero == retry */
    552     int                       messageRef;  /* Valid field if retry is set to nonzero.
    553                                               Contains messageRef from RIL_SMS_Response
    554                                               corresponding to failed MO SMS.
    555                                             */
    556 
    557     union {
    558         /* Valid field if tech is RADIO_TECH_3GPP2. See RIL_REQUEST_CDMA_SEND_SMS */
    559         RIL_CDMA_SMS_Message* cdmaMessage;
    560 
    561         /* Valid field if tech is RADIO_TECH_3GPP. See RIL_REQUEST_SEND_SMS */
    562         char**                gsmMessage;   /* This is an array of pointers where pointers
    563                                                are contiguous but elements pointed by those pointers
    564                                                are not contiguous
    565                                             */
    566     } message;
    567 } RIL_IMS_SMS_Message;
    568 
    569 typedef struct {
    570     int messageRef;   /* TP-Message-Reference for GSM,
    571                          and BearerData MessageId for CDMA
    572                          (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
    573     char *ackPDU;     /* or NULL if n/a */
    574     int errorCode;    /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
    575                          3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
    576                          -1 if unknown or not applicable*/
    577 } RIL_SMS_Response;
    578 
    579 /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
    580 typedef struct {
    581     int status;     /* Status of message.  See TS 27.005 3.1, "<stat>": */
    582                     /*      0 = "REC UNREAD"    */
    583                     /*      1 = "REC READ"      */
    584                     /*      2 = "STO UNSENT"    */
    585                     /*      3 = "STO SENT"      */
    586     char * pdu;     /* PDU of message to write, as an ASCII hex string less the SMSC address,
    587                        the TP-layer length is "strlen(pdu)/2". */
    588     char * smsc;    /* SMSC address in GSM BCD format prefixed by a length byte
    589                        (as expected by TS 27.005) or NULL for default SMSC */
    590 } RIL_SMS_WriteArgs;
    591 
    592 /** Used by RIL_REQUEST_DIAL */
    593 typedef struct {
    594     char * address;
    595     int clir;
    596             /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
    597              * clir == 0 on "use subscription default value"
    598              * clir == 1 on "CLIR invocation" (restrict CLI presentation)
    599              * clir == 2 on "CLIR suppression" (allow CLI presentation)
    600              */
    601     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
    602 } RIL_Dial;
    603 
    604 typedef struct {
    605     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
    606     int fileid;     /* EF id */
    607     char *path;     /* "pathid" from TS 27.007 +CRSM command.
    608                        Path is in hex asciii format eg "7f205f70"
    609                        Path must always be provided.
    610                      */
    611     int p1;
    612     int p2;
    613     int p3;
    614     char *data;     /* May be NULL*/
    615     char *pin2;     /* May be NULL*/
    616 } RIL_SIM_IO_v5;
    617 
    618 typedef struct {
    619     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
    620     int fileid;     /* EF id */
    621     char *path;     /* "pathid" from TS 27.007 +CRSM command.
    622                        Path is in hex asciii format eg "7f205f70"
    623                        Path must always be provided.
    624                      */
    625     int p1;
    626     int p2;
    627     int p3;
    628     char *data;     /* May be NULL*/
    629     char *pin2;     /* May be NULL*/
    630     char *aidPtr;   /* AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. */
    631 } RIL_SIM_IO_v6;
    632 
    633 /* Used by RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL and
    634  * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC. */
    635 typedef struct {
    636     int sessionid;  /* "sessionid" from TS 27.007 +CGLA command. Should be
    637                        ignored for +CSIM command. */
    638 
    639     /* Following fields are used to derive the APDU ("command" and "length"
    640        values in TS 27.007 +CSIM and +CGLA commands). */
    641     int cla;
    642     int instruction;
    643     int p1;
    644     int p2;
    645     int p3;         /* A negative P3 implies a 4 byte APDU. */
    646     char *data;     /* May be NULL. In hex string format. */
    647 } RIL_SIM_APDU;
    648 
    649 typedef struct {
    650     int sw1;
    651     int sw2;
    652     char *simResponse;  /* In hex string format ([a-fA-F0-9]*), except for SIM_AUTHENTICATION
    653                            response for which it is in Base64 format, see 3GPP TS 31.102 7.1.2 */
    654 } RIL_SIM_IO_Response;
    655 
    656 /* See also com.android.internal.telephony.gsm.CallForwardInfo */
    657 
    658 typedef struct {
    659     int             status;     /*
    660                                  * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
    661                                  * status 1 = active, 0 = not active
    662                                  *
    663                                  * For RIL_REQUEST_SET_CALL_FORWARD:
    664                                  * status is:
    665                                  * 0 = disable
    666                                  * 1 = enable
    667                                  * 2 = interrogate
    668                                  * 3 = registeration
    669                                  * 4 = erasure
    670                                  */
    671 
    672     int             reason;      /* from TS 27.007 7.11 "reason" */
    673     int             serviceClass;/* From 27.007 +CCFC/+CLCK "class"
    674                                     See table for Android mapping from
    675                                     MMI service code
    676                                     0 means user doesn't input class */
    677     int             toa;         /* "type" from TS 27.007 7.11 */
    678     char *          number;      /* "number" from TS 27.007 7.11. May be NULL */
    679     int             timeSeconds; /* for CF no reply only */
    680 }RIL_CallForwardInfo;
    681 
    682 typedef struct {
    683    char * cid;         /* Combination of LAC and Cell Id in 32 bits in GSM.
    684                         * Upper 16 bits is LAC and lower 16 bits
    685                         * is CID (as described in TS 27.005)
    686                         * Primary Scrambling Code (as described in TS 25.331)
    687                         *         in 9 bits in UMTS
    688                         * Valid values are hexadecimal 0x0000 - 0xffffffff.
    689                         */
    690    int    rssi;        /* Received RSSI in GSM,
    691                         * Level index of CPICH Received Signal Code Power in UMTS
    692                         */
    693 } RIL_NeighboringCell;
    694 
    695 typedef struct {
    696   char lce_status;                 /* LCE service status:
    697                                     * -1 = not supported;
    698                                     * 0 = stopped;
    699                                     * 1 = active.
    700                                     */
    701   unsigned int actual_interval_ms; /* actual LCE reporting interval,
    702                                     * meaningful only if LCEStatus = 1.
    703                                     */
    704 } RIL_LceStatusInfo;
    705 
    706 typedef struct {
    707   unsigned int last_hop_capacity_kbps; /* last-hop cellular capacity: kilobits/second. */
    708   unsigned char confidence_level;      /* capacity estimate confidence: 0-100 */
    709   unsigned char lce_suspended;         /* LCE report going to be suspended? (e.g., radio
    710                                         * moves to inactive state or network type change)
    711                                         * 1 = suspended;
    712                                         * 0 = not suspended.
    713                                         */
    714 } RIL_LceDataInfo;
    715 
    716 typedef enum {
    717     RIL_MATCH_ALL = 0,          /* Apply to all carriers with the same mcc/mnc */
    718     RIL_MATCH_SPN = 1,          /* Use SPN and mcc/mnc to identify the carrier */
    719     RIL_MATCH_IMSI_PREFIX = 2,  /* Use IMSI prefix and mcc/mnc to identify the carrier */
    720     RIL_MATCH_GID1 = 3,         /* Use GID1 and mcc/mnc to identify the carrier */
    721     RIL_MATCH_GID2 = 4,         /* Use GID2 and mcc/mnc to identify the carrier */
    722 } RIL_CarrierMatchType;
    723 
    724 typedef struct {
    725     const char * mcc;
    726     const char * mnc;
    727     RIL_CarrierMatchType match_type;   /* Specify match type for the carrier.
    728                                         * If its RIL_MATCH_ALL, match_data is null;
    729                                         * otherwise, match_data is the value for the match type.
    730                                         */
    731     const char * match_data;
    732 } RIL_Carrier;
    733 
    734 typedef struct {
    735   int32_t len_allowed_carriers;         /* length of array allowed_carriers */
    736   int32_t len_excluded_carriers;        /* length of array excluded_carriers */
    737   RIL_Carrier * allowed_carriers;       /* whitelist for allowed carriers */
    738   RIL_Carrier * excluded_carriers;      /* blacklist for explicitly excluded carriers
    739                                          * which match allowed_carriers. Eg. allowed_carriers match
    740                                          * mcc/mnc, excluded_carriers has same mcc/mnc and gid1
    741                                          * is ABCD. It means except the carrier whose gid1 is ABCD,
    742                                          * all carriers with the same mcc/mnc are allowed.
    743                                          */
    744 } RIL_CarrierRestrictions;
    745 
    746 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
    747 typedef enum {
    748     CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
    749     CALL_FAIL_NO_ROUTE_TO_DESTINATION = 3,
    750     CALL_FAIL_CHANNEL_UNACCEPTABLE = 6,
    751     CALL_FAIL_OPERATOR_DETERMINED_BARRING = 8,
    752     CALL_FAIL_NORMAL = 16,
    753     CALL_FAIL_BUSY = 17,
    754     CALL_FAIL_NO_USER_RESPONDING = 18,
    755     CALL_FAIL_NO_ANSWER_FROM_USER = 19,
    756     CALL_FAIL_CALL_REJECTED = 21,
    757     CALL_FAIL_NUMBER_CHANGED = 22,
    758     CALL_FAIL_PREEMPTION = 25,
    759     CALL_FAIL_DESTINATION_OUT_OF_ORDER = 27,
    760     CALL_FAIL_INVALID_NUMBER_FORMAT = 28,
    761     CALL_FAIL_FACILITY_REJECTED = 29,
    762     CALL_FAIL_RESP_TO_STATUS_ENQUIRY = 30,
    763     CALL_FAIL_NORMAL_UNSPECIFIED = 31,
    764     CALL_FAIL_CONGESTION = 34,
    765     CALL_FAIL_NETWORK_OUT_OF_ORDER = 38,
    766     CALL_FAIL_TEMPORARY_FAILURE = 41,
    767     CALL_FAIL_SWITCHING_EQUIPMENT_CONGESTION = 42,
    768     CALL_FAIL_ACCESS_INFORMATION_DISCARDED = 43,
    769     CALL_FAIL_REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44,
    770     CALL_FAIL_RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47,
    771     CALL_FAIL_QOS_UNAVAILABLE = 49,
    772     CALL_FAIL_REQUESTED_FACILITY_NOT_SUBSCRIBED = 50,
    773     CALL_FAIL_INCOMING_CALLS_BARRED_WITHIN_CUG = 55,
    774     CALL_FAIL_BEARER_CAPABILITY_NOT_AUTHORIZED = 57,
    775     CALL_FAIL_BEARER_CAPABILITY_UNAVAILABLE = 58,
    776     CALL_FAIL_SERVICE_OPTION_NOT_AVAILABLE = 63,
    777     CALL_FAIL_BEARER_SERVICE_NOT_IMPLEMENTED = 65,
    778     CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
    779     CALL_FAIL_REQUESTED_FACILITY_NOT_IMPLEMENTED = 69,
    780     CALL_FAIL_ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70,
    781     CALL_FAIL_SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79,
    782     CALL_FAIL_INVALID_TRANSACTION_IDENTIFIER = 81,
    783     CALL_FAIL_USER_NOT_MEMBER_OF_CUG = 87,
    784     CALL_FAIL_INCOMPATIBLE_DESTINATION = 88,
    785     CALL_FAIL_INVALID_TRANSIT_NW_SELECTION = 91,
    786     CALL_FAIL_SEMANTICALLY_INCORRECT_MESSAGE = 95,
    787     CALL_FAIL_INVALID_MANDATORY_INFORMATION = 96,
    788     CALL_FAIL_MESSAGE_TYPE_NON_IMPLEMENTED = 97,
    789     CALL_FAIL_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98,
    790     CALL_FAIL_INFORMATION_ELEMENT_NON_EXISTENT = 99,
    791     CALL_FAIL_CONDITIONAL_IE_ERROR = 100,
    792     CALL_FAIL_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101,
    793     CALL_FAIL_RECOVERY_ON_TIMER_EXPIRED = 102,
    794     CALL_FAIL_PROTOCOL_ERROR_UNSPECIFIED = 111,
    795     CALL_FAIL_INTERWORKING_UNSPECIFIED = 127,
    796     CALL_FAIL_CALL_BARRED = 240,
    797     CALL_FAIL_FDN_BLOCKED = 241,
    798     CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
    799     CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
    800     CALL_FAIL_DIAL_MODIFIED_TO_USSD = 244, /* STK Call Control */
    801     CALL_FAIL_DIAL_MODIFIED_TO_SS = 245,
    802     CALL_FAIL_DIAL_MODIFIED_TO_DIAL = 246,
    803     CALL_FAIL_RADIO_OFF = 247, /* Radio is OFF */
    804     CALL_FAIL_OUT_OF_SERVICE = 248, /* No cellular coverage */
    805     CALL_FAIL_NO_VALID_SIM = 249, /* No valid SIM is present */
    806     CALL_FAIL_RADIO_INTERNAL_ERROR = 250, /* Internal error at Modem */
    807     CALL_FAIL_NETWORK_RESP_TIMEOUT = 251, /* No response from network */
    808     CALL_FAIL_NETWORK_REJECT = 252, /* Explicit network reject */
    809     CALL_FAIL_RADIO_ACCESS_FAILURE = 253, /* RRC connection failure. Eg.RACH */
    810     CALL_FAIL_RADIO_LINK_FAILURE = 254, /* Radio Link Failure */
    811     CALL_FAIL_RADIO_LINK_LOST = 255, /* Radio link lost due to poor coverage */
    812     CALL_FAIL_RADIO_UPLINK_FAILURE = 256, /* Radio uplink failure */
    813     CALL_FAIL_RADIO_SETUP_FAILURE = 257, /* RRC connection setup failure */
    814     CALL_FAIL_RADIO_RELEASE_NORMAL = 258, /* RRC connection release, normal */
    815     CALL_FAIL_RADIO_RELEASE_ABNORMAL = 259, /* RRC connection release, abnormal */
    816     CALL_FAIL_ACCESS_CLASS_BLOCKED = 260, /* Access class barring */
    817     CALL_FAIL_NETWORK_DETACH = 261, /* Explicit network detach */
    818     CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
    819     CALL_FAIL_CDMA_DROP = 1001,
    820     CALL_FAIL_CDMA_INTERCEPT = 1002,
    821     CALL_FAIL_CDMA_REORDER = 1003,
    822     CALL_FAIL_CDMA_SO_REJECT = 1004,
    823     CALL_FAIL_CDMA_RETRY_ORDER = 1005,
    824     CALL_FAIL_CDMA_ACCESS_FAILURE = 1006,
    825     CALL_FAIL_CDMA_PREEMPTED = 1007,
    826     CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
    827                                             during emergency callback mode */
    828     CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
    829 
    830     /* OEM specific error codes. Used to distinguish error from
    831      * CALL_FAIL_ERROR_UNSPECIFIED and help assist debugging */
    832     CALL_FAIL_OEM_CAUSE_1 = 0xf001,
    833     CALL_FAIL_OEM_CAUSE_2 = 0xf002,
    834     CALL_FAIL_OEM_CAUSE_3 = 0xf003,
    835     CALL_FAIL_OEM_CAUSE_4 = 0xf004,
    836     CALL_FAIL_OEM_CAUSE_5 = 0xf005,
    837     CALL_FAIL_OEM_CAUSE_6 = 0xf006,
    838     CALL_FAIL_OEM_CAUSE_7 = 0xf007,
    839     CALL_FAIL_OEM_CAUSE_8 = 0xf008,
    840     CALL_FAIL_OEM_CAUSE_9 = 0xf009,
    841     CALL_FAIL_OEM_CAUSE_10 = 0xf00a,
    842     CALL_FAIL_OEM_CAUSE_11 = 0xf00b,
    843     CALL_FAIL_OEM_CAUSE_12 = 0xf00c,
    844     CALL_FAIL_OEM_CAUSE_13 = 0xf00d,
    845     CALL_FAIL_OEM_CAUSE_14 = 0xf00e,
    846     CALL_FAIL_OEM_CAUSE_15 = 0xf00f,
    847 
    848     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff /* This error will be deprecated soon,
    849                                             vendor code should make sure to map error
    850                                             code to specific error */
    851 } RIL_LastCallFailCause;
    852 
    853 typedef struct {
    854   RIL_LastCallFailCause cause_code;
    855   char *                vendor_cause;
    856 } RIL_LastCallFailCauseInfo;
    857 
    858 /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
    859 typedef enum {
    860     PDP_FAIL_NONE = 0, /* No error, connection ok */
    861 
    862     /* an integer cause code defined in TS 24.008
    863        section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B.
    864        If the implementation does not have access to the exact cause codes,
    865        then it should return one of the following values,
    866        as the UI layer needs to distinguish these
    867        cases for error notification and potential retries. */
    868     PDP_FAIL_OPERATOR_BARRED = 0x08,               /* no retry */
    869     PDP_FAIL_NAS_SIGNALLING = 0x0E,
    870     PDP_FAIL_LLC_SNDCP = 0x19,
    871     PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A,
    872     PDP_FAIL_MISSING_UKNOWN_APN = 0x1B,            /* no retry */
    873     PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C,      /* no retry */
    874     PDP_FAIL_USER_AUTHENTICATION = 0x1D,           /* no retry */
    875     PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E,        /* no retry */
    876     PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
    877     PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20,  /* no retry */
    878     PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */
    879     PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
    880     PDP_FAIL_NSAPI_IN_USE = 0x23,                  /* no retry */
    881     PDP_FAIL_REGULAR_DEACTIVATION = 0x24,          /* possibly restart radio,
    882                                                       based on framework config */
    883     PDP_FAIL_QOS_NOT_ACCEPTED = 0x25,
    884     PDP_FAIL_NETWORK_FAILURE = 0x26,
    885     PDP_FAIL_UMTS_REACTIVATION_REQ = 0x27,
    886     PDP_FAIL_FEATURE_NOT_SUPP = 0x28,
    887     PDP_FAIL_TFT_SEMANTIC_ERROR = 0x29,
    888     PDP_FAIL_TFT_SYTAX_ERROR = 0x2A,
    889     PDP_FAIL_UNKNOWN_PDP_CONTEXT = 0x2B,
    890     PDP_FAIL_FILTER_SEMANTIC_ERROR = 0x2C,
    891     PDP_FAIL_FILTER_SYTAX_ERROR = 0x2D,
    892     PDP_FAIL_PDP_WITHOUT_ACTIVE_TFT = 0x2E,
    893     PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32,             /* no retry */
    894     PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33,             /* no retry */
    895     PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
    896     PDP_FAIL_ESM_INFO_NOT_RECEIVED = 0x35,
    897     PDP_FAIL_PDN_CONN_DOES_NOT_EXIST = 0x36,
    898     PDP_FAIL_MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37,
    899     PDP_FAIL_MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41,
    900     PDP_FAIL_UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42,
    901     PDP_FAIL_INVALID_TRANSACTION_ID = 0x51,
    902     PDP_FAIL_MESSAGE_INCORRECT_SEMANTIC = 0x5F,
    903     PDP_FAIL_INVALID_MANDATORY_INFO = 0x60,
    904     PDP_FAIL_MESSAGE_TYPE_UNSUPPORTED = 0x61,
    905     PDP_FAIL_MSG_TYPE_NONCOMPATIBLE_STATE = 0x62,
    906     PDP_FAIL_UNKNOWN_INFO_ELEMENT = 0x63,
    907     PDP_FAIL_CONDITIONAL_IE_ERROR = 0x64,
    908     PDP_FAIL_MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65,
    909     PDP_FAIL_PROTOCOL_ERRORS = 0x6F,             /* no retry */
    910     PDP_FAIL_APN_TYPE_CONFLICT = 0x70,
    911     PDP_FAIL_INVALID_PCSCF_ADDR = 0x71,
    912     PDP_FAIL_INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72,
    913     PDP_FAIL_EMM_ACCESS_BARRED = 0x73,
    914     PDP_FAIL_EMERGENCY_IFACE_ONLY = 0x74,
    915     PDP_FAIL_IFACE_MISMATCH = 0x75,
    916     PDP_FAIL_COMPANION_IFACE_IN_USE = 0x76,
    917     PDP_FAIL_IP_ADDRESS_MISMATCH = 0x77,
    918     PDP_FAIL_IFACE_AND_POL_FAMILY_MISMATCH = 0x78,
    919     PDP_FAIL_EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79,
    920     PDP_FAIL_AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A,
    921 
    922     // OEM specific error codes. To be used by OEMs when they don't want to
    923     // reveal error code which would be replaced by PDP_FAIL_ERROR_UNSPECIFIED
    924     PDP_FAIL_OEM_DCFAILCAUSE_1 = 0x1001,
    925     PDP_FAIL_OEM_DCFAILCAUSE_2 = 0x1002,
    926     PDP_FAIL_OEM_DCFAILCAUSE_3 = 0x1003,
    927     PDP_FAIL_OEM_DCFAILCAUSE_4 = 0x1004,
    928     PDP_FAIL_OEM_DCFAILCAUSE_5 = 0x1005,
    929     PDP_FAIL_OEM_DCFAILCAUSE_6 = 0x1006,
    930     PDP_FAIL_OEM_DCFAILCAUSE_7 = 0x1007,
    931     PDP_FAIL_OEM_DCFAILCAUSE_8 = 0x1008,
    932     PDP_FAIL_OEM_DCFAILCAUSE_9 = 0x1009,
    933     PDP_FAIL_OEM_DCFAILCAUSE_10 = 0x100A,
    934     PDP_FAIL_OEM_DCFAILCAUSE_11 = 0x100B,
    935     PDP_FAIL_OEM_DCFAILCAUSE_12 = 0x100C,
    936     PDP_FAIL_OEM_DCFAILCAUSE_13 = 0x100D,
    937     PDP_FAIL_OEM_DCFAILCAUSE_14 = 0x100E,
    938     PDP_FAIL_OEM_DCFAILCAUSE_15 = 0x100F,
    939 
    940     /* Not mentioned in the specification */
    941     PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
    942     PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
    943 
    944    /* reasons for data call drop - network/modem disconnect */
    945     PDP_FAIL_SIGNAL_LOST = -3,
    946     PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry
    947                                              with parameters appropriate for new technology */
    948     PDP_FAIL_RADIO_POWER_OFF = -5,        /* data call was disconnected because radio was resetting,
    949                                              powered off - no retry */
    950     PDP_FAIL_TETHERED_CALL_ACTIVE = -6,   /* data call was disconnected by modem because tethered
    951                                              mode was up on same APN/data profile - no retry until
    952                                              tethered call is off */
    953 
    954     PDP_FAIL_ERROR_UNSPECIFIED = 0xffff,  /* retry silently. Will be deprecated soon as
    955                                              new error codes are added making this unnecessary */
    956 } RIL_DataCallFailCause;
    957 
    958 /* See RIL_REQUEST_SETUP_DATA_CALL */
    959 typedef enum {
    960     RIL_DATA_PROFILE_DEFAULT    = 0,
    961     RIL_DATA_PROFILE_TETHERED   = 1,
    962     RIL_DATA_PROFILE_IMS        = 2,
    963     RIL_DATA_PROFILE_FOTA       = 3,
    964     RIL_DATA_PROFILE_CBS        = 4,
    965     RIL_DATA_PROFILE_OEM_BASE   = 1000,    /* Start of OEM-specific profiles */
    966     RIL_DATA_PROFILE_INVALID    = 0xFFFFFFFF
    967 } RIL_DataProfile;
    968 
    969 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
    970 typedef struct {
    971     int     notificationType;   /*
    972                                  * 0 = MO intermediate result code
    973                                  * 1 = MT unsolicited result code
    974                                  */
    975     int     code;               /* See 27.007 7.17
    976                                    "code1" for MO
    977                                    "code2" for MT. */
    978     int     index;              /* CUG index. See 27.007 7.17. */
    979     int     type;               /* "type" from 27.007 7.17 (MT only). */
    980     char *  number;             /* "number" from 27.007 7.17
    981                                    (MT only, may be NULL). */
    982 } RIL_SuppSvcNotification;
    983 
    984 #define RIL_CARD_MAX_APPS     8
    985 
    986 typedef enum {
    987     RIL_CARDSTATE_ABSENT     = 0,
    988     RIL_CARDSTATE_PRESENT    = 1,
    989     RIL_CARDSTATE_ERROR      = 2,
    990     RIL_CARDSTATE_RESTRICTED = 3  /* card is present but not usable due to carrier restrictions.*/
    991 } RIL_CardState;
    992 
    993 typedef enum {
    994     RIL_PERSOSUBSTATE_UNKNOWN                   = 0, /* initial state */
    995     RIL_PERSOSUBSTATE_IN_PROGRESS               = 1, /* in between each lock transition */
    996     RIL_PERSOSUBSTATE_READY                     = 2, /* when either SIM or RUIM Perso is finished
    997                                                         since each app can only have 1 active perso
    998                                                         involved */
    999     RIL_PERSOSUBSTATE_SIM_NETWORK               = 3,
   1000     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET        = 4,
   1001     RIL_PERSOSUBSTATE_SIM_CORPORATE             = 5,
   1002     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER      = 6,
   1003     RIL_PERSOSUBSTATE_SIM_SIM                   = 7,
   1004     RIL_PERSOSUBSTATE_SIM_NETWORK_PUK           = 8, /* The corresponding perso lock is blocked */
   1005     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK    = 9,
   1006     RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK         = 10,
   1007     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK  = 11,
   1008     RIL_PERSOSUBSTATE_SIM_SIM_PUK               = 12,
   1009     RIL_PERSOSUBSTATE_RUIM_NETWORK1             = 13,
   1010     RIL_PERSOSUBSTATE_RUIM_NETWORK2             = 14,
   1011     RIL_PERSOSUBSTATE_RUIM_HRPD                 = 15,
   1012     RIL_PERSOSUBSTATE_RUIM_CORPORATE            = 16,
   1013     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER     = 17,
   1014     RIL_PERSOSUBSTATE_RUIM_RUIM                 = 18,
   1015     RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK         = 19, /* The corresponding perso lock is blocked */
   1016     RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK         = 20,
   1017     RIL_PERSOSUBSTATE_RUIM_HRPD_PUK             = 21,
   1018     RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK        = 22,
   1019     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
   1020     RIL_PERSOSUBSTATE_RUIM_RUIM_PUK             = 24
   1021 } RIL_PersoSubstate;
   1022 
   1023 typedef enum {
   1024     RIL_APPSTATE_UNKNOWN               = 0,
   1025     RIL_APPSTATE_DETECTED              = 1,
   1026     RIL_APPSTATE_PIN                   = 2, /* If PIN1 or UPin is required */
   1027     RIL_APPSTATE_PUK                   = 3, /* If PUK1 or Puk for UPin is required */
   1028     RIL_APPSTATE_SUBSCRIPTION_PERSO    = 4, /* perso_substate should be look at
   1029                                                when app_state is assigned to this value */
   1030     RIL_APPSTATE_READY                 = 5
   1031 } RIL_AppState;
   1032 
   1033 typedef enum {
   1034     RIL_PINSTATE_UNKNOWN              = 0,
   1035     RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
   1036     RIL_PINSTATE_ENABLED_VERIFIED     = 2,
   1037     RIL_PINSTATE_DISABLED             = 3,
   1038     RIL_PINSTATE_ENABLED_BLOCKED      = 4,
   1039     RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
   1040 } RIL_PinState;
   1041 
   1042 typedef enum {
   1043   RIL_APPTYPE_UNKNOWN = 0,
   1044   RIL_APPTYPE_SIM     = 1,
   1045   RIL_APPTYPE_USIM    = 2,
   1046   RIL_APPTYPE_RUIM    = 3,
   1047   RIL_APPTYPE_CSIM    = 4,
   1048   RIL_APPTYPE_ISIM    = 5
   1049 } RIL_AppType;
   1050 
   1051 /*
   1052  * Please note that registration state UNKNOWN is
   1053  * treated as "out of service" in the Android telephony.
   1054  * Registration state REG_DENIED must be returned if Location Update
   1055  * Reject (with cause 17 - Network Failure) is received
   1056  * repeatedly from the network, to facilitate
   1057  * "managed roaming"
   1058  */
   1059 typedef enum {
   1060     RIL_NOT_REG_AND_NOT_SEARCHING = 0,           // Not registered, MT is not currently searching
   1061                                                  // a new operator to register
   1062     RIL_REG_HOME = 1,                            // Registered, home network
   1063     RIL_NOT_REG_AND_SEARCHING = 2,               // Not registered, but MT is currently searching
   1064                                                  // a new operator to register
   1065     RIL_REG_DENIED = 3,                          // Registration denied
   1066     RIL_UNKNOWN = 4,                             // Unknown
   1067     RIL_REG_ROAMING = 5,                         // Registered, roaming
   1068     RIL_NOT_REG_AND_EMERGENCY_AVAILABLE_AND_NOT_SEARCHING = 10,   // Same as
   1069                                                  // RIL_NOT_REG_AND_NOT_SEARCHING but indicates that
   1070                                                  // emergency calls are enabled.
   1071     RIL_NOT_REG_AND_EMERGENCY_AVAILABLE_AND_SEARCHING = 12,  // Same as RIL_NOT_REG_AND_SEARCHING
   1072                                                  // but indicates that
   1073                                                  // emergency calls are enabled.
   1074     RIL_REG_DENIED_AND_EMERGENCY_AVAILABLE = 13, // Same as REG_DENIED but indicates that
   1075                                                  // emergency calls are enabled.
   1076     RIL_UNKNOWN_AND_EMERGENCY_AVAILABLE = 14,    // Same as UNKNOWN but indicates that
   1077                                                  // emergency calls are enabled.
   1078 } RIL_RegState;
   1079 
   1080 typedef struct
   1081 {
   1082   RIL_AppType      app_type;
   1083   RIL_AppState     app_state;
   1084   RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
   1085                                        RIL_APPSTATE_SUBSCRIPTION_PERSO */
   1086   char             *aid_ptr;        /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
   1087                                        0x30, 0x30, 0x30 */
   1088   char             *app_label_ptr;  /* null terminated string */
   1089   int              pin1_replaced;   /* applicable to USIM, CSIM & ISIM */
   1090   RIL_PinState     pin1;
   1091   RIL_PinState     pin2;
   1092 } RIL_AppStatus;
   1093 
   1094 /* Deprecated, use RIL_CardStatus_v6 */
   1095 typedef struct
   1096 {
   1097   RIL_CardState card_state;
   1098   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
   1099   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
   1100   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
   1101   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
   1102   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
   1103 } RIL_CardStatus_v5;
   1104 
   1105 typedef struct
   1106 {
   1107   RIL_CardState card_state;
   1108   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
   1109   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
   1110   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
   1111   int           ims_subscription_app_index;      /* value < RIL_CARD_MAX_APPS, -1 if none */
   1112   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
   1113   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
   1114 } RIL_CardStatus_v6;
   1115 
   1116 /** The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH
   1117  *      or as part of RIL_SimRefreshResponse_v7
   1118  */
   1119 typedef enum {
   1120     /* A file on SIM has been updated.  data[1] contains the EFID. */
   1121     SIM_FILE_UPDATE = 0,
   1122     /* SIM initialized.  All files should be re-read. */
   1123     SIM_INIT = 1,
   1124     /* SIM reset.  SIM power required, SIM may be locked and all files should be re-read. */
   1125     SIM_RESET = 2
   1126 } RIL_SimRefreshResult;
   1127 
   1128 typedef struct {
   1129     RIL_SimRefreshResult result;
   1130     int                  ef_id; /* is the EFID of the updated file if the result is */
   1131                                 /* SIM_FILE_UPDATE or 0 for any other result. */
   1132     char *               aid;   /* is AID(application ID) of the card application */
   1133                                 /* See ETSI 102.221 8.1 and 101.220 4 */
   1134                                 /*     For SIM_FILE_UPDATE result it can be set to AID of */
   1135                                 /*         application in which updated EF resides or it can be */
   1136                                 /*         NULL if EF is outside of an application. */
   1137                                 /*     For SIM_INIT result this field is set to AID of */
   1138                                 /*         application that caused REFRESH */
   1139                                 /*     For SIM_RESET result it is NULL. */
   1140 } RIL_SimRefreshResponse_v7;
   1141 
   1142 /* Deprecated, use RIL_CDMA_CallWaiting_v6 */
   1143 typedef struct {
   1144     char *          number;             /* Remote party number */
   1145     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
   1146     char *          name;               /* Remote party name */
   1147     RIL_CDMA_SignalInfoRecord signalInfoRecord;
   1148 } RIL_CDMA_CallWaiting_v5;
   1149 
   1150 typedef struct {
   1151     char *          number;             /* Remote party number */
   1152     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
   1153     char *          name;               /* Remote party name */
   1154     RIL_CDMA_SignalInfoRecord signalInfoRecord;
   1155     /* Number type/Number plan required to support International Call Waiting */
   1156     int             number_type;        /* 0=Unknown, 1=International, 2=National,
   1157                                            3=Network specific, 4=subscriber */
   1158     int             number_plan;        /* 0=Unknown, 1=ISDN, 3=Data, 4=Telex, 8=Nat'l, 9=Private */
   1159 } RIL_CDMA_CallWaiting_v6;
   1160 
   1161 /**
   1162  * Which types of Cell Broadcast Message (CBM) are to be received by the ME
   1163  *
   1164  * uFromServiceID - uToServiceID defines a range of CBM message identifiers
   1165  * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
   1166  * and 9.4.4.2.2 for UMTS. All other values can be treated as empty
   1167  * CBM message ID.
   1168  *
   1169  * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
   1170  * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
   1171  * and 9.4.4.2.3 for UMTS.
   1172  * All other values can be treated as empty CBM data coding scheme.
   1173  *
   1174  * selected 0 means message types specified in <fromServiceId, toServiceId>
   1175  * and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted.
   1176  *
   1177  * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and
   1178  * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG.
   1179  */
   1180 typedef struct {
   1181     int fromServiceId;
   1182     int toServiceId;
   1183     int fromCodeScheme;
   1184     int toCodeScheme;
   1185     unsigned char selected;
   1186 } RIL_GSM_BroadcastSmsConfigInfo;
   1187 
   1188 /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
   1189 #define RIL_RESTRICTED_STATE_NONE           0x00
   1190 /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
   1191 #define RIL_RESTRICTED_STATE_CS_EMERGENCY   0x01
   1192 /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
   1193 #define RIL_RESTRICTED_STATE_CS_NORMAL      0x02
   1194 /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
   1195 #define RIL_RESTRICTED_STATE_CS_ALL         0x04
   1196 /* Block packet data access due to restriction. */
   1197 #define RIL_RESTRICTED_STATE_PS_ALL         0x10
   1198 
   1199 /* The status for an OTASP/OTAPA session */
   1200 typedef enum {
   1201     CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED,
   1202     CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED,
   1203     CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED,
   1204     CDMA_OTA_PROVISION_STATUS_SSD_UPDATED,
   1205     CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED,
   1206     CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED,
   1207     CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED,
   1208     CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED,
   1209     CDMA_OTA_PROVISION_STATUS_COMMITTED,
   1210     CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED,
   1211     CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED,
   1212     CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED
   1213 } RIL_CDMA_OTA_ProvisionStatus;
   1214 
   1215 typedef struct {
   1216     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
   1217     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
   1218 } RIL_GW_SignalStrength;
   1219 
   1220 typedef struct {
   1221     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
   1222     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
   1223     int timingAdvance;   /* Timing Advance in bit periods. 1 bit period = 48/13 us.
   1224                           * INT_MAX denotes invalid value */
   1225 } RIL_GSM_SignalStrength_v12;
   1226 
   1227 typedef struct {
   1228     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
   1229     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
   1230 } RIL_SignalStrengthWcdma;
   1231 
   1232 typedef struct {
   1233     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
   1234                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
   1235                * value will be 75.
   1236                */
   1237     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
   1238                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
   1239                * will be 125.
   1240                */
   1241 } RIL_CDMA_SignalStrength;
   1242 
   1243 
   1244 typedef struct {
   1245     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
   1246                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
   1247                * value will be 75.
   1248                */
   1249     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
   1250                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
   1251                * will be 125.
   1252                */
   1253     int signalNoiseRatio; /* Valid values are 0-8.  8 is the highest signal to noise ratio. */
   1254 } RIL_EVDO_SignalStrength;
   1255 
   1256 typedef struct {
   1257     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
   1258     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
   1259                           * Range: 44 to 140 dBm
   1260                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
   1261                           * Reference: 3GPP TS 36.133 9.1.4 */
   1262     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
   1263                           * Range: 20 to 3 dB.
   1264                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
   1265                           * Reference: 3GPP TS 36.133 9.1.7 */
   1266     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
   1267                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
   1268                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
   1269                           * Reference: 3GPP TS 36.101 8.1.1 */
   1270     int cqi;             /* The current Channel Quality Indicator.
   1271                           * Range: 0 to 15.
   1272                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
   1273                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
   1274 } RIL_LTE_SignalStrength;
   1275 
   1276 typedef struct {
   1277     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
   1278     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
   1279                           * Range: 44 to 140 dBm
   1280                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
   1281                           * Reference: 3GPP TS 36.133 9.1.4 */
   1282     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
   1283                           * Range: 20 to 3 dB.
   1284                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
   1285                           * Reference: 3GPP TS 36.133 9.1.7 */
   1286     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
   1287                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
   1288                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
   1289                           * Reference: 3GPP TS 36.101 8.1.1 */
   1290     int cqi;             /* The current Channel Quality Indicator.
   1291                           * Range: 0 to 15.
   1292                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
   1293                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
   1294     int timingAdvance;   /* timing advance in micro seconds for a one way trip from cell to device.
   1295                           * Approximate distance can be calculated using 300m/us * timingAdvance.
   1296                           * Range: 0 to 0x7FFFFFFE
   1297                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
   1298                           * Reference: 3GPP 36.321 section 6.1.3.5
   1299                           * also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html */
   1300 } RIL_LTE_SignalStrength_v8;
   1301 
   1302 typedef struct {
   1303     int rscp;    /* The Received Signal Code Power in dBm multipled by -1.
   1304                   * Range : 25 to 120
   1305                   * INT_MAX: 0x7FFFFFFF denotes invalid value.
   1306                   * Reference: 3GPP TS 25.123, section 9.1.1.1 */
   1307 } RIL_TD_SCDMA_SignalStrength;
   1308 
   1309 /* Deprecated, use RIL_SignalStrength_v6 */
   1310 typedef struct {
   1311     RIL_GW_SignalStrength   GW_SignalStrength;
   1312     RIL_CDMA_SignalStrength CDMA_SignalStrength;
   1313     RIL_EVDO_SignalStrength EVDO_SignalStrength;
   1314 } RIL_SignalStrength_v5;
   1315 
   1316 typedef struct {
   1317     RIL_GW_SignalStrength   GW_SignalStrength;
   1318     RIL_CDMA_SignalStrength CDMA_SignalStrength;
   1319     RIL_EVDO_SignalStrength EVDO_SignalStrength;
   1320     RIL_LTE_SignalStrength  LTE_SignalStrength;
   1321 } RIL_SignalStrength_v6;
   1322 
   1323 typedef struct {
   1324     RIL_GW_SignalStrength       GW_SignalStrength;
   1325     RIL_CDMA_SignalStrength     CDMA_SignalStrength;
   1326     RIL_EVDO_SignalStrength     EVDO_SignalStrength;
   1327     RIL_LTE_SignalStrength_v8   LTE_SignalStrength;
   1328 } RIL_SignalStrength_v8;
   1329 
   1330 typedef struct {
   1331     RIL_GW_SignalStrength       GW_SignalStrength;
   1332     RIL_CDMA_SignalStrength     CDMA_SignalStrength;
   1333     RIL_EVDO_SignalStrength     EVDO_SignalStrength;
   1334     RIL_LTE_SignalStrength_v8   LTE_SignalStrength;
   1335     RIL_TD_SCDMA_SignalStrength TD_SCDMA_SignalStrength;
   1336 } RIL_SignalStrength_v10;
   1337 
   1338 typedef struct {
   1339     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
   1340     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
   1341     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
   1342     int cid;    /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown  */
   1343 } RIL_CellIdentityGsm;
   1344 
   1345 typedef struct {
   1346     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
   1347     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
   1348     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
   1349     int cid;    /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown  */
   1350     int arfcn;  /* 16-bit GSM Absolute RF channel number, INT_MAX if unknown */
   1351     uint8_t bsic;/* 6-bit Base Station Identity Code, 0xFF if unknown */
   1352 } RIL_CellIdentityGsm_v12;
   1353 
   1354 typedef struct {
   1355     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
   1356     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
   1357     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
   1358     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
   1359     int psc;    /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */
   1360 } RIL_CellIdentityWcdma;
   1361 
   1362 typedef struct {
   1363     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
   1364     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
   1365     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
   1366     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
   1367     int psc;    /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */
   1368     int uarfcn; /* 16-bit UMTS Absolute RF Channel Number, INT_MAX if unknown */
   1369 } RIL_CellIdentityWcdma_v12;
   1370 
   1371 typedef struct {
   1372     int networkId;      /* Network Id 0..65535, INT_MAX if unknown */
   1373     int systemId;       /* CDMA System Id 0..32767, INT_MAX if unknown  */
   1374     int basestationId;  /* Base Station Id 0..65535, INT_MAX if unknown  */
   1375     int longitude;      /* Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
   1376                          * It is represented in units of 0.25 seconds and ranges from -2592000
   1377                          * to 2592000, both values inclusive (corresponding to a range of -180
   1378                          * to +180 degrees). INT_MAX if unknown */
   1379 
   1380     int latitude;       /* Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
   1381                          * It is represented in units of 0.25 seconds and ranges from -1296000
   1382                          * to 1296000, both values inclusive (corresponding to a range of -90
   1383                          * to +90 degrees). INT_MAX if unknown */
   1384 } RIL_CellIdentityCdma;
   1385 
   1386 typedef struct {
   1387     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
   1388     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
   1389     int ci;     /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */
   1390     int pci;    /* physical cell id 0..503, INT_MAX if unknown  */
   1391     int tac;    /* 16-bit tracking area code, INT_MAX if unknown  */
   1392 } RIL_CellIdentityLte;
   1393 
   1394 typedef struct {
   1395     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
   1396     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
   1397     int ci;     /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */
   1398     int pci;    /* physical cell id 0..503, INT_MAX if unknown  */
   1399     int tac;    /* 16-bit tracking area code, INT_MAX if unknown  */
   1400     int earfcn; /* 18-bit LTE Absolute RC Channel Number, INT_MAX if unknown */
   1401 } RIL_CellIdentityLte_v12;
   1402 
   1403 typedef struct {
   1404     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
   1405     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
   1406     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
   1407     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
   1408     int cpid;    /* 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown */
   1409 } RIL_CellIdentityTdscdma;
   1410 
   1411 typedef struct {
   1412   RIL_CellIdentityGsm   cellIdentityGsm;
   1413   RIL_GW_SignalStrength signalStrengthGsm;
   1414 } RIL_CellInfoGsm;
   1415 
   1416 typedef struct {
   1417   RIL_CellIdentityGsm_v12   cellIdentityGsm;
   1418   RIL_GSM_SignalStrength_v12 signalStrengthGsm;
   1419 } RIL_CellInfoGsm_v12;
   1420 
   1421 typedef struct {
   1422   RIL_CellIdentityWcdma cellIdentityWcdma;
   1423   RIL_SignalStrengthWcdma signalStrengthWcdma;
   1424 } RIL_CellInfoWcdma;
   1425 
   1426 typedef struct {
   1427   RIL_CellIdentityWcdma_v12 cellIdentityWcdma;
   1428   RIL_SignalStrengthWcdma signalStrengthWcdma;
   1429 } RIL_CellInfoWcdma_v12;
   1430 
   1431 typedef struct {
   1432   RIL_CellIdentityCdma      cellIdentityCdma;
   1433   RIL_CDMA_SignalStrength   signalStrengthCdma;
   1434   RIL_EVDO_SignalStrength   signalStrengthEvdo;
   1435 } RIL_CellInfoCdma;
   1436 
   1437 typedef struct {
   1438   RIL_CellIdentityLte        cellIdentityLte;
   1439   RIL_LTE_SignalStrength_v8  signalStrengthLte;
   1440 } RIL_CellInfoLte;
   1441 
   1442 typedef struct {
   1443   RIL_CellIdentityLte_v12    cellIdentityLte;
   1444   RIL_LTE_SignalStrength_v8  signalStrengthLte;
   1445 } RIL_CellInfoLte_v12;
   1446 
   1447 typedef struct {
   1448   RIL_CellIdentityTdscdma cellIdentityTdscdma;
   1449   RIL_TD_SCDMA_SignalStrength signalStrengthTdscdma;
   1450 } RIL_CellInfoTdscdma;
   1451 
   1452 // Must be the same as CellInfo.TYPE_XXX
   1453 typedef enum {
   1454   RIL_CELL_INFO_TYPE_NONE   = 0, /* indicates no cell information */
   1455   RIL_CELL_INFO_TYPE_GSM    = 1,
   1456   RIL_CELL_INFO_TYPE_CDMA   = 2,
   1457   RIL_CELL_INFO_TYPE_LTE    = 3,
   1458   RIL_CELL_INFO_TYPE_WCDMA  = 4,
   1459   RIL_CELL_INFO_TYPE_TD_SCDMA  = 5
   1460 } RIL_CellInfoType;
   1461 
   1462 // Must be the same as CellInfo.TIMESTAMP_TYPE_XXX
   1463 typedef enum {
   1464     RIL_TIMESTAMP_TYPE_UNKNOWN = 0,
   1465     RIL_TIMESTAMP_TYPE_ANTENNA = 1,
   1466     RIL_TIMESTAMP_TYPE_MODEM = 2,
   1467     RIL_TIMESTAMP_TYPE_OEM_RIL = 3,
   1468     RIL_TIMESTAMP_TYPE_JAVA_RIL = 4,
   1469 } RIL_TimeStampType;
   1470 
   1471 typedef struct {
   1472   RIL_CellInfoType  cellInfoType;   /* cell type for selecting from union CellInfo */
   1473   int               registered;     /* !0 if this cell is registered 0 if not registered */
   1474   RIL_TimeStampType timeStampType;  /* type of time stamp represented by timeStamp */
   1475   uint64_t          timeStamp;      /* Time in nanos as returned by ril_nano_time */
   1476   union {
   1477     RIL_CellInfoGsm     gsm;
   1478     RIL_CellInfoCdma    cdma;
   1479     RIL_CellInfoLte     lte;
   1480     RIL_CellInfoWcdma   wcdma;
   1481     RIL_CellInfoTdscdma tdscdma;
   1482   } CellInfo;
   1483 } RIL_CellInfo;
   1484 
   1485 typedef struct {
   1486   RIL_CellInfoType  cellInfoType;   /* cell type for selecting from union CellInfo */
   1487   int               registered;     /* !0 if this cell is registered 0 if not registered */
   1488   RIL_TimeStampType timeStampType;  /* type of time stamp represented by timeStamp */
   1489   uint64_t          timeStamp;      /* Time in nanos as returned by ril_nano_time */
   1490   union {
   1491     RIL_CellInfoGsm_v12     gsm;
   1492     RIL_CellInfoCdma        cdma;
   1493     RIL_CellInfoLte_v12     lte;
   1494     RIL_CellInfoWcdma_v12   wcdma;
   1495     RIL_CellInfoTdscdma     tdscdma;
   1496   } CellInfo;
   1497 } RIL_CellInfo_v12;
   1498 
   1499 typedef struct {
   1500   RIL_CellInfoType  cellInfoType;   /* cell type for selecting from union CellInfo */
   1501   union {
   1502     RIL_CellIdentityGsm_v12 cellIdentityGsm;
   1503     RIL_CellIdentityWcdma_v12 cellIdentityWcdma;
   1504     RIL_CellIdentityLte_v12 cellIdentityLte;
   1505     RIL_CellIdentityTdscdma cellIdentityTdscdma;
   1506     RIL_CellIdentityCdma cellIdentityCdma;
   1507   };
   1508 }RIL_CellIdentity_v16;
   1509 
   1510 typedef struct {
   1511     RIL_RegState regState;                // Valid reg states are RIL_NOT_REG_AND_NOT_SEARCHING,
   1512                                           // REG_HOME, RIL_NOT_REG_AND_SEARCHING, REG_DENIED,
   1513                                           // UNKNOWN, REG_ROAMING defined in RegState
   1514     RIL_RadioTechnology rat;              // indicates the available voice radio technology,
   1515                                           // valid values as defined by RadioTechnology.
   1516     int32_t cssSupported;                 // concurrent services support indicator. if
   1517                                           // registered on a CDMA system.
   1518                                           // 0 - Concurrent services not supported,
   1519                                           // 1 - Concurrent services supported
   1520     int32_t roamingIndicator;             // TSB-58 Roaming Indicator if registered
   1521                                           // on a CDMA or EVDO system or -1 if not.
   1522                                           // Valid values are 0-255.
   1523     int32_t systemIsInPrl;                // indicates whether the current system is in the
   1524                                           // PRL if registered on a CDMA or EVDO system or -1 if
   1525                                           // not. 0=not in the PRL, 1=in the PRL
   1526     int32_t defaultRoamingIndicator;      // default Roaming Indicator from the PRL,
   1527                                           // if registered on a CDMA or EVDO system or -1 if not.
   1528                                           // Valid values are 0-255.
   1529     int32_t reasonForDenial;              // reasonForDenial if registration state is 3
   1530                                           // (Registration denied) this is an enumerated reason why
   1531                                           // registration was denied. See 3GPP TS 24.008,
   1532                                           // 10.5.3.6 and Annex G.
   1533                                           // 0 - General
   1534                                           // 1 - Authentication Failure
   1535                                           // 2 - IMSI unknown in HLR
   1536                                           // 3 - Illegal MS
   1537                                           // 4 - Illegal ME
   1538                                           // 5 - PLMN not allowed
   1539                                           // 6 - Location area not allowed
   1540                                           // 7 - Roaming not allowed
   1541                                           // 8 - No Suitable Cells in this Location Area
   1542                                           // 9 - Network failure
   1543                                           // 10 - Persistent location update reject
   1544                                           // 11 - PLMN not allowed
   1545                                           // 12 - Location area not allowed
   1546                                           // 13 - Roaming not allowed in this Location Area
   1547                                           // 15 - No Suitable Cells in this Location Area
   1548                                           // 17 - Network Failure
   1549                                           // 20 - MAC Failure
   1550                                           // 21 - Sync Failure
   1551                                           // 22 - Congestion
   1552                                           // 23 - GSM Authentication unacceptable
   1553                                           // 25 - Not Authorized for this CSG
   1554                                           // 32 - Service option not supported
   1555                                           // 33 - Requested service option not subscribed
   1556                                           // 34 - Service option temporarily out of order
   1557                                           // 38 - Call cannot be identified
   1558                                           // 48-63 - Retry upon entry into a new cell
   1559                                           // 95 - Semantically incorrect message
   1560                                           // 96 - Invalid mandatory information
   1561                                           // 97 - Message type non-existent or not implemented
   1562                                           // 98 - Message type not compatible with protocol state
   1563                                           // 99 - Information element non-existent or
   1564                                           //      not implemented
   1565                                           // 100 - Conditional IE error
   1566                                           // 101 - Message not compatible with protocol state;
   1567     RIL_CellIdentity_v16 cellIdentity;    // current cell information
   1568 }RIL_VoiceRegistrationStateResponse;
   1569 
   1570 
   1571 typedef struct {
   1572     RIL_RegState regState;                // Valid reg states are RIL_NOT_REG_AND_NOT_SEARCHING,
   1573                                           // REG_HOME, RIL_NOT_REG_AND_SEARCHING, REG_DENIED,
   1574                                           // UNKNOWN, REG_ROAMING defined in RegState
   1575     RIL_RadioTechnology rat;              // indicates the available data radio technology,
   1576                                           // valid values as defined by RadioTechnology.
   1577     int32_t reasonDataDenied;             // if registration state is 3 (Registration
   1578                                           // denied) this is an enumerated reason why
   1579                                           // registration was denied. See 3GPP TS 24.008,
   1580                                           // Annex G.6 "Additional cause codes for GMM".
   1581                                           // 7 == GPRS services not allowed
   1582                                           // 8 == GPRS services and non-GPRS services not allowed
   1583                                           // 9 == MS identity cannot be derived by the network
   1584                                           // 10 == Implicitly detached
   1585                                           // 14 == GPRS services not allowed in this PLMN
   1586                                           // 16 == MSC temporarily not reachable
   1587                                           // 40 == No PDP context activated
   1588     int32_t maxDataCalls;                 // The maximum number of simultaneous Data Calls that
   1589                                           // must be established using setupDataCall().
   1590     RIL_CellIdentity_v16 cellIdentity;    // Current cell information
   1591 }RIL_DataRegistrationStateResponse;
   1592 
   1593 /* Names of the CDMA info records (C.S0005 section 3.7.5) */
   1594 typedef enum {
   1595   RIL_CDMA_DISPLAY_INFO_REC,
   1596   RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC,
   1597   RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC,
   1598   RIL_CDMA_CONNECTED_NUMBER_INFO_REC,
   1599   RIL_CDMA_SIGNAL_INFO_REC,
   1600   RIL_CDMA_REDIRECTING_NUMBER_INFO_REC,
   1601   RIL_CDMA_LINE_CONTROL_INFO_REC,
   1602   RIL_CDMA_EXTENDED_DISPLAY_INFO_REC,
   1603   RIL_CDMA_T53_CLIR_INFO_REC,
   1604   RIL_CDMA_T53_RELEASE_INFO_REC,
   1605   RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC
   1606 } RIL_CDMA_InfoRecName;
   1607 
   1608 /* Display Info Rec as defined in C.S0005 section 3.7.5.1
   1609    Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
   1610    Note: the Extended Display info rec contains multiple records of the
   1611    form: display_tag, display_len, and display_len occurrences of the
   1612    chari field if the display_tag is not 10000000 or 10000001.
   1613    To save space, the records are stored consecutively in a byte buffer.
   1614    The display_tag, display_len and chari fields are all 1 byte.
   1615 */
   1616 
   1617 typedef struct {
   1618   char alpha_len;
   1619   char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH];
   1620 } RIL_CDMA_DisplayInfoRecord;
   1621 
   1622 /* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
   1623    Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
   1624    Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
   1625 */
   1626 
   1627 typedef struct {
   1628   char len;
   1629   char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH];
   1630   char number_type;
   1631   char number_plan;
   1632   char pi;
   1633   char si;
   1634 } RIL_CDMA_NumberInfoRecord;
   1635 
   1636 /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
   1637 typedef enum {
   1638   RIL_REDIRECTING_REASON_UNKNOWN = 0,
   1639   RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1,
   1640   RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2,
   1641   RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9,
   1642   RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
   1643   RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15,
   1644   RIL_REDIRECTING_REASON_RESERVED
   1645 } RIL_CDMA_RedirectingReason;
   1646 
   1647 typedef struct {
   1648   RIL_CDMA_NumberInfoRecord redirectingNumber;
   1649   /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */
   1650   RIL_CDMA_RedirectingReason redirectingReason;
   1651 } RIL_CDMA_RedirectingNumberInfoRecord;
   1652 
   1653 /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
   1654 typedef struct {
   1655   char lineCtrlPolarityIncluded;
   1656   char lineCtrlToggle;
   1657   char lineCtrlReverse;
   1658   char lineCtrlPowerDenial;
   1659 } RIL_CDMA_LineControlInfoRecord;
   1660 
   1661 /* T53 CLIR Information Record */
   1662 typedef struct {
   1663   char cause;
   1664 } RIL_CDMA_T53_CLIRInfoRecord;
   1665 
   1666 /* T53 Audio Control Information Record */
   1667 typedef struct {
   1668   char upLink;
   1669   char downLink;
   1670 } RIL_CDMA_T53_AudioControlInfoRecord;
   1671 
   1672 typedef struct {
   1673 
   1674   RIL_CDMA_InfoRecName name;
   1675 
   1676   union {
   1677     /* Display and Extended Display Info Rec */
   1678     RIL_CDMA_DisplayInfoRecord           display;
   1679 
   1680     /* Called Party Number, Calling Party Number, Connected Number Info Rec */
   1681     RIL_CDMA_NumberInfoRecord            number;
   1682 
   1683     /* Signal Info Rec */
   1684     RIL_CDMA_SignalInfoRecord            signal;
   1685 
   1686     /* Redirecting Number Info Rec */
   1687     RIL_CDMA_RedirectingNumberInfoRecord redir;
   1688 
   1689     /* Line Control Info Rec */
   1690     RIL_CDMA_LineControlInfoRecord       lineCtrl;
   1691 
   1692     /* T53 CLIR Info Rec */
   1693     RIL_CDMA_T53_CLIRInfoRecord          clir;
   1694 
   1695     /* T53 Audio Control Info Rec */
   1696     RIL_CDMA_T53_AudioControlInfoRecord  audioCtrl;
   1697   } rec;
   1698 } RIL_CDMA_InformationRecord;
   1699 
   1700 #define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10
   1701 
   1702 typedef struct {
   1703   char numberOfInfoRecs;
   1704   RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS];
   1705 } RIL_CDMA_InformationRecords;
   1706 
   1707 /* See RIL_REQUEST_NV_READ_ITEM */
   1708 typedef struct {
   1709   RIL_NV_Item itemID;
   1710 } RIL_NV_ReadItem;
   1711 
   1712 /* See RIL_REQUEST_NV_WRITE_ITEM */
   1713 typedef struct {
   1714   RIL_NV_Item   itemID;
   1715   char *        value;
   1716 } RIL_NV_WriteItem;
   1717 
   1718 typedef enum {
   1719     HANDOVER_STARTED = 0,
   1720     HANDOVER_COMPLETED = 1,
   1721     HANDOVER_FAILED = 2,
   1722     HANDOVER_CANCELED = 3
   1723 } RIL_SrvccState;
   1724 
   1725 /* hardware configuration reported to RILJ. */
   1726 typedef enum {
   1727    RIL_HARDWARE_CONFIG_MODEM = 0,
   1728    RIL_HARDWARE_CONFIG_SIM = 1,
   1729 } RIL_HardwareConfig_Type;
   1730 
   1731 typedef enum {
   1732    RIL_HARDWARE_CONFIG_STATE_ENABLED = 0,
   1733    RIL_HARDWARE_CONFIG_STATE_STANDBY = 1,
   1734    RIL_HARDWARE_CONFIG_STATE_DISABLED = 2,
   1735 } RIL_HardwareConfig_State;
   1736 
   1737 typedef struct {
   1738    int rilModel;
   1739    uint32_t rat; /* bitset - ref. RIL_RadioTechnology. */
   1740    int maxVoice;
   1741    int maxData;
   1742    int maxStandby;
   1743 } RIL_HardwareConfig_Modem;
   1744 
   1745 typedef struct {
   1746    char modemUuid[MAX_UUID_LENGTH];
   1747 } RIL_HardwareConfig_Sim;
   1748 
   1749 typedef struct {
   1750   RIL_HardwareConfig_Type type;
   1751   char uuid[MAX_UUID_LENGTH];
   1752   RIL_HardwareConfig_State state;
   1753   union {
   1754      RIL_HardwareConfig_Modem modem;
   1755      RIL_HardwareConfig_Sim sim;
   1756   } cfg;
   1757 } RIL_HardwareConfig;
   1758 
   1759 typedef enum {
   1760   SS_CFU,
   1761   SS_CF_BUSY,
   1762   SS_CF_NO_REPLY,
   1763   SS_CF_NOT_REACHABLE,
   1764   SS_CF_ALL,
   1765   SS_CF_ALL_CONDITIONAL,
   1766   SS_CLIP,
   1767   SS_CLIR,
   1768   SS_COLP,
   1769   SS_COLR,
   1770   SS_WAIT,
   1771   SS_BAOC,
   1772   SS_BAOIC,
   1773   SS_BAOIC_EXC_HOME,
   1774   SS_BAIC,
   1775   SS_BAIC_ROAMING,
   1776   SS_ALL_BARRING,
   1777   SS_OUTGOING_BARRING,
   1778   SS_INCOMING_BARRING
   1779 } RIL_SsServiceType;
   1780 
   1781 typedef enum {
   1782   SS_ACTIVATION,
   1783   SS_DEACTIVATION,
   1784   SS_INTERROGATION,
   1785   SS_REGISTRATION,
   1786   SS_ERASURE
   1787 } RIL_SsRequestType;
   1788 
   1789 typedef enum {
   1790   SS_ALL_TELE_AND_BEARER_SERVICES,
   1791   SS_ALL_TELESEVICES,
   1792   SS_TELEPHONY,
   1793   SS_ALL_DATA_TELESERVICES,
   1794   SS_SMS_SERVICES,
   1795   SS_ALL_TELESERVICES_EXCEPT_SMS
   1796 } RIL_SsTeleserviceType;
   1797 
   1798 #define SS_INFO_MAX 4
   1799 #define NUM_SERVICE_CLASSES 7
   1800 
   1801 typedef struct {
   1802   int numValidIndexes; /* This gives the number of valid values in cfInfo.
   1803                        For example if voice is forwarded to one number and data
   1804                        is forwarded to a different one then numValidIndexes will be
   1805                        2 indicating total number of valid values in cfInfo.
   1806                        Similarly if all the services are forwarded to the same
   1807                        number then the value of numValidIndexes will be 1. */
   1808 
   1809   RIL_CallForwardInfo cfInfo[NUM_SERVICE_CLASSES]; /* This is the response data
   1810                                                       for SS request to query call
   1811                                                       forward status. see
   1812                                                       RIL_REQUEST_QUERY_CALL_FORWARD_STATUS */
   1813 } RIL_CfData;
   1814 
   1815 typedef struct {
   1816   RIL_SsServiceType serviceType;
   1817   RIL_SsRequestType requestType;
   1818   RIL_SsTeleserviceType teleserviceType;
   1819   int serviceClass;
   1820   RIL_Errno result;
   1821 
   1822   union {
   1823     int ssInfo[SS_INFO_MAX]; /* This is the response data for most of the SS GET/SET
   1824                                 RIL requests. E.g. RIL_REQUSET_GET_CLIR returns
   1825                                 two ints, so first two values of ssInfo[] will be
   1826                                 used for response if serviceType is SS_CLIR and
   1827                                 requestType is SS_INTERROGATION */
   1828 
   1829     RIL_CfData cfData;
   1830   };
   1831 } RIL_StkCcUnsolSsResponse;
   1832 
   1833 /**
   1834  * Data connection power state
   1835  */
   1836 typedef enum {
   1837     RIL_DC_POWER_STATE_LOW      = 1,        // Low power state
   1838     RIL_DC_POWER_STATE_MEDIUM   = 2,        // Medium power state
   1839     RIL_DC_POWER_STATE_HIGH     = 3,        // High power state
   1840     RIL_DC_POWER_STATE_UNKNOWN  = INT32_MAX // Unknown state
   1841 } RIL_DcPowerStates;
   1842 
   1843 /**
   1844  * Data connection real time info
   1845  */
   1846 typedef struct {
   1847     uint64_t                    time;       // Time in nanos as returned by ril_nano_time
   1848     RIL_DcPowerStates           powerState; // Current power state
   1849 } RIL_DcRtInfo;
   1850 
   1851 /**
   1852  * Data profile to modem
   1853  */
   1854 typedef struct {
   1855     /* id of the data profile */
   1856     int profileId;
   1857     /* the APN to connect to */
   1858     char* apn;
   1859     /** one of the PDP_type values in TS 27.007 section 10.1.1.
   1860      * For example, "IP", "IPV6", "IPV4V6", or "PPP".
   1861      */
   1862     char* protocol;
   1863     /** authentication protocol used for this PDP context
   1864      * (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3)
   1865      */
   1866     int authType;
   1867     /* the username for APN, or NULL */
   1868     char* user;
   1869     /* the password for APN, or NULL */
   1870     char* password;
   1871     /* the profile type, TYPE_COMMON-0, TYPE_3GPP-1, TYPE_3GPP2-2 */
   1872     int type;
   1873     /* the period in seconds to limit the maximum connections */
   1874     int maxConnsTime;
   1875     /* the maximum connections during maxConnsTime */
   1876     int maxConns;
   1877     /** the required wait time in seconds after a successful UE initiated
   1878      * disconnect of a given PDN connection before the device can send
   1879      * a new PDN connection request for that given PDN
   1880      */
   1881     int waitTime;
   1882     /* true to enable the profile, 0 to disable, 1 to enable */
   1883     int enabled;
   1884 } RIL_DataProfileInfo;
   1885 
   1886 typedef struct {
   1887     /* id of the data profile */
   1888     int profileId;
   1889     /* the APN to connect to */
   1890     char* apn;
   1891     /** one of the PDP_type values in TS 27.007 section 10.1.1.
   1892      * For example, "IP", "IPV6", "IPV4V6", or "PPP".
   1893      */
   1894     char* protocol;
   1895     /** one of the PDP_type values in TS 27.007 section 10.1.1 used on roaming network.
   1896      * For example, "IP", "IPV6", "IPV4V6", or "PPP".
   1897      */
   1898     char *roamingProtocol;
   1899     /** authentication protocol used for this PDP context
   1900      * (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3)
   1901      */
   1902     int authType;
   1903     /* the username for APN, or NULL */
   1904     char* user;
   1905     /* the password for APN, or NULL */
   1906     char* password;
   1907     /* the profile type, TYPE_COMMON-0, TYPE_3GPP-1, TYPE_3GPP2-2 */
   1908     int type;
   1909     /* the period in seconds to limit the maximum connections */
   1910     int maxConnsTime;
   1911     /* the maximum connections during maxConnsTime */
   1912     int maxConns;
   1913     /** the required wait time in seconds after a successful UE initiated
   1914      * disconnect of a given PDN connection before the device can send
   1915      * a new PDN connection request for that given PDN
   1916      */
   1917     int waitTime;
   1918     /* true to enable the profile, 0 to disable, 1 to enable */
   1919     int enabled;
   1920     /* supported APN types bitmask. See RIL_ApnTypes for the value of each bit. */
   1921     int supportedTypesBitmask;
   1922     /** the bearer bitmask. See RIL_RadioAccessFamily for the value of each bit. */
   1923     int bearerBitmask;
   1924     /** maximum transmission unit (MTU) size in bytes */
   1925     int mtu;
   1926     /** the MVNO type: possible values are "imsi", "gid", "spn" */
   1927     char *mvnoType;
   1928     /** MVNO match data. Can be anything defined by the carrier. For example,
   1929      *        SPN like: "A MOBILE", "BEN NL", etc...
   1930      *        IMSI like: "302720x94", "2060188", etc...
   1931      *        GID like: "4E", "33", etc...
   1932      */
   1933     char *mvnoMatchData;
   1934 } RIL_DataProfileInfo_v15;
   1935 
   1936 /* Tx Power Levels */
   1937 #define RIL_NUM_TX_POWER_LEVELS     5
   1938 
   1939 /**
   1940  * Aggregate modem activity information
   1941  */
   1942 typedef struct {
   1943 
   1944   /* total time (in ms) when modem is in a low power or
   1945    * sleep state
   1946    */
   1947   uint32_t sleep_mode_time_ms;
   1948 
   1949   /* total time (in ms) when modem is awake but neither
   1950    * the transmitter nor receiver are active/awake */
   1951   uint32_t idle_mode_time_ms;
   1952 
   1953   /* total time (in ms) during which the transmitter is active/awake,
   1954    * subdivided by manufacturer-defined device-specific
   1955    * contiguous increasing ranges of transmit power between
   1956    * 0 and the transmitter's maximum transmit power.
   1957    */
   1958   uint32_t tx_mode_time_ms[RIL_NUM_TX_POWER_LEVELS];
   1959 
   1960   /* total time (in ms) for which receiver is active/awake and
   1961    * the transmitter is inactive */
   1962   uint32_t rx_mode_time_ms;
   1963 } RIL_ActivityStatsInfo;
   1964 
   1965 typedef enum {
   1966     RIL_APN_TYPE_UNKNOWN      = 0x0,          // Unknown
   1967     RIL_APN_TYPE_DEFAULT      = 0x1,          // APN type for default data traffic
   1968     RIL_APN_TYPE_MMS          = 0x2,          // APN type for MMS traffic
   1969     RIL_APN_TYPE_SUPL         = 0x4,          // APN type for SUPL assisted GPS
   1970     RIL_APN_TYPE_DUN          = 0x8,          // APN type for DUN traffic
   1971     RIL_APN_TYPE_HIPRI        = 0x10,         // APN type for HiPri traffic
   1972     RIL_APN_TYPE_FOTA         = 0x20,         // APN type for FOTA
   1973     RIL_APN_TYPE_IMS          = 0x40,         // APN type for IMS
   1974     RIL_APN_TYPE_CBS          = 0x80,         // APN type for CBS
   1975     RIL_APN_TYPE_IA           = 0x100,        // APN type for IA Initial Attach APN
   1976     RIL_APN_TYPE_EMERGENCY    = 0x200,        // APN type for Emergency PDN. This is not an IA apn,
   1977                                               // but is used for access to carrier services in an
   1978                                               // emergency call situation.
   1979     RIL_APN_TYPE_ALL          = 0xFFFFFFFF    // All APN types
   1980 } RIL_ApnTypes;
   1981 
   1982 typedef enum {
   1983     RIL_DST_POWER_SAVE_MODE,        // Device power save mode (provided by PowerManager)
   1984                                     // True indicates the device is in power save mode.
   1985     RIL_DST_CHARGING_STATE,         // Device charging state (provided by BatteryManager)
   1986                                     // True indicates the device is charging.
   1987     RIL_DST_LOW_DATA_EXPECTED       // Low data expected mode. True indicates low data traffic
   1988                                     // is expected, for example, when the device is idle
   1989                                     // (e.g. not doing tethering in the background). Note
   1990                                     // this doesn't mean no data is expected.
   1991 } RIL_DeviceStateType;
   1992 
   1993 typedef enum {
   1994     RIL_UR_SIGNAL_STRENGTH            = 0x01, // When this bit is set, modem should always send the
   1995                                               // signal strength update through
   1996                                               // RIL_UNSOL_SIGNAL_STRENGTH, otherwise suppress it.
   1997     RIL_UR_FULL_NETWORK_STATE         = 0x02, // When this bit is set, modem should always send
   1998                                               // RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
   1999                                               // when any field in
   2000                                               // RIL_REQUEST_VOICE_REGISTRATION_STATE or
   2001                                               // RIL_REQUEST_DATA_REGISTRATION_STATE changes. When
   2002                                               // this bit is not set, modem should suppress
   2003                                               // RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
   2004                                               // only when insignificant fields change
   2005                                               // (e.g. cell info).
   2006                                               // Modem should continue sending
   2007                                               // RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
   2008                                               // when significant fields are updated even when this
   2009                                               // bit is not set. The following fields are
   2010                                               // considered significant, registration state and
   2011                                               // radio technology.
   2012     RIL_UR_DATA_CALL_DORMANCY_CHANGED = 0x04  // When this bit is set, modem should send the data
   2013                                               // call list changed unsolicited response
   2014                                               // RIL_UNSOL_DATA_CALL_LIST_CHANGED whenever any
   2015                                               // field in RIL_Data_Call_Response changes.
   2016                                               // Otherwise modem should suppress the unsolicited
   2017                                               // response when the only changed field is 'active'
   2018                                               // (for data dormancy). For all other fields change,
   2019                                               // modem should continue sending
   2020                                               // RIL_UNSOL_DATA_CALL_LIST_CHANGED regardless this
   2021                                               // bit is set or not.
   2022 } RIL_UnsolicitedResponseFilter;
   2023 
   2024 typedef struct {
   2025     char * aidPtr; /* AID value, See ETSI 102.221 and 101.220*/
   2026     int p2;        /* P2 parameter (described in ISO 7816-4)
   2027                       P2Constants:NO_P2 if to be ignored */
   2028 } RIL_OpenChannelParams;
   2029 
   2030 /**
   2031  * RIL_REQUEST_GET_SIM_STATUS
   2032  *
   2033  * Requests status of the SIM interface and the SIM card
   2034  *
   2035  * "data" is NULL
   2036  *
   2037  * "response" is const RIL_CardStatus_v6 *
   2038  *
   2039  * Valid errors:
   2040  *  Must never fail
   2041  */
   2042 #define RIL_REQUEST_GET_SIM_STATUS 1
   2043 
   2044 /**
   2045  * RIL_REQUEST_ENTER_SIM_PIN
   2046  *
   2047  * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
   2048  *
   2049  * "data" is const char **
   2050  * ((const char **)data)[0] is PIN value
   2051  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
   2052  *
   2053  * "response" is int *
   2054  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
   2055  *
   2056  * Valid errors:
   2057  *
   2058  * SUCCESS
   2059  * RADIO_NOT_AVAILABLE (radio resetting)
   2060  * PASSWORD_INCORRECT
   2061  */
   2062 
   2063 #define RIL_REQUEST_ENTER_SIM_PIN 2
   2064 
   2065 /**
   2066  * RIL_REQUEST_ENTER_SIM_PUK
   2067  *
   2068  * Supplies SIM PUK and new PIN.
   2069  *
   2070  * "data" is const char **
   2071  * ((const char **)data)[0] is PUK value
   2072  * ((const char **)data)[1] is new PIN value
   2073  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
   2074  *
   2075  * "response" is int *
   2076  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
   2077  *
   2078  * Valid errors:
   2079  *
   2080  *  SUCCESS
   2081  *  RADIO_NOT_AVAILABLE (radio resetting)
   2082  *  PASSWORD_INCORRECT
   2083  *     (PUK is invalid)
   2084  */
   2085 
   2086 #define RIL_REQUEST_ENTER_SIM_PUK 3
   2087 
   2088 /**
   2089  * RIL_REQUEST_ENTER_SIM_PIN2
   2090  *
   2091  * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
   2092  * returned as a a failure from a previous operation.
   2093  *
   2094  * "data" is const char **
   2095  * ((const char **)data)[0] is PIN2 value
   2096  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
   2097  *
   2098  * "response" is int *
   2099  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
   2100  *
   2101  * Valid errors:
   2102  *
   2103  *  SUCCESS
   2104  *  RADIO_NOT_AVAILABLE (radio resetting)
   2105  *  PASSWORD_INCORRECT
   2106  */
   2107 
   2108 #define RIL_REQUEST_ENTER_SIM_PIN2 4
   2109 
   2110 /**
   2111  * RIL_REQUEST_ENTER_SIM_PUK2
   2112  *
   2113  * Supplies SIM PUK2 and new PIN2.
   2114  *
   2115  * "data" is const char **
   2116  * ((const char **)data)[0] is PUK2 value
   2117  * ((const char **)data)[1] is new PIN2 value
   2118  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
   2119  *
   2120  * "response" is int *
   2121  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
   2122  *
   2123  * Valid errors:
   2124  *
   2125  *  SUCCESS
   2126  *  RADIO_NOT_AVAILABLE (radio resetting)
   2127  *  PASSWORD_INCORRECT
   2128  *     (PUK2 is invalid)
   2129  */
   2130 
   2131 #define RIL_REQUEST_ENTER_SIM_PUK2 5
   2132 
   2133 /**
   2134  * RIL_REQUEST_CHANGE_SIM_PIN
   2135  *
   2136  * Supplies old SIM PIN and new PIN.
   2137  *
   2138  * "data" is const char **
   2139  * ((const char **)data)[0] is old PIN value
   2140  * ((const char **)data)[1] is new PIN value
   2141  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
   2142  *
   2143  * "response" is int *
   2144  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
   2145  *
   2146  * Valid errors:
   2147  *
   2148  *  SUCCESS
   2149  *  RADIO_NOT_AVAILABLE (radio resetting)
   2150  *  PASSWORD_INCORRECT
   2151  *     (old PIN is invalid)
   2152  *
   2153  */
   2154 
   2155 #define RIL_REQUEST_CHANGE_SIM_PIN 6
   2156 
   2157 
   2158 /**
   2159  * RIL_REQUEST_CHANGE_SIM_PIN2
   2160  *
   2161  * Supplies old SIM PIN2 and new PIN2.
   2162  *
   2163  * "data" is const char **
   2164  * ((const char **)data)[0] is old PIN2 value
   2165  * ((const char **)data)[1] is new PIN2 value
   2166  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
   2167  *
   2168  * "response" is int *
   2169  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
   2170  *
   2171  * Valid errors:
   2172  *
   2173  *  SUCCESS
   2174  *  RADIO_NOT_AVAILABLE (radio resetting)
   2175  *  PASSWORD_INCORRECT
   2176  *     (old PIN2 is invalid)
   2177  *
   2178  */
   2179 
   2180 #define RIL_REQUEST_CHANGE_SIM_PIN2 7
   2181 
   2182 /**
   2183  * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
   2184  *
   2185  * Requests that network personlization be deactivated
   2186  *
   2187  * "data" is const char **
   2188  * ((const char **)(data))[0]] is network depersonlization code
   2189  *
   2190  * "response" is int *
   2191  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
   2192  *
   2193  * Valid errors:
   2194  *
   2195  *  SUCCESS
   2196  *  RADIO_NOT_AVAILABLE (radio resetting)
   2197  *  PASSWORD_INCORRECT
   2198  *     (code is invalid)
   2199  */
   2200 
   2201 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
   2202 
   2203 /**
   2204  * RIL_REQUEST_GET_CURRENT_CALLS
   2205  *
   2206  * Requests current call list
   2207  *
   2208  * "data" is NULL
   2209  *
   2210  * "response" must be a "const RIL_Call **"
   2211  *
   2212  * Valid errors:
   2213  *
   2214  *  SUCCESS
   2215  *  RADIO_NOT_AVAILABLE (radio resetting)
   2216  *  NO_MEMORY
   2217  *      (request will be made again in a few hundred msec)
   2218  */
   2219 
   2220 #define RIL_REQUEST_GET_CURRENT_CALLS 9
   2221 
   2222 
   2223 /**
   2224  * RIL_REQUEST_DIAL
   2225  *
   2226  * Initiate voice call
   2227  *
   2228  * "data" is const RIL_Dial *
   2229  * "response" is NULL
   2230  *
   2231  * This method is never used for supplementary service codes
   2232  *
   2233  * Valid errors:
   2234  *  SUCCESS
   2235  *  RADIO_NOT_AVAILABLE (radio resetting)
   2236  *  DIAL_MODIFIED_TO_USSD
   2237  *  DIAL_MODIFIED_TO_SS
   2238  *  DIAL_MODIFIED_TO_DIAL
   2239  *  INVALID_ARGUMENTS
   2240  *  NO_MEMORY
   2241  *  INVALID_STATE
   2242  *  NO_RESOURCES
   2243  *  INTERNAL_ERR
   2244  *  FDN_CHECK_FAILURE
   2245  *  MODEM_ERR
   2246  *  NO_SUBSCRIPTION
   2247  *  NO_NETWORK_FOUND
   2248  *  INVALID_CALL_ID
   2249  *  DEVICE_IN_USE
   2250  *  MODE_NOT_SUPPORTED
   2251  *  ABORTED
   2252  */
   2253 #define RIL_REQUEST_DIAL 10
   2254 
   2255 /**
   2256  * RIL_REQUEST_GET_IMSI
   2257  *
   2258  * Get the SIM IMSI
   2259  *
   2260  * Only valid when radio state is "RADIO_STATE_ON"
   2261  *
   2262  * "data" is const char **
   2263  * ((const char **)data)[0] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
   2264  * "response" is a const char * containing the IMSI
   2265  *
   2266  * Valid errors:
   2267  *  SUCCESS
   2268  *  RADIO_NOT_AVAILABLE (radio resetting)
   2269  */
   2270 
   2271 #define RIL_REQUEST_GET_IMSI 11
   2272 
   2273 /**
   2274  * RIL_REQUEST_HANGUP
   2275  *
   2276  * Hang up a specific line (like AT+CHLD=1x)
   2277  *
   2278  * After this HANGUP request returns, RIL should show the connection is NOT
   2279  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
   2280  *
   2281  * "data" is an int *
   2282  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
   2283  *
   2284  * "response" is NULL
   2285  *
   2286  * Valid errors:
   2287  *  SUCCESS
   2288  *  RADIO_NOT_AVAILABLE (radio resetting)
   2289  *  INVALID_ARGUMENTS
   2290  *  NO_MEMORY
   2291  *  INVALID_STATE
   2292  *  MODEM_ERR
   2293  *  INTERNAL_ERR
   2294  *  NO_MEMORY
   2295  *  INVALID_CALL_ID
   2296  *  INVALID_ARGUMENTS
   2297  */
   2298 
   2299 #define RIL_REQUEST_HANGUP 12
   2300 
   2301 /**
   2302  * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
   2303  *
   2304  * Hang up waiting or held (like AT+CHLD=0)
   2305  *
   2306  * After this HANGUP request returns, RIL should show the connection is NOT
   2307  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
   2308  *
   2309  * "data" is NULL
   2310  * "response" is NULL
   2311  *
   2312  * Valid errors:
   2313  *  SUCCESS
   2314  *  RADIO_NOT_AVAILABLE (radio resetting)
   2315  *  INVALID_STATE
   2316  *  NO_MEMORY
   2317  *  MODEM_ERR
   2318  *  INTERNAL_ERR
   2319  *  NO_MEMORY
   2320  *  INVALID_CALL_ID
   2321  *  NO_RESOURCES
   2322  *  OPERATION_NOT_ALLOWED
   2323  *  INVALID_ARGUMENTS
   2324  */
   2325 
   2326 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
   2327 
   2328 /**
   2329  * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
   2330  *
   2331  * Hang up waiting or held (like AT+CHLD=1)
   2332  *
   2333  * After this HANGUP request returns, RIL should show the connection is NOT
   2334  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
   2335  *
   2336  * "data" is NULL
   2337  * "response" is NULL
   2338  *
   2339  * Valid errors:
   2340  *  SUCCESS
   2341  *  RADIO_NOT_AVAILABLE (radio resetting)
   2342  *  INVALID_STATE
   2343  *  NO_MEMORY
   2344  *  MODEM_ERR
   2345  *  INTERNAL_ERR
   2346  *  INVALID_CALL_ID
   2347  *  OPERATION_NOT_ALLOWED
   2348  *  INVALID_ARGUMENTS
   2349  *  NO_RESOURCES
   2350  */
   2351 
   2352 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
   2353 
   2354 /**
   2355  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
   2356  *
   2357  * Switch waiting or holding call and active call (like AT+CHLD=2)
   2358  *
   2359  * State transitions should be is follows:
   2360  *
   2361  * If call 1 is waiting and call 2 is active, then if this re
   2362  *
   2363  *   BEFORE                               AFTER
   2364  * Call 1   Call 2                 Call 1       Call 2
   2365  * ACTIVE   HOLDING                HOLDING     ACTIVE
   2366  * ACTIVE   WAITING                HOLDING     ACTIVE
   2367  * HOLDING  WAITING                HOLDING     ACTIVE
   2368  * ACTIVE   IDLE                   HOLDING     IDLE
   2369  * IDLE     IDLE                   IDLE        IDLE
   2370  *
   2371  * "data" is NULL
   2372  * "response" is NULL
   2373  *
   2374  * Valid errors:
   2375  *  SUCCESS
   2376  *  RADIO_NOT_AVAILABLE (radio resetting)
   2377  *  INVALID_STATE
   2378  *  NO_MEMORY
   2379  *  MODEM_ERR
   2380  *  INTERNAL_ERR
   2381  *  INVALID_STATE
   2382  *  INVALID_ARGUMENTS
   2383  *  INVALID_CALL_ID
   2384  *  OPERATION_NOT_ALLOWED
   2385  */
   2386 
   2387 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
   2388 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
   2389 
   2390 /**
   2391  * RIL_REQUEST_CONFERENCE
   2392  *
   2393  * Conference holding and active (like AT+CHLD=3)
   2394 
   2395  * "data" is NULL
   2396  * "response" is NULL
   2397  *
   2398  * Valid errors:
   2399  *  SUCCESS
   2400  *  RADIO_NOT_AVAILABLE (radio resetting)
   2401  *  NO_MEMORY
   2402  *  MODEM_ERR
   2403  *  INTERNAL_ERR
   2404  *  INVALID_STATE
   2405  *  INVALID_CALL_ID
   2406  *  INVALID_ARGUMENTS
   2407  *  OPERATION_NOT_ALLOWED
   2408  */
   2409 #define RIL_REQUEST_CONFERENCE 16
   2410 
   2411 /**
   2412  * RIL_REQUEST_UDUB
   2413  *
   2414  * Send UDUB (user determined used busy) to ringing or
   2415  * waiting call answer)(RIL_BasicRequest r);
   2416  *
   2417  * "data" is NULL
   2418  * "response" is NULL
   2419  *
   2420  * Valid errors:
   2421  *  SUCCESS
   2422  *  RADIO_NOT_AVAILABLE (radio resetting)
   2423  *  INVALID_STATE
   2424  *  NO_RESOURCES
   2425  *  NO_MEMORY
   2426  *  MODEM_ERR
   2427  *  INTERNAL_ERR
   2428  *  INVALID_CALL_ID
   2429  *  OPERATION_NOT_ALLOWED
   2430  *  INVALID_ARGUMENTS
   2431  */
   2432 #define RIL_REQUEST_UDUB 17
   2433 
   2434 /**
   2435  * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
   2436  *
   2437  * Requests the failure cause code for the most recently terminated call
   2438  *
   2439  * "data" is NULL
   2440  * "response" is a const RIL_LastCallFailCauseInfo *
   2441  * RIL_LastCallFailCauseInfo contains LastCallFailCause and vendor cause.
   2442  * The vendor cause code must be used for debugging purpose only.
   2443  * The implementation must return one of the values of LastCallFailCause
   2444  * as mentioned below.
   2445  *
   2446  * GSM failure reasons codes for the cause codes defined in TS 24.008 Annex H
   2447  * where possible.
   2448  * CDMA failure reasons codes for the possible call failure scenarios
   2449  * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
   2450  * Any of the following reason codes if the call is failed or dropped due to reason
   2451  * mentioned with in the braces.
   2452  *
   2453  *      CALL_FAIL_RADIO_OFF (Radio is OFF)
   2454  *      CALL_FAIL_OUT_OF_SERVICE (No cell coverage)
   2455  *      CALL_FAIL_NO_VALID_SIM (No valid SIM)
   2456  *      CALL_FAIL_RADIO_INTERNAL_ERROR (Modem hit unexpected error scenario)
   2457  *      CALL_FAIL_NETWORK_RESP_TIMEOUT (No response from network)
   2458  *      CALL_FAIL_NETWORK_REJECT (Explicit network reject)
   2459  *      CALL_FAIL_RADIO_ACCESS_FAILURE (RRC connection failure. Eg.RACH)
   2460  *      CALL_FAIL_RADIO_LINK_FAILURE (Radio Link Failure)
   2461  *      CALL_FAIL_RADIO_LINK_LOST (Radio link lost due to poor coverage)
   2462  *      CALL_FAIL_RADIO_UPLINK_FAILURE (Radio uplink failure)
   2463  *      CALL_FAIL_RADIO_SETUP_FAILURE (RRC connection setup failure)
   2464  *      CALL_FAIL_RADIO_RELEASE_NORMAL (RRC connection release, normal)
   2465  *      CALL_FAIL_RADIO_RELEASE_ABNORMAL (RRC connection release, abnormal)
   2466  *      CALL_FAIL_ACCESS_CLASS_BLOCKED (Access class barring)
   2467  *      CALL_FAIL_NETWORK_DETACH (Explicit network detach)
   2468  *
   2469  * OEM causes (CALL_FAIL_OEM_CAUSE_XX) must be used for debug purpose only
   2470  *
   2471  * If the implementation does not have access to the exact cause codes,
   2472  * then it should return one of the values listed in RIL_LastCallFailCause,
   2473  * as the UI layer needs to distinguish these cases for tone generation or
   2474  * error notification.
   2475  *
   2476  * Valid errors:
   2477  *  SUCCESS
   2478  *  RADIO_NOT_AVAILABLE
   2479  *  NO_MEMORY
   2480  *
   2481  * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
   2482  */
   2483 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
   2484 
   2485 /**
   2486  * RIL_REQUEST_SIGNAL_STRENGTH
   2487  *
   2488  * Requests current signal strength and associated information
   2489  *
   2490  * Must succeed if radio is on.
   2491  *
   2492  * "data" is NULL
   2493  *
   2494  * "response" is a const RIL_SignalStrength *
   2495  *
   2496  * Valid errors:
   2497  *  SUCCESS
   2498  *  RADIO_NOT_AVAILABLE
   2499  *  NO_MEMORY
   2500  *  INTERNAL_ERR
   2501  *  SYSTEM_ERR
   2502  *  MODEM_ERR
   2503  *  NOT_PROVISIONED
   2504  *  REQUEST_NOT_SUPPORTED
   2505  */
   2506 #define RIL_REQUEST_SIGNAL_STRENGTH 19
   2507 
   2508 /**
   2509  * RIL_REQUEST_VOICE_REGISTRATION_STATE
   2510  *
   2511  * Request current registration state
   2512  *
   2513  * "data" is NULL
   2514  * "response" is a const RIL_VoiceRegistrationStateResponse *
   2515  *
   2516  * Valid errors:
   2517  *  SUCCESS
   2518  *  RADIO_NOT_AVAILABLE
   2519  */
   2520 #define RIL_REQUEST_VOICE_REGISTRATION_STATE 20
   2521 
   2522 /**
   2523  * RIL_REQUEST_DATA_REGISTRATION_STATE
   2524  *
   2525  * Request current DATA registration state
   2526  *
   2527  * "data" is NULL
   2528  * "response" is a const RIL_DataRegistrationStateResponse *
   2529  *
   2530  * Valid errors:
   2531  *  SUCCESS
   2532  *  RADIO_NOT_AVAILABLE
   2533  *  NO_MEMORY
   2534  *  INTERNAL_ERR
   2535  *  SYSTEM_ERR
   2536  *  MODEM_ERR
   2537  *  NOT_PROVISIONED
   2538  *  REQUEST_NOT_SUPPORTED
   2539  */
   2540 #define RIL_REQUEST_DATA_REGISTRATION_STATE 21
   2541 
   2542 /**
   2543  * RIL_REQUEST_OPERATOR
   2544  *
   2545  * Request current operator ONS or EONS
   2546  *
   2547  * "data" is NULL
   2548  * "response" is a "const char **"
   2549  * ((const char **)response)[0] is long alpha ONS or EONS
   2550  *                                  or NULL if unregistered
   2551  *
   2552  * ((const char **)response)[1] is short alpha ONS or EONS
   2553  *                                  or NULL if unregistered
   2554  * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
   2555  *                                  or NULL if unregistered
   2556  *
   2557  * Valid errors:
   2558  *  SUCCESS
   2559  *  RADIO_NOT_AVAILABLE
   2560  *  NO_MEMORY
   2561  *  INTERNAL_ERR
   2562  *  SYSTEM_ERR
   2563  *  REQUEST_NOT_SUPPORTED
   2564  */
   2565 #define RIL_REQUEST_OPERATOR 22
   2566 
   2567 /**
   2568  * RIL_REQUEST_RADIO_POWER
   2569  *
   2570  * Toggle radio on and off (for "airplane" mode)
   2571  * If the radio is is turned off/on the radio modem subsystem
   2572  * is expected return to an initialized state. For instance,
   2573  * any voice and data calls will be terminated and all associated
   2574  * lists emptied.
   2575  *
   2576  * "data" is int *
   2577  * ((int *)data)[0] is > 0 for "Radio On"
   2578  * ((int *)data)[0] is == 0 for "Radio Off"
   2579  *
   2580  * "response" is NULL
   2581  *
   2582  * Turn radio on if "on" > 0
   2583  * Turn radio off if "on" == 0
   2584  *
   2585  * Valid errors:
   2586  *  SUCCESS
   2587  *  RADIO_NOT_AVAILABLE
   2588  *  OPERATION_NOT_ALLOWED
   2589  *  INVALID_STATE
   2590  *  NO_MEMORY
   2591  *  INTERNAL_ERR
   2592  *  SYSTEM_ERR
   2593  *  INVALID_ARGUMENTS
   2594  *  MODEM_ERR
   2595  *  DEVICE_IN_USE
   2596  *  OPERATION_NOT_ALLOWED
   2597  *  INVALID_MODEM_STATE
   2598  *  REQUEST_NOT_SUPPORTED
   2599  */
   2600 #define RIL_REQUEST_RADIO_POWER 23
   2601 
   2602 /**
   2603  * RIL_REQUEST_DTMF
   2604  *
   2605  * Send a DTMF tone
   2606  *
   2607  * If the implementation is currently playing a tone requested via
   2608  * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
   2609  * should be played instead
   2610  *
   2611  * "data" is a char * containing a single character with one of 12 values: 0-9,*,#
   2612  * "response" is NULL
   2613  *
   2614  * FIXME should this block/mute microphone?
   2615  * How does this interact with local DTMF feedback?
   2616  *
   2617  * Valid errors:
   2618  *  SUCCESS
   2619  *  RADIO_NOT_AVAILABLE
   2620  *  INVALID_ARGUMENTS
   2621  *  NO_RESOURCES
   2622  *  NO_MEMORY
   2623  *  MODEM_ERR
   2624  *  INTERNAL_ERR
   2625  *  INVALID_CALL_ID
   2626  *
   2627  * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
   2628  *
   2629  */
   2630 #define RIL_REQUEST_DTMF 24
   2631 
   2632 /**
   2633  * RIL_REQUEST_SEND_SMS
   2634  *
   2635  * Send an SMS message
   2636  *
   2637  * "data" is const char **
   2638  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
   2639  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
   2640  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
   2641  *      less the SMSC address
   2642  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
   2643  *
   2644  * "response" is a const RIL_SMS_Response *
   2645  *
   2646  * Based on the return error, caller decides to resend if sending sms
   2647  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
   2648  *
   2649  * Valid errors:
   2650  *  SUCCESS
   2651  *  RADIO_NOT_AVAILABLE
   2652  *  SMS_SEND_FAIL_RETRY
   2653  *  FDN_CHECK_FAILURE
   2654  *  NETWORK_REJECT
   2655  *  INVALID_STATE
   2656  *  INVALID_ARGUMENTS
   2657  *  NO_MEMORY
   2658  *  REQUEST_RATE_LIMITED
   2659  *  INVALID_SMS_FORMAT
   2660  *  SYSTEM_ERR
   2661  *  ENCODING_ERR
   2662  *  INVALID_SMSC_ADDRESS
   2663  *  MODEM_ERR
   2664  *  NETWORK_ERR
   2665  *  MODE_NOT_SUPPORTED
   2666  *
   2667  * FIXME how do we specify TP-Message-Reference if we need to resend?
   2668  */
   2669 #define RIL_REQUEST_SEND_SMS 25
   2670 
   2671 
   2672 /**
   2673  * RIL_REQUEST_SEND_SMS_EXPECT_MORE
   2674  *
   2675  * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
   2676  * except that more messages are expected to be sent soon. If possible,
   2677  * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
   2678  *
   2679  * "data" is const char **
   2680  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
   2681  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
   2682  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
   2683  *      less the SMSC address
   2684  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
   2685  *
   2686  * "response" is a const RIL_SMS_Response *
   2687  *
   2688  * Based on the return error, caller decides to resend if sending sms
   2689  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
   2690  *
   2691  * Valid errors:
   2692  *  SUCCESS
   2693  *  RADIO_NOT_AVAILABLE
   2694  *  SMS_SEND_FAIL_RETRY
   2695  *  NETWORK_REJECT
   2696  *  INVALID_STATE
   2697  *  INVALID_ARGUMENTS
   2698  *  NO_MEMORY
   2699  *  INVALID_SMS_FORMAT
   2700  *  SYSTEM_ERR
   2701  *  REQUEST_RATE_LIMITED
   2702  *  FDN_CHECK_FAILURE
   2703  *  MODEM_ERR
   2704  *  NETWORK_ERR
   2705  *  ENCODING_ERR
   2706  *  INVALID_SMSC_ADDRESS
   2707  *  MODE_NOT_SUPPORTED
   2708  *
   2709  */
   2710 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
   2711 
   2712 
   2713 /**
   2714  * RIL_REQUEST_SETUP_DATA_CALL
   2715  *
   2716  * Setup a packet data connection. If RIL_Data_Call_Response_v6.status
   2717  * return success it is added to the list of data calls and a
   2718  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is sent. The call remains in the
   2719  * list until RIL_REQUEST_DEACTIVATE_DATA_CALL is issued or the
   2720  * radio is powered off/on. This list is returned by RIL_REQUEST_DATA_CALL_LIST
   2721  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED.
   2722  *
   2723  * The RIL is expected to:
   2724  *  - Create one data call context.
   2725  *  - Create and configure a dedicated interface for the context
   2726  *  - The interface must be point to point.
   2727  *  - The interface is configured with one or more addresses and
   2728  *    is capable of sending and receiving packets. The prefix length
   2729  *    of the addresses must be /32 for IPv4 and /128 for IPv6.
   2730  *  - Must NOT change the linux routing table.
   2731  *  - Support up to RIL_REQUEST_DATA_REGISTRATION_STATE response[5]
   2732  *    number of simultaneous data call contexts.
   2733  *
   2734  * "data" is a const char **
   2735  * ((const char **)data)[0] Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2...
   2736  *                          for values above 2 this is RIL_RadioTechnology + 2.
   2737  * ((const char **)data)[1] is a RIL_DataProfile (support is optional)
   2738  * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will
   2739  *                          override the one in the profile. NULL indicates no APN overrride.
   2740  * ((const char **)data)[3] is the username for APN, or NULL
   2741  * ((const char **)data)[4] is the password for APN, or NULL
   2742  * ((const char **)data)[5] is the PAP / CHAP auth type. Values:
   2743  *                          0 => PAP and CHAP is never performed.
   2744  *                          1 => PAP may be performed; CHAP is never performed.
   2745  *                          2 => CHAP may be performed; PAP is never performed.
   2746  *                          3 => PAP / CHAP may be performed - baseband dependent.
   2747  * ((const char **)data)[6] is the non-roaming/home connection type to request. Must be one of the
   2748  *                          PDP_type values in TS 27.007 section 10.1.1.
   2749  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
   2750  * ((const char **)data)[7] is the roaming connection type to request. Must be one of the
   2751  *                          PDP_type values in TS 27.007 section 10.1.1.
   2752  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
   2753  * ((const char **)data)[8] is the bitmask of APN type in decimal string format. The
   2754  *                          bitmask will encapsulate the following values:
   2755  *                          ia,mms,agps,supl,hipri,fota,dun,ims,default.
   2756  * ((const char **)data)[9] is the bearer bitmask in decimal string format. Each bit is a
   2757  *                          RIL_RadioAccessFamily. "0" or NULL indicates all RATs.
   2758  * ((const char **)data)[10] is the boolean in string format indicating the APN setting was
   2759  *                           sent to the modem through RIL_REQUEST_SET_DATA_PROFILE earlier.
   2760  * ((const char **)data)[11] is the mtu size in bytes of the mobile interface to which
   2761  *                           the apn is connected.
   2762  * ((const char **)data)[12] is the MVNO type:
   2763  *                           possible values are "imsi", "gid", "spn".
   2764  * ((const char **)data)[13] is MVNO match data in string. Can be anything defined by the carrier.
   2765  *                           For example,
   2766  *                           SPN like: "A MOBILE", "BEN NL", etc...
   2767  *                           IMSI like: "302720x94", "2060188", etc...
   2768  *                           GID like: "4E", "33", etc...
   2769  * ((const char **)data)[14] is the boolean string indicating data roaming is allowed or not. "1"
   2770  *                           indicates data roaming is enabled by the user, "0" indicates disabled.
   2771  *
   2772  * "response" is a RIL_Data_Call_Response_v11
   2773  *
   2774  * FIXME may need way to configure QoS settings
   2775  *
   2776  * Valid errors:
   2777  *  SUCCESS should be returned on both success and failure of setup with
   2778  *  the RIL_Data_Call_Response_v6.status containing the actual status.
   2779  *  For all other errors the RIL_Data_Call_Resonse_v6 is ignored.
   2780  *
   2781  *  Other errors could include:
   2782  *    RADIO_NOT_AVAILABLE, OP_NOT_ALLOWED_BEFORE_REG_TO_NW,
   2783  *    OP_NOT_ALLOWED_DURING_VOICE_CALL and REQUEST_NOT_SUPPORTED,
   2784  *    INVALID_ARGUMENTS
   2785  *
   2786  * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL
   2787  */
   2788 #define RIL_REQUEST_SETUP_DATA_CALL 27
   2789 
   2790 
   2791 /**
   2792  * RIL_REQUEST_SIM_IO
   2793  *
   2794  * Request SIM I/O operation.
   2795  * This is similar to the TS 27.007 "restricted SIM" operation
   2796  * where it assumes all of the EF selection will be done by the
   2797  * callee.
   2798  *
   2799  * "data" is a const RIL_SIM_IO_v6 *
   2800  * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
   2801  * or may specify a PIN2 for operations that require a PIN2 (eg
   2802  * updating FDN records)
   2803  *
   2804  * "response" is a const RIL_SIM_IO_Response *
   2805  *
   2806  * Arguments and responses that are unused for certain
   2807  * values of "command" should be ignored or set to NULL
   2808  *
   2809  * Valid errors:
   2810  *  SUCCESS
   2811  *  RADIO_NOT_AVAILABLE
   2812  *  SIM_PIN2
   2813  *  SIM_PUK2
   2814  */
   2815 #define RIL_REQUEST_SIM_IO 28
   2816 
   2817 /**
   2818  * RIL_REQUEST_SEND_USSD
   2819  *
   2820  * Send a USSD message
   2821  *
   2822  * If a USSD session already exists, the message should be sent in the
   2823  * context of that session. Otherwise, a new session should be created.
   2824  *
   2825  * The network reply should be reported via RIL_UNSOL_ON_USSD
   2826  *
   2827  * Only one USSD session may exist at a time, and the session is assumed
   2828  * to exist until:
   2829  *   a) The android system invokes RIL_REQUEST_CANCEL_USSD
   2830  *   b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
   2831  *      of "0" (USSD-Notify/no further action) or "2" (session terminated)
   2832  *
   2833  * "data" is a const char * containing the USSD request in UTF-8 format
   2834  * "response" is NULL
   2835  *
   2836  * Valid errors:
   2837  *  SUCCESS
   2838  *  RADIO_NOT_AVAILABLE
   2839  *  FDN_CHECK_FAILURE
   2840  *  USSD_MODIFIED_TO_DIAL
   2841  *  USSD_MODIFIED_TO_SS
   2842  *  USSD_MODIFIED_TO_USSD
   2843  *  SIM_BUSY
   2844  *  OPERATION_NOT_ALLOWED
   2845  *  INVALID_ARGUMENTS
   2846  *  NO_MEMORY
   2847  *  MODEM_ERR
   2848  *  INTERNAL_ERR
   2849  *  ABORTED
   2850  *  SYSTEM_ERR
   2851  *  INVALID_STATE
   2852  *
   2853  * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
   2854  */
   2855 
   2856 #define RIL_REQUEST_SEND_USSD 29
   2857 
   2858 /**
   2859  * RIL_REQUEST_CANCEL_USSD
   2860  *
   2861  * Cancel the current USSD session if one exists
   2862  *
   2863  * "data" is null
   2864  * "response" is NULL
   2865  *
   2866  * Valid errors:
   2867  *  SUCCESS
   2868  *  RADIO_NOT_AVAILABLE
   2869  *  SIM_BUSY
   2870  *  OPERATION_NOT_ALLOWED
   2871  *  MODEM_ERR
   2872  *  INTERNAL_ERR
   2873  *  NO_MEMORY
   2874  *  INVALID_STATE
   2875  */
   2876 
   2877 #define RIL_REQUEST_CANCEL_USSD 30
   2878 
   2879 /**
   2880  * RIL_REQUEST_GET_CLIR
   2881  *
   2882  * Gets current CLIR status
   2883  * "data" is NULL
   2884  * "response" is int *
   2885  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
   2886  * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
   2887  *
   2888  * Valid errors:
   2889  *  SUCCESS
   2890  *  RADIO_NOT_AVAILABLE
   2891  *  SS_MODIFIED_TO_DIAL
   2892  *  SS_MODIFIED_TO_USSD
   2893  *  SS_MODIFIED_TO_SS
   2894  *  NO_MEMORY
   2895  *  MODEM_ERR
   2896  *  INTERNAL_ERR
   2897  *  FDN_CHECK_FAILURE
   2898  *  SYSTEM_ERR
   2899  */
   2900 #define RIL_REQUEST_GET_CLIR 31
   2901 
   2902 /**
   2903  * RIL_REQUEST_SET_CLIR
   2904  *
   2905  * "data" is int *
   2906  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
   2907  *
   2908  * "response" is NULL
   2909  *
   2910  * Valid errors:
   2911  *  SUCCESS
   2912  *  RADIO_NOT_AVAILABLE
   2913  *  SS_MODIFIED_TO_DIAL
   2914  *  SS_MODIFIED_TO_USSD
   2915  *  SS_MODIFIED_TO_SS
   2916  *  INVALID_ARGUMENTS
   2917  *  SYSTEM_ERR
   2918  */
   2919 #define RIL_REQUEST_SET_CLIR 32
   2920 
   2921 /**
   2922  * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
   2923  *
   2924  * "data" is const RIL_CallForwardInfo *
   2925  *
   2926  * "response" is const RIL_CallForwardInfo **
   2927  * "response" points to an array of RIL_CallForwardInfo *'s, one for
   2928  * each distinct registered phone number.
   2929  *
   2930  * For example, if data is forwarded to +18005551212 and voice is forwarded
   2931  * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
   2932  *
   2933  * If, however, both data and voice are forwarded to +18005551212, then
   2934  * a single RIL_CallForwardInfo can be returned with the service class
   2935  * set to "data + voice = 3")
   2936  *
   2937  * Valid errors:
   2938  *  SUCCESS
   2939  *  RADIO_NOT_AVAILABLE
   2940  *  SS_MODIFIED_TO_DIAL
   2941  *  SS_MODIFIED_TO_USSD
   2942  *  SS_MODIFIED_TO_SS
   2943  *  INVALID_ARGUMENTS
   2944  *  NO_MEMORY
   2945  *  SYSTEM_ERR
   2946  *  MODEM_ERR
   2947  *  INTERNAL_ERR
   2948  *  NO_MEMORY
   2949  *  FDN_CHECK_FAILURE
   2950  */
   2951 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
   2952 
   2953 
   2954 /**
   2955  * RIL_REQUEST_SET_CALL_FORWARD
   2956  *
   2957  * Configure call forward rule
   2958  *
   2959  * "data" is const RIL_CallForwardInfo *
   2960  * "response" is NULL
   2961  *
   2962  * Valid errors:
   2963  *  SUCCESS
   2964  *  RADIO_NOT_AVAILABLE
   2965  *  SS_MODIFIED_TO_DIAL
   2966  *  SS_MODIFIED_TO_USSD
   2967  *  SS_MODIFIED_TO_SS
   2968  *  INVALID_ARGUMENTS
   2969  *  NO_MEMORY
   2970  *  SYSTEM_ERR
   2971  *  MODEM_ERR
   2972  *  INTERNAL_ERR
   2973  *  INVALID_STATE
   2974  *  FDN_CHECK_FAILURE
   2975  */
   2976 #define RIL_REQUEST_SET_CALL_FORWARD 34
   2977 
   2978 
   2979 /**
   2980  * RIL_REQUEST_QUERY_CALL_WAITING
   2981  *
   2982  * Query current call waiting state
   2983  *
   2984  * "data" is const int *
   2985  * ((const int *)data)[0] is the TS 27.007 service class to query.
   2986  * "response" is a const int *
   2987  * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
   2988  *
   2989  * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
   2990  * must follow, with the TS 27.007 service class bit vector of services
   2991  * for which call waiting is enabled.
   2992  *
   2993  * For example, if ((const int *)response)[0]  is 1 and
   2994  * ((const int *)response)[1] is 3, then call waiting is enabled for data
   2995  * and voice and disabled for everything else
   2996  *
   2997  * Valid errors:
   2998  *  SUCCESS
   2999  *  RADIO_NOT_AVAILABLE
   3000  *  SS_MODIFIED_TO_DIAL
   3001  *  SS_MODIFIED_TO_USSD
   3002  *  SS_MODIFIED_TO_SS
   3003  *  NO_MEMORY
   3004  *  MODEM_ERR
   3005  *  INTERNAL_ERR
   3006  *  NO_MEMORY
   3007  *  FDN_CHECK_FAILURE
   3008  *  INVALID_ARGUMENTS
   3009  */
   3010 #define RIL_REQUEST_QUERY_CALL_WAITING 35
   3011 
   3012 
   3013 /**
   3014  * RIL_REQUEST_SET_CALL_WAITING
   3015  *
   3016  * Configure current call waiting state
   3017  *
   3018  * "data" is const int *
   3019  * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
   3020  * ((const int *)data)[1] is the TS 27.007 service class bit vector of
   3021  *                           services to modify
   3022  * "response" is NULL
   3023  *
   3024  * Valid errors:
   3025  *  SUCCESS
   3026  *  RADIO_NOT_AVAILABLE
   3027  *  SS_MODIFIED_TO_DIAL
   3028  *  SS_MODIFIED_TO_USSD
   3029  *  SS_MODIFIED_TO_SS
   3030  *  INVALID_ARGUMENTS
   3031  *  NO_MEMORY
   3032  *  MODEM_ERR
   3033  *  INTERNAL_ERR
   3034  *  INVALID_STATE
   3035  *  FDN_CHECK_FAILURE
   3036  */
   3037 #define RIL_REQUEST_SET_CALL_WAITING 36
   3038 
   3039 /**
   3040  * RIL_REQUEST_SMS_ACKNOWLEDGE
   3041  *
   3042  * Acknowledge successful or failed receipt of SMS previously indicated
   3043  * via RIL_UNSOL_RESPONSE_NEW_SMS
   3044  *
   3045  * "data" is int *
   3046  * ((int *)data)[0] is 1 on successful receipt
   3047  *                  (basically, AT+CNMA=1 from TS 27.005
   3048  *                  is 0 on failed receipt
   3049  *                  (basically, AT+CNMA=2 from TS 27.005)
   3050  * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined
   3051  *                  in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory
   3052  *                  capacity exceeded) and 0xFF (unspecified error) are
   3053  *                  reported.
   3054  *
   3055  * "response" is NULL
   3056  *
   3057  * FIXME would like request that specified RP-ACK/RP-ERROR PDU
   3058  *
   3059  * Valid errors:
   3060  *  SUCCESS
   3061  *  RADIO_NOT_AVAILABLE
   3062  */
   3063 #define RIL_REQUEST_SMS_ACKNOWLEDGE  37
   3064 
   3065 /**
   3066  * RIL_REQUEST_GET_IMEI - DEPRECATED
   3067  *
   3068  * Get the device IMEI, including check digit
   3069  *
   3070  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
   3071  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
   3072  *
   3073  * "data" is NULL
   3074  * "response" is a const char * containing the IMEI
   3075  *
   3076  * Valid errors:
   3077  *  SUCCESS
   3078  *  RADIO_NOT_AVAILABLE (radio resetting)
   3079  *  NO_MEMORY
   3080  *  INTERNAL_ERR
   3081  *  SYSTEM_ERR
   3082  *  MODEM_ERR
   3083  *  NOT_PROVISIONED
   3084  *  REQUEST_NOT_SUPPORTED
   3085  */
   3086 
   3087 #define RIL_REQUEST_GET_IMEI 38
   3088 
   3089 /**
   3090  * RIL_REQUEST_GET_IMEISV - DEPRECATED
   3091  *
   3092  * Get the device IMEISV, which should be two decimal digits
   3093  *
   3094  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
   3095  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
   3096  *
   3097  * "data" is NULL
   3098  * "response" is a const char * containing the IMEISV
   3099  *
   3100  * Valid errors:
   3101  *  SUCCESS
   3102  *  RADIO_NOT_AVAILABLE (radio resetting)
   3103  *  NO_MEMORY
   3104  *  INTERNAL_ERR
   3105  *  SYSTEM_ERR
   3106  *  MODEM_ERR
   3107  *  NOT_PROVISIONED
   3108  *  REQUEST_NOT_SUPPORTED
   3109  */
   3110 
   3111 #define RIL_REQUEST_GET_IMEISV 39
   3112 
   3113 
   3114 /**
   3115  * RIL_REQUEST_ANSWER
   3116  *
   3117  * Answer incoming call
   3118  *
   3119  * Will not be called for WAITING calls.
   3120  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
   3121  * instead
   3122  *
   3123  * "data" is NULL
   3124  * "response" is NULL
   3125  *
   3126  * Valid errors:
   3127  *  SUCCESS
   3128  *  RADIO_NOT_AVAILABLE (radio resetting)
   3129  *  INVALID_STATE
   3130  *  NO_MEMORY
   3131  *  SYSTEM_ERR
   3132  *  MODEM_ERR
   3133  *  INTERNAL_ERR
   3134  *  INVALID_CALL_ID
   3135  */
   3136 
   3137 #define RIL_REQUEST_ANSWER 40
   3138 
   3139 /**
   3140  * RIL_REQUEST_DEACTIVATE_DATA_CALL
   3141  *
   3142  * Deactivate packet data connection and remove from the
   3143  * data call list if SUCCESS is returned. Any other return
   3144  * values should also try to remove the call from the list,
   3145  * but that may not be possible. In any event a
   3146  * RIL_REQUEST_RADIO_POWER off/on must clear the list. An
   3147  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is not expected to be
   3148  * issued because of an RIL_REQUEST_DEACTIVATE_DATA_CALL.
   3149  *
   3150  * "data" is const char **
   3151  * ((char**)data)[0] indicating CID
   3152  * ((char**)data)[1] indicating Disconnect Reason
   3153  *                   0 => No specific reason specified
   3154  *                   1 => Radio shutdown requested
   3155  *
   3156  * "response" is NULL
   3157  *
   3158  * Valid errors:
   3159  *  SUCCESS
   3160  *  RADIO_NOT_AVAILABLE
   3161  *  INVALID_CALL_ID
   3162  *  INVALID_STATE
   3163  *  INVALID_ARGUMENTS
   3164  *  REQUEST_NOT_SUPPORTED
   3165  *
   3166  * See also: RIL_REQUEST_SETUP_DATA_CALL
   3167  */
   3168 #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41
   3169 
   3170 /**
   3171  * RIL_REQUEST_QUERY_FACILITY_LOCK
   3172  *
   3173  * Query the status of a facility lock state
   3174  *
   3175  * "data" is const char **
   3176  * ((const char **)data)[0] is the facility string code from TS 27.007 7.4
   3177  *                      (eg "AO" for BAOC, "SC" for SIM lock)
   3178  * ((const char **)data)[1] is the password, or "" if not required
   3179  * ((const char **)data)[2] is the TS 27.007 service class bit vector of
   3180  *                           services to query
   3181  * ((const char **)data)[3] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
   3182  *                            This is only applicable in the case of Fixed Dialing Numbers
   3183  *                            (FDN) requests.
   3184  *
   3185  * "response" is an int *
   3186  * ((const int *)response) 0 is the TS 27.007 service class bit vector of
   3187  *                           services for which the specified barring facility
   3188  *                           is active. "0" means "disabled for all"
   3189  *
   3190  *
   3191  * Valid errors:
   3192  *  SUCCESS
   3193  *  RADIO_NOT_AVAILABLE
   3194  *  SS_MODIFIED_TO_DIAL
   3195  *  SS_MODIFIED_TO_USSD
   3196  *  SS_MODIFIED_TO_SS
   3197  *  INVALID_ARGUMENTS
   3198  *  NO_MEMORY
   3199  *  INTERNAL_ERR
   3200  *  SYSTEM_ERR
   3201  *  MODEM_ERR
   3202  *  FDN_CHECK_FAILURE
   3203  *
   3204  */
   3205 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
   3206 
   3207 /**
   3208  * RIL_REQUEST_SET_FACILITY_LOCK
   3209  *
   3210  * Enable/disable one facility lock
   3211  *
   3212  * "data" is const char **
   3213  *
   3214  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
   3215  * (eg "AO" for BAOC)
   3216  * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
   3217  * ((const char **)data)[2] = password
   3218  * ((const char **)data)[3] = string representation of decimal TS 27.007
   3219  *                            service class bit vector. Eg, the string
   3220  *                            "1" means "set this facility for voice services"
   3221  * ((const char **)data)[4] = AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
   3222  *                            This is only applicable in the case of Fixed Dialing Numbers
   3223  *                            (FDN) requests.
   3224  *
   3225  * "response" is int *
   3226  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
   3227  *
   3228  * Valid errors:
   3229  *  SUCCESS
   3230  *  RADIO_NOT_AVAILABLE
   3231  *  SS_MODIFIED_TO_DIAL
   3232  *  SS_MODIFIED_TO_USSD
   3233  *  SS_MODIFIED_TO_SS
   3234  *  INVALID_ARGUMENTS
   3235  *  INTERNAL_ERR
   3236  *  NO_MEMORY
   3237  *  MODEM_ERR
   3238  *  INVALID_STATE
   3239  *  FDN_CHECK_FAILURE
   3240  *
   3241  */
   3242 #define RIL_REQUEST_SET_FACILITY_LOCK 43
   3243 
   3244 /**
   3245  * RIL_REQUEST_CHANGE_BARRING_PASSWORD
   3246  *
   3247  * Change call barring facility password
   3248  *
   3249  * "data" is const char **
   3250  *
   3251  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
   3252  * (eg "AO" for BAOC)
   3253  * ((const char **)data)[1] = old password
   3254  * ((const char **)data)[2] = new password
   3255  *
   3256  * "response" is NULL
   3257  *
   3258  * Valid errors:
   3259  *  SUCCESS
   3260  *  RADIO_NOT_AVAILABLE
   3261  *  SS_MODIFIED_TO_DIAL
   3262  *  SS_MODIFIED_TO_USSD
   3263  *  SS_MODIFIED_TO_SS
   3264  *  INVALID_ARGUMENTS
   3265  *  NO_MEMORY
   3266  *  MODEM_ERR
   3267  *  INTERNAL_ERR
   3268  *  SYSTEM_ERR
   3269  *  FDN_CHECK_FAILURE
   3270  *
   3271  */
   3272 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
   3273 
   3274 /**
   3275  * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
   3276  *
   3277  * Query current network selectin mode
   3278  *
   3279  * "data" is NULL
   3280  *
   3281  * "response" is int *
   3282  * ((const int *)response)[0] is
   3283  *     0 for automatic selection
   3284  *     1 for manual selection
   3285  *
   3286  * Valid errors:
   3287  *  SUCCESS
   3288  *  RADIO_NOT_AVAILABLE
   3289  *  NO_MEMORY
   3290  *  INTERNAL_ERR
   3291  *  SYSTEM_ERR
   3292  *  INVALID_ARGUMENTS
   3293  *  MODEM_ERR
   3294  *  REQUEST_NOT_SUPPORTED
   3295  *
   3296  */
   3297 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
   3298 
   3299 /**
   3300  * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
   3301  *
   3302  * Specify that the network should be selected automatically
   3303  *
   3304  * "data" is NULL
   3305  * "response" is NULL
   3306  *
   3307  * This request must not respond until the new operator is selected
   3308  * and registered
   3309  *
   3310  * Valid errors:
   3311  *  SUCCESS
   3312  *  RADIO_NOT_AVAILABLE
   3313  *  ILLEGAL_SIM_OR_ME
   3314  *  OPERATION_NOT_ALLOWED
   3315  *  NO_MEMORY
   3316  *  INTERNAL_ERR
   3317  *  SYSTEM_ERR
   3318  *  INVALID_ARGUMENTS
   3319  *  MODEM_ERR
   3320  *  REQUEST_NOT_SUPPORTED
   3321  *
   3322  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
   3323  *       no retries needed, such as illegal SIM or ME.
   3324  *
   3325  */
   3326 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
   3327 
   3328 /**
   3329  * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
   3330  *
   3331  * Manually select a specified network.
   3332  *
   3333  * "data" is const char * specifying MCCMNC of network to select (eg "310170")
   3334  * "response" is NULL
   3335  *
   3336  * This request must not respond until the new operator is selected
   3337  * and registered
   3338  *
   3339  * Valid errors:
   3340  *  SUCCESS
   3341  *  RADIO_NOT_AVAILABLE
   3342  *  ILLEGAL_SIM_OR_ME
   3343  *  OPERATION_NOT_ALLOWED
   3344  *  INVALID_STATE
   3345  *  NO_MEMORY
   3346  *  INTERNAL_ERR
   3347  *  SYSTEM_ERR
   3348  *  INVALID_ARGUMENTS
   3349  *  MODEM_ERR
   3350  *  REQUEST_NOT_SUPPORTED
   3351  *
   3352  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
   3353  *       no retries needed, such as illegal SIM or ME.
   3354  *
   3355  */
   3356 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
   3357 
   3358 /**
   3359  * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
   3360  *
   3361  * Scans for available networks
   3362  *
   3363  * "data" is NULL
   3364  * "response" is const char ** that should be an array of n*4 strings, where
   3365  *    n is the number of available networks
   3366  * For each available network:
   3367  *
   3368  * ((const char **)response)[n+0] is long alpha ONS or EONS
   3369  * ((const char **)response)[n+1] is short alpha ONS or EONS
   3370  * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
   3371  * ((const char **)response)[n+3] is a string value of the status:
   3372  *           "unknown"
   3373  *           "available"
   3374  *           "current"
   3375  *           "forbidden"
   3376  *
   3377  * Valid errors:
   3378  *  SUCCESS
   3379  *  RADIO_NOT_AVAILABLE
   3380  *  OPERATION_NOT_ALLOWED
   3381  *  ABORTED
   3382  *  DEVICE_IN_USE
   3383  *  INTERNAL_ERR
   3384  *  NO_MEMORY
   3385  *  MODEM_ERR
   3386  *  REQUEST_NOT_SUPPORTED
   3387  *  CANCELLED
   3388  *  OPERATION_NOT_ALLOWED
   3389  *
   3390  */
   3391 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
   3392 
   3393 /**
   3394  * RIL_REQUEST_DTMF_START
   3395  *
   3396  * Start playing a DTMF tone. Continue playing DTMF tone until
   3397  * RIL_REQUEST_DTMF_STOP is received
   3398  *
   3399  * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
   3400  * it should cancel the previous tone and play the new one.
   3401  *
   3402  * "data" is a char *
   3403  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
   3404  * "response" is NULL
   3405  *
   3406  * Valid errors:
   3407  *  SUCCESS
   3408  *  RADIO_NOT_AVAILABLE
   3409  *  INVALID_ARGUMENTS
   3410  *  NO_RESOURCES
   3411  *  NO_MEMORY
   3412  *  SYSTEM_ERR
   3413  *  MODEM_ERR
   3414  *  INTERNAL_ERR
   3415  *  INVALID_CALL_ID
   3416  *
   3417  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
   3418  */
   3419 #define RIL_REQUEST_DTMF_START 49
   3420 
   3421 /**
   3422  * RIL_REQUEST_DTMF_STOP
   3423  *
   3424  * Stop playing a currently playing DTMF tone.
   3425  *
   3426  * "data" is NULL
   3427  * "response" is NULL
   3428  *
   3429  * Valid errors:
   3430  *  SUCCESS
   3431  *  RADIO_NOT_AVAILABLE
   3432  *  OPERATION_NOT_ALLOWED
   3433  *  NO_RESOURCES
   3434  *  NO_MEMORY
   3435  *  INVALID_ARGUMENTS
   3436  *  SYSTEM_ERR
   3437  *  MODEM_ERR
   3438  *  INTERNAL_ERR
   3439  *  INVALID_CALL_ID
   3440  *
   3441  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
   3442  */
   3443 #define RIL_REQUEST_DTMF_STOP 50
   3444 
   3445 /**
   3446  * RIL_REQUEST_BASEBAND_VERSION
   3447  *
   3448  * Return string value indicating baseband version, eg
   3449  * response from AT+CGMR
   3450  *
   3451  * "data" is NULL
   3452  * "response" is const char * containing version string for log reporting
   3453  *
   3454  * Valid errors:
   3455  *  SUCCESS
   3456  *  RADIO_NOT_AVAILABLE
   3457  *  EMPTY_RECORD
   3458  *  NO_MEMORY
   3459  *  INTERNAL_ERR
   3460  *  SYSTEM_ERR
   3461  *  MODEM_ERR
   3462  *  NOT_PROVISIONED
   3463  *  REQUEST_NOT_SUPPORTED
   3464  *
   3465  */
   3466 #define RIL_REQUEST_BASEBAND_VERSION 51
   3467 
   3468 /**
   3469  * RIL_REQUEST_SEPARATE_CONNECTION
   3470  *
   3471  * Separate a party from a multiparty call placing the multiparty call
   3472  * (less the specified party) on hold and leaving the specified party
   3473  * as the only other member of the current (active) call
   3474  *
   3475  * Like AT+CHLD=2x
   3476  *
   3477  * See TS 22.084 1.3.8.2 (iii)
   3478  * TS 22.030 6.5.5 "Entering "2X followed by send"
   3479  * TS 27.007 "AT+CHLD=2x"
   3480  *
   3481  * "data" is an int *
   3482  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL
   3483  *
   3484  * "response" is NULL
   3485  *
   3486  * Valid errors:
   3487  *  SUCCESS
   3488  *  RADIO_NOT_AVAILABLE (radio resetting)
   3489  *  INVALID_ARGUMENTS
   3490  *  INVALID_STATE
   3491  *  NO_RESOURCES
   3492  *  NO_MEMORY
   3493  *  SYSTEM_ERR
   3494  *  MODEM_ERR
   3495  *  INTERNAL_ERR
   3496  *  INVALID_CALL_ID
   3497  *  INVALID_STATE
   3498  *  OPERATION_NOT_ALLOWED
   3499  */
   3500 #define RIL_REQUEST_SEPARATE_CONNECTION 52
   3501 
   3502 
   3503 /**
   3504  * RIL_REQUEST_SET_MUTE
   3505  *
   3506  * Turn on or off uplink (microphone) mute.
   3507  *
   3508  * Will only be sent while voice call is active.
   3509  * Will always be reset to "disable mute" when a new voice call is initiated
   3510  *
   3511  * "data" is an int *
   3512  * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
   3513  *
   3514  * "response" is NULL
   3515  *
   3516  * Valid errors:
   3517  *  SUCCESS
   3518  *  RADIO_NOT_AVAILABLE (radio resetting)
   3519  *  INVALID_ARGUMENTS
   3520  *  NO_MEMORY
   3521  *  REQUEST_RATE_LIMITED
   3522  */
   3523 
   3524 #define RIL_REQUEST_SET_MUTE 53
   3525 
   3526 /**
   3527  * RIL_REQUEST_GET_MUTE
   3528  *
   3529  * Queries the current state of the uplink mute setting
   3530  *
   3531  * "data" is NULL
   3532  * "response" is an int *
   3533  * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
   3534  *
   3535  * Valid errors:
   3536  *  SUCCESS
   3537  *  RADIO_NOT_AVAILABLE (radio resetting)
   3538  *  SS_MODIFIED_TO_DIAL
   3539  *  SS_MODIFIED_TO_USSD
   3540  *  SS_MODIFIED_TO_SS
   3541  *  NO_MEMORY
   3542  *  REQUEST_RATE_LIMITED
   3543  */
   3544 
   3545 #define RIL_REQUEST_GET_MUTE 54
   3546 
   3547 /**
   3548  * RIL_REQUEST_QUERY_CLIP
   3549  *
   3550  * Queries the status of the CLIP supplementary service
   3551  *
   3552  * (for MMI code "*#30#")
   3553  *
   3554  * "data" is NULL
   3555  * "response" is an int *
   3556  * (int *)response)[0] is 1 for "CLIP provisioned"
   3557  *                           and 0 for "CLIP not provisioned"
   3558  *                           and 2 for "unknown, e.g. no network etc"
   3559  *
   3560  * Valid errors:
   3561  *  SUCCESS
   3562  *  RADIO_NOT_AVAILABLE (radio resetting)
   3563  *  NO_MEMORY
   3564  *  SYSTEM_ERR
   3565  *  MODEM_ERR
   3566  *  INTERNAL_ERR
   3567  *  FDN_CHECK_FAILURE
   3568  */
   3569 
   3570 #define RIL_REQUEST_QUERY_CLIP 55
   3571 
   3572 /**
   3573  * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE - Deprecated use the status
   3574  * field in RIL_Data_Call_Response_v6.
   3575  *
   3576  * Requests the failure cause code for the most recently failed PDP
   3577  * context or CDMA data connection active
   3578  * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE
   3579  *
   3580  * "data" is NULL
   3581  *
   3582  * "response" is a "int *"
   3583  * ((int *)response)[0] is an integer cause code defined in TS 24.008
   3584  *   section 6.1.3.1.3 or close approximation
   3585  *
   3586  * If the implementation does not have access to the exact cause codes,
   3587  * then it should return one of the values listed in
   3588  * RIL_DataCallFailCause, as the UI layer needs to distinguish these
   3589  * cases for error notification
   3590  * and potential retries.
   3591  *
   3592  * Valid errors:
   3593  *  SUCCESS
   3594  *  RADIO_NOT_AVAILABLE
   3595  *
   3596  * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
   3597  *
   3598  * Deprecated use the status field in RIL_Data_Call_Response_v6.
   3599  */
   3600 
   3601 #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56
   3602 
   3603 /**
   3604  * RIL_REQUEST_DATA_CALL_LIST
   3605  *
   3606  * Returns the data call list. An entry is added when a
   3607  * RIL_REQUEST_SETUP_DATA_CALL is issued and removed on a
   3608  * RIL_REQUEST_DEACTIVATE_DATA_CALL. The list is emptied
   3609  * when RIL_REQUEST_RADIO_POWER off/on is issued.
   3610  *
   3611  * "data" is NULL
   3612  * "response" is an array of RIL_Data_Call_Response_v6
   3613  *
   3614  * Valid errors:
   3615  *  SUCCESS
   3616  *  RADIO_NOT_AVAILABLE (radio resetting)
   3617  *
   3618  * See also: RIL_UNSOL_DATA_CALL_LIST_CHANGED
   3619  */
   3620 
   3621 #define RIL_REQUEST_DATA_CALL_LIST 57
   3622 
   3623 /**
   3624  * RIL_REQUEST_RESET_RADIO - DEPRECATED
   3625  *
   3626  * Request a radio reset. The RIL implementation may postpone
   3627  * the reset until after this request is responded to if the baseband
   3628  * is presently busy.
   3629  *
   3630  * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER
   3631  *
   3632  * "data" is NULL
   3633  * "response" is NULL
   3634  *
   3635  * Valid errors:
   3636  *  SUCCESS
   3637  *  RADIO_NOT_AVAILABLE (radio resetting)
   3638  *  REQUEST_NOT_SUPPORTED
   3639  */
   3640 
   3641 #define RIL_REQUEST_RESET_RADIO 58
   3642 
   3643 /**
   3644  * RIL_REQUEST_OEM_HOOK_RAW
   3645  *
   3646  * This request reserved for OEM-specific uses. It passes raw byte arrays
   3647  * back and forth.
   3648  *
   3649  * It can be invoked on the Java side from
   3650  * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
   3651  *
   3652  * "data" is a char * of bytes copied from the byte[] data argument in java
   3653  * "response" is a char * of bytes that will returned via the
   3654  * caller's "response" Message here:
   3655  * (byte[])(((AsyncResult)response.obj).result)
   3656  *
   3657  * An error response here will result in
   3658  * (((AsyncResult)response.obj).result) == null and
   3659  * (((AsyncResult)response.obj).exception) being an instance of
   3660  * com.android.internal.telephony.gsm.CommandException
   3661  *
   3662  * Valid errors:
   3663  *  All
   3664  */
   3665 
   3666 #define RIL_REQUEST_OEM_HOOK_RAW 59
   3667 
   3668 /**
   3669  * RIL_REQUEST_OEM_HOOK_STRINGS
   3670  *
   3671  * This request reserved for OEM-specific uses. It passes strings
   3672  * back and forth.
   3673  *
   3674  * It can be invoked on the Java side from
   3675  * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
   3676  *
   3677  * "data" is a const char **, representing an array of null-terminated UTF-8
   3678  * strings copied from the "String[] strings" argument to
   3679  * invokeOemRilRequestStrings()
   3680  *
   3681  * "response" is a const char **, representing an array of null-terminated UTF-8
   3682  * stings that will be returned via the caller's response message here:
   3683  *
   3684  * (String[])(((AsyncResult)response.obj).result)
   3685  *
   3686  * An error response here will result in
   3687  * (((AsyncResult)response.obj).result) == null and
   3688  * (((AsyncResult)response.obj).exception) being an instance of
   3689  * com.android.internal.telephony.gsm.CommandException
   3690  *
   3691  * Valid errors:
   3692  *  All
   3693  */
   3694 
   3695 #define RIL_REQUEST_OEM_HOOK_STRINGS 60
   3696 
   3697 /**
   3698  * RIL_REQUEST_SCREEN_STATE - DEPRECATED
   3699  *
   3700  * Indicates the current state of the screen.  When the screen is off, the
   3701  * RIL should notify the baseband to suppress certain notifications (eg,
   3702  * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
   3703  * in an effort to conserve power.  These notifications should resume when the
   3704  * screen is on.
   3705  *
   3706  * Note this request is deprecated. Use RIL_REQUEST_SEND_DEVICE_STATE to report the device state
   3707  * to the modem and use RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER to turn on/off unsolicited
   3708  * response from the modem in different scenarios.
   3709  *
   3710  * "data" is int *
   3711  * ((int *)data)[0] is == 1 for "Screen On"
   3712  * ((int *)data)[0] is == 0 for "Screen Off"
   3713  *
   3714  * "response" is NULL
   3715  *
   3716  * Valid errors:
   3717  *  SUCCESS
   3718  *  NO_MEMORY
   3719  *  INTERNAL_ERR
   3720  *  SYSTEM_ERR
   3721  *  INVALID_ARGUMENTS
   3722  *  REQUEST_NOT_SUPPORTED
   3723  */
   3724 #define RIL_REQUEST_SCREEN_STATE 61
   3725 
   3726 
   3727 /**
   3728  * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
   3729  *
   3730  * Enables/disables supplementary service related notifications
   3731  * from the network.
   3732  *
   3733  * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
   3734  *
   3735  * "data" is int *
   3736  * ((int *)data)[0] is == 1 for notifications enabled
   3737  * ((int *)data)[0] is == 0 for notifications disabled
   3738  *
   3739  * "response" is NULL
   3740  *
   3741  * Valid errors:
   3742  *  SUCCESS
   3743  *  RADIO_NOT_AVAILABLE
   3744  *  SIM_BUSY
   3745  *  INVALID_ARGUMENTS
   3746  *  NO_MEMORY
   3747  *  SYSTEM_ERR
   3748  *  MODEM_ERR
   3749  *  INTERNAL_ERR
   3750  *
   3751  * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
   3752  */
   3753 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
   3754 
   3755 /**
   3756  * RIL_REQUEST_WRITE_SMS_TO_SIM
   3757  *
   3758  * Stores a SMS message to SIM memory.
   3759  *
   3760  * "data" is RIL_SMS_WriteArgs *
   3761  *
   3762  * "response" is int *
   3763  * ((const int *)response)[0] is the record index where the message is stored.
   3764  *
   3765  * Valid errors:
   3766  *  SUCCESS
   3767  *  SIM_FULL
   3768  *  INVALID_ARGUMENTS
   3769  *  INVALID_SMS_FORMAT
   3770  *  INTERNAL_ERR
   3771  *  MODEM_ERR
   3772  *  ENCODING_ERR
   3773  *  NO_MEMORY
   3774  *  NO_RESOURCES
   3775  *  INVALID_MODEM_STATE
   3776  *  MODE_NOT_SUPPORTED
   3777  *  INVALID_SMSC_ADDRESS
   3778  *
   3779  */
   3780 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
   3781 
   3782 /**
   3783  * RIL_REQUEST_DELETE_SMS_ON_SIM
   3784  *
   3785  * Deletes a SMS message from SIM memory.
   3786  *
   3787  * "data" is int  *
   3788  * ((int *)data)[0] is the record index of the message to delete.
   3789  *
   3790  * "response" is NULL
   3791  *
   3792  * Valid errors:
   3793  *  SUCCESS
   3794  *  SIM_FULL
   3795  *  INVALID_ARGUMENTS
   3796  *  NO_MEMORY
   3797  *  REQUEST_RATE_LIMITED
   3798  *  SYSTEM_ERR
   3799  *  MODEM_ERR
   3800  *  NO_SUCH_ENTRY
   3801  *
   3802  */
   3803 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
   3804 
   3805 /**
   3806  * RIL_REQUEST_SET_BAND_MODE
   3807  *
   3808  * Assign a specified band for RF configuration.
   3809  *
   3810  * "data" is int *
   3811  * ((int *)data)[0] is a RIL_RadioBandMode
   3812  *
   3813  * "response" is NULL
   3814  *
   3815  * Valid errors:
   3816  *  SUCCESS
   3817  *  RADIO_NOT_AVAILABLE
   3818  *  OPERATION_NOT_ALLOWED
   3819  *  NO_MEMORY
   3820  *  INTERNAL_ERR
   3821  *  SYSTEM_ERR
   3822  *  INVALID_ARGUMENTS
   3823  *  MODEM_ERR
   3824  *  REQUEST_NOT_SUPPORTED
   3825  *
   3826  * See also: RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
   3827  */
   3828 #define RIL_REQUEST_SET_BAND_MODE 65
   3829 
   3830 /**
   3831  * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
   3832  *
   3833  * Query the list of band mode supported by RF.
   3834  *
   3835  * "data" is NULL
   3836  *
   3837  * "response" is int *
   3838  * "response" points to an array of int's, the int[0] is the size of array;
   3839  * subsequent values are a list of RIL_RadioBandMode listing supported modes.
   3840  *
   3841  * Valid errors:
   3842  *  SUCCESS
   3843  *  RADIO_NOT_AVAILABLE
   3844  *  NO_MEMORY
   3845  *  INTERNAL_ERR
   3846  *  SYSTEM_ERR
   3847  *  MODEM_ERR
   3848  *  REQUEST_NOT_SUPPORTED
   3849  *
   3850  * See also: RIL_REQUEST_SET_BAND_MODE
   3851  */
   3852 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
   3853 
   3854 /**
   3855  * RIL_REQUEST_STK_GET_PROFILE
   3856  *
   3857  * Requests the profile of SIM tool kit.
   3858  * The profile indicates the SAT/USAT features supported by ME.
   3859  * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
   3860  *
   3861  * "data" is NULL
   3862  *
   3863  * "response" is a const char * containing SAT/USAT profile
   3864  * in hexadecimal format string starting with first byte of terminal profile
   3865  *
   3866  * Valid errors:
   3867  *  RIL_E_SUCCESS
   3868  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   3869  */
   3870 #define RIL_REQUEST_STK_GET_PROFILE 67
   3871 
   3872 /**
   3873  * RIL_REQUEST_STK_SET_PROFILE
   3874  *
   3875  * Download the STK terminal profile as part of SIM initialization
   3876  * procedure
   3877  *
   3878  * "data" is a const char * containing SAT/USAT profile
   3879  * in hexadecimal format string starting with first byte of terminal profile
   3880  *
   3881  * "response" is NULL
   3882  *
   3883  * Valid errors:
   3884  *  RIL_E_SUCCESS
   3885  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   3886  */
   3887 #define RIL_REQUEST_STK_SET_PROFILE 68
   3888 
   3889 /**
   3890  * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
   3891  *
   3892  * Requests to send a SAT/USAT envelope command to SIM.
   3893  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
   3894  *
   3895  * "data" is a const char * containing SAT/USAT command
   3896  * in hexadecimal format string starting with command tag
   3897  *
   3898  * "response" is a const char * containing SAT/USAT response
   3899  * in hexadecimal format string starting with first byte of response
   3900  * (May be NULL)
   3901  *
   3902  * Valid errors:
   3903  *  RIL_E_SUCCESS
   3904  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   3905  *  SIM_BUSY
   3906  *  OPERATION_NOT_ALLOWED
   3907  */
   3908 #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
   3909 
   3910 /**
   3911  * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
   3912  *
   3913  * Requests to send a terminal response to SIM for a received
   3914  * proactive command
   3915  *
   3916  * "data" is a const char * containing SAT/USAT response
   3917  * in hexadecimal format string starting with first byte of response data
   3918  *
   3919  * "response" is NULL
   3920  *
   3921  * Valid errors:
   3922  *  RIL_E_SUCCESS
   3923  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   3924  *  RIL_E_OPERATION_NOT_ALLOWED
   3925  */
   3926 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
   3927 
   3928 /**
   3929  * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
   3930  *
   3931  * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
   3932  * been initialized by ME already. (We could see the call has been in the 'call
   3933  * list') So, STK application needs to accept/reject the call according as user
   3934  * operations.
   3935  *
   3936  * "data" is int *
   3937  * ((int *)data)[0] is > 0 for "accept" the call setup
   3938  * ((int *)data)[0] is == 0 for "reject" the call setup
   3939  *
   3940  * "response" is NULL
   3941  *
   3942  * Valid errors:
   3943  *  RIL_E_SUCCESS
   3944  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   3945  *  RIL_E_OPERATION_NOT_ALLOWED
   3946  */
   3947 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
   3948 
   3949 /**
   3950  * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
   3951  *
   3952  * Connects the two calls and disconnects the subscriber from both calls.
   3953  *
   3954  * "data" is NULL
   3955  * "response" is NULL
   3956  *
   3957  * Valid errors:
   3958  *  SUCCESS
   3959  *  RADIO_NOT_AVAILABLE (radio resetting)
   3960  *  INVALID_STATE
   3961  *  NO_RESOURCES
   3962  *  NO_MEMORY
   3963  *  INVALID_ARGUMENTS
   3964  *  SYSTEM_ERR
   3965  *  MODEM_ERR
   3966  *  INTERNAL_ERR
   3967  *  INVALID_CALL_ID
   3968  *  INVALID_STATE
   3969  *  OPERATION_NOT_ALLOWED
   3970  */
   3971 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
   3972 
   3973 /**
   3974  * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
   3975  *
   3976  * Requests to set the preferred network type for searching and registering
   3977  * (CS/PS domain, RAT, and operation mode)
   3978  *
   3979  * "data" is int * which is RIL_PreferredNetworkType
   3980  *
   3981  * "response" is NULL
   3982  *
   3983  * Valid errors:
   3984  *  SUCCESS
   3985  *  RADIO_NOT_AVAILABLE (radio resetting)
   3986  *  OPERATION_NOT_ALLOWED
   3987  *  MODE_NOT_SUPPORTED
   3988  *  NO_MEMORY
   3989  *  INTERNAL_ERR
   3990  *  SYSTEM_ERR
   3991  *  INVALID_ARGUMENTS
   3992  *  MODEM_ERR
   3993  *  REQUEST_NOT_SUPPORTED
   3994  */
   3995 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
   3996 
   3997 /**
   3998  * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
   3999  *
   4000  * Query the preferred network type (CS/PS domain, RAT, and operation mode)
   4001  * for searching and registering
   4002  *
   4003  * "data" is NULL
   4004  *
   4005  * "response" is int *
   4006  * ((int *)reponse)[0] is == RIL_PreferredNetworkType
   4007  *
   4008  * Valid errors:
   4009  *  SUCCESS
   4010  *  RADIO_NOT_AVAILABLE
   4011  *  NO_MEMORY
   4012  *  INTERNAL_ERR
   4013  *  SYSTEM_ERR
   4014  *  INVALID_ARGUMENTS
   4015  *  MODEM_ERR
   4016  *  REQUEST_NOT_SUPPORTED
   4017  *
   4018  * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
   4019  */
   4020 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
   4021 
   4022 /**
   4023  * RIL_REQUEST_NEIGHBORING_CELL_IDS
   4024  *
   4025  * Request neighboring cell id in GSM network
   4026  *
   4027  * "data" is NULL
   4028  * "response" must be a " const RIL_NeighboringCell** "
   4029  *
   4030  * Valid errors:
   4031  *  SUCCESS
   4032  *  RADIO_NOT_AVAILABLE
   4033  *  NO_MEMORY
   4034  *  INTERNAL_ERR
   4035  *  SYSTEM_ERR
   4036  *  MODEM_ERR
   4037  *  NO_NETWORK_FOUND
   4038  *  REQUEST_NOT_SUPPORTED
   4039  */
   4040 #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
   4041 
   4042 /**
   4043  * RIL_REQUEST_SET_LOCATION_UPDATES
   4044  *
   4045  * Enables/disables network state change notifications due to changes in
   4046  * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
   4047  * Basically +CREG=2 vs. +CREG=1 (TS 27.007).
   4048  *
   4049  * Note:  The RIL implementation should default to "updates enabled"
   4050  * when the screen is on and "updates disabled" when the screen is off.
   4051  *
   4052  * "data" is int *
   4053  * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
   4054  * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
   4055  *
   4056  * "response" is NULL
   4057  *
   4058  * Valid errors:
   4059  *  SUCCESS
   4060  *  RADIO_NOT_AVAILABLE
   4061  *  NO_MEMORY
   4062  *  INTERNAL_ERR
   4063  *  SYSTEM_ERR
   4064  *  INVALID_ARGUMENTS
   4065  *  MODEM_ERR
   4066  *  REQUEST_NOT_SUPPORTED
   4067  *
   4068  * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
   4069  */
   4070 #define RIL_REQUEST_SET_LOCATION_UPDATES 76
   4071 
   4072 /**
   4073  * RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
   4074  *
   4075  * Request to set the location where the CDMA subscription shall
   4076  * be retrieved
   4077  *
   4078  * "data" is int *
   4079  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
   4080  *
   4081  * "response" is NULL
   4082  *
   4083  * Valid errors:
   4084  *  SUCCESS
   4085  *  RADIO_NOT_AVAILABLE
   4086  *  SIM_ABSENT
   4087  *  SUBSCRIPTION_NOT_AVAILABLE
   4088  *
   4089  * See also: RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
   4090  */
   4091 #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 77
   4092 
   4093 /**
   4094  * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE
   4095  *
   4096  * Request to set the roaming preferences in CDMA
   4097  *
   4098  * "data" is int *
   4099  * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL
   4100  * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
   4101  * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL
   4102  *
   4103  * "response" is NULL
   4104  *
   4105  * Valid errors:
   4106  *  SUCCESS
   4107  *  RADIO_NOT_AVAILABLE
   4108  *  NO_MEMORY
   4109  *  INTERNAL_ERR
   4110  *  SYSTEM_ERR
   4111  *  INVALID_ARGUMENTS
   4112  *  MODEM_ERR
   4113  *  REQUEST_NOT_SUPPORTED
   4114  *  OPERATION_NOT_ALLOWED
   4115  */
   4116 #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78
   4117 
   4118 /**
   4119  * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE
   4120  *
   4121  * Request the actual setting of the roaming preferences in CDMA in the modem
   4122  *
   4123  * "data" is NULL
   4124  *
   4125  * "response" is int *
   4126  * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL
   4127  * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
   4128  * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL
   4129  *
   4130  * "response" is NULL
   4131  *
   4132  * Valid errors:
   4133  *  SUCCESS
   4134  *  RADIO_NOT_AVAILABLE
   4135  *  NO_MEMORY
   4136  *  INTERNAL_ERR
   4137  *  SYSTEM_ERR
   4138  *  INVALID_ARGUMENTS
   4139  *  MODEM_ERR
   4140  *  REQUEST_NOT_SUPPORTED
   4141  */
   4142 #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79
   4143 
   4144 /**
   4145  * RIL_REQUEST_SET_TTY_MODE
   4146  *
   4147  * Request to set the TTY mode
   4148  *
   4149  * "data" is int *
   4150  * ((int *)data)[0] is == 0 for TTY off
   4151  * ((int *)data)[0] is == 1 for TTY Full
   4152  * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover)
   4153  * ((int *)data)[0] is == 3 for TTY VCO (voice carryover)
   4154  *
   4155  * "response" is NULL
   4156  *
   4157  * Valid errors:
   4158  *  SUCCESS
   4159  *  RADIO_NOT_AVAILABLE
   4160  *  INVALID_ARGUMENTS
   4161  *  MODEM_ERR
   4162  *  INTERNAL_ERR
   4163  *  NO_MEMOR
   4164  *  INVALID_ARGUMENTS
   4165  *  MODEM_ERR
   4166  *  INTERNAL_ERR
   4167  *  NO_MEMORYY
   4168  */
   4169 #define RIL_REQUEST_SET_TTY_MODE 80
   4170 
   4171 /**
   4172  * RIL_REQUEST_QUERY_TTY_MODE
   4173  *
   4174  * Request the setting of TTY mode
   4175  *
   4176  * "data" is NULL
   4177  *
   4178  * "response" is int *
   4179  * ((int *)response)[0] is == 0 for TTY off
   4180  * ((int *)response)[0] is == 1 for TTY Full
   4181  * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover)
   4182  * ((int *)response)[0] is == 3 for TTY VCO (voice carryover)
   4183  *
   4184  * "response" is NULL
   4185  *
   4186  * Valid errors:
   4187  *  SUCCESS
   4188  *  RADIO_NOT_AVAILABLE
   4189  *  MODEM_ERR
   4190  *  INTERNAL_ERR
   4191  *  NO_MEMORY
   4192  *  INVALID_ARGUMENTS
   4193  */
   4194 #define RIL_REQUEST_QUERY_TTY_MODE 81
   4195 
   4196 /**
   4197  * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE
   4198  *
   4199  * Request to set the preferred voice privacy mode used in voice
   4200  * scrambling
   4201  *
   4202  * "data" is int *
   4203  * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
   4204  * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
   4205  *
   4206  * "response" is NULL
   4207  *
   4208  * Valid errors:
   4209  *  SUCCESS
   4210  *  RADIO_NOT_AVAILABLE
   4211  *  INVALID_ARGUMENTS
   4212  *  SYSTEM_ERR
   4213  *  MODEM_ERR
   4214  *  INTERNAL_ERR
   4215  *  NO_MEMORY
   4216  *  INVALID_CALL_ID
   4217  */
   4218 #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82
   4219 
   4220 /**
   4221  * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE
   4222  *
   4223  * Request the setting of preferred voice privacy mode
   4224  *
   4225  * "data" is NULL
   4226  *
   4227  * "response" is int *
   4228  * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
   4229  * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
   4230  *
   4231  * "response" is NULL
   4232  *
   4233  * Valid errors:
   4234  *  SUCCESS
   4235  *  RADIO_NOT_AVAILABLE
   4236  *  MODEM_ERR
   4237  *  INTERNAL_ERR
   4238  *  NO_MEMORY
   4239  *  INVALID_ARGUMENTS
   4240  */
   4241 #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83
   4242 
   4243 /**
   4244  * RIL_REQUEST_CDMA_FLASH
   4245  *
   4246  * Send FLASH
   4247  *
   4248  * "data" is const char *
   4249  * ((const char *)data)[0] is a FLASH string
   4250  *
   4251  * "response" is NULL
   4252  *
   4253  * Valid errors:
   4254  *  SUCCESS
   4255  *  RADIO_NOT_AVAILABLE
   4256  *  INVALID_ARGUMENTS
   4257  *  NO_MEMORY
   4258  *  SYSTEM_ERR
   4259  *  MODEM_ERR
   4260  *  INTERNAL_ERR
   4261  *  INVALID_CALL_ID
   4262  *  INVALID_STATE
   4263  *
   4264  */
   4265 #define RIL_REQUEST_CDMA_FLASH 84
   4266 
   4267 /**
   4268  * RIL_REQUEST_CDMA_BURST_DTMF
   4269  *
   4270  * Send DTMF string
   4271  *
   4272  * "data" is const char **
   4273  * ((const char **)data)[0] is a DTMF string
   4274  * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use
   4275  *                          default
   4276  * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use
   4277  *                          default
   4278  *
   4279  * "response" is NULL
   4280  *
   4281  * Valid errors:
   4282  *  SUCCESS
   4283  *  RADIO_NOT_AVAILABLE
   4284  *  INVALID_ARGUMENTS
   4285  *  NO_MEMORY
   4286  *  SYSTEM_ERR
   4287  *  MODEM_ERR
   4288  *  INTERNAL_ERR
   4289  *  INVALID_CALL_ID
   4290  *
   4291  */
   4292 #define RIL_REQUEST_CDMA_BURST_DTMF 85
   4293 
   4294 /**
   4295  * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY
   4296  *
   4297  * Takes a 26 digit string (20 digit AKEY + 6 digit checksum).
   4298  * If the checksum is valid the 20 digit AKEY is written to NV,
   4299  * replacing the existing AKEY no matter what it was before.
   4300  *
   4301  * "data" is const char *
   4302  * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9')
   4303  *                         where the last 6 digits are a checksum of the
   4304  *                         first 20, as specified in TR45.AHAG
   4305  *                         "Common Cryptographic Algorithms, Revision D.1
   4306  *                         Section 2.2"
   4307  *
   4308  * "response" is NULL
   4309  *
   4310  * Valid errors:
   4311  *  SUCCESS
   4312  *  RADIO_NOT_AVAILABLE
   4313  *  NO_MEMORY
   4314  *  INTERNAL_ERR
   4315  *  SYSTEM_ERR
   4316  *  INVALID_ARGUMENTS
   4317  *  MODEM_ERR
   4318  *  REQUEST_NOT_SUPPORTED
   4319  *
   4320  */
   4321 #define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86
   4322 
   4323 /**
   4324  * RIL_REQUEST_CDMA_SEND_SMS
   4325  *
   4326  * Send a CDMA SMS message
   4327  *
   4328  * "data" is const RIL_CDMA_SMS_Message *
   4329  *
   4330  * "response" is a const RIL_SMS_Response *
   4331  *
   4332  * Based on the return error, caller decides to resend if sending sms
   4333  * fails. The CDMA error class is derived as follows,
   4334  * SUCCESS is error class 0 (no error)
   4335  * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure)
   4336  *
   4337  * Valid errors:
   4338  *  SUCCESS
   4339  *  RADIO_NOT_AVAILABLE
   4340  *  SMS_SEND_FAIL_RETRY
   4341  *  NETWORK_REJECT
   4342  *  INVALID_STATE
   4343  *  INVALID_ARGUMENTS
   4344  *  NO_MEMORY
   4345  *  REQUEST_RATE_LIMITED
   4346  *  INVALID_SMS_FORMAT
   4347  *  SYSTEM_ERR
   4348  *  FDN_CHECK_FAILURE
   4349  *  MODEM_ERR
   4350  *  NETWORK_ERR
   4351  *  ENCODING_ERR
   4352  *  INVALID_SMSC_ADDRESS
   4353  *  MODE_NOT_SUPPORTED
   4354  *
   4355  */
   4356 #define RIL_REQUEST_CDMA_SEND_SMS 87
   4357 
   4358 /**
   4359  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
   4360  *
   4361  * Acknowledge the success or failure in the receipt of SMS
   4362  * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
   4363  *
   4364  * "data" is const RIL_CDMA_SMS_Ack *
   4365  *
   4366  * "response" is NULL
   4367  *
   4368  * Valid errors:
   4369  *  SUCCESS
   4370  *  RADIO_NOT_AVAILABLE
   4371  *  INVALID_ARGUMENTS
   4372  *  NO_SMS_TO_ACK
   4373  *  INVALID_STATE
   4374  *  NO_MEMORY
   4375  *  REQUEST_RATE_LIMITED
   4376  *  SYSTEM_ERR
   4377  *  MODEM_ERR
   4378  *  INVALID_STATE
   4379  *  MODE_NOT_SUPPORTED
   4380  *  NETWORK_NOT_READY
   4381  *  INVALID_MODEM_STATE
   4382  *
   4383  */
   4384 #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88
   4385 
   4386 /**
   4387  * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG
   4388  *
   4389  * Request the setting of GSM/WCDMA Cell Broadcast SMS config.
   4390  *
   4391  * "data" is NULL
   4392  *
   4393  * "response" is a const RIL_GSM_BroadcastSmsConfigInfo **
   4394  * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *)
   4395  *
   4396  * Valid errors:
   4397  *  SUCCESS
   4398  *  RADIO_NOT_AVAILABLE
   4399  *  INVALID_STATE
   4400  *  NO_MEMORY
   4401  *  REQUEST_RATE_LIMITED
   4402  *  SYSTEM_ERR
   4403  *  NO_RESOURCES
   4404  *  MODEM_ERR
   4405  *  SYSTEM_ERR
   4406  *
   4407  */
   4408 #define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89
   4409 
   4410 /**
   4411  * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG
   4412  *
   4413  * Set GSM/WCDMA Cell Broadcast SMS config
   4414  *
   4415  * "data" is a const RIL_GSM_BroadcastSmsConfigInfo **
   4416  * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *)
   4417  *
   4418  * "response" is NULL
   4419  *
   4420  * Valid errors:
   4421  *  SUCCESS
   4422  *  RADIO_NOT_AVAILABLE
   4423  *  INVALID_STATE
   4424  *  INVALID_ARGUMENTS
   4425  *  NO_MEMORY
   4426  *  SYSTEM_ERR
   4427  *  REQUEST_RATE_LIMITED
   4428  *  MODEM_ERR
   4429  *  SYSTEM_ERR
   4430  *
   4431  */
   4432 #define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90
   4433 
   4434 /**
   4435  * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION
   4436  *
   4437 * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
   4438  *
   4439  * "data" is const int *
   4440  * (const int *)data[0] indicates to activate or turn off the
   4441  * reception of GSM/WCDMA Cell Broadcast SMS, 0-1,
   4442  *                       0 - Activate, 1 - Turn off
   4443  *
   4444  * "response" is NULL
   4445  *
   4446  * Valid errors:
   4447  *  SUCCESS
   4448  *  RADIO_NOT_AVAILABLE
   4449  *  INVALID_STATE
   4450  *  INVALID_ARGUMENTS
   4451  *  NO_MEMORY
   4452  *  SYSTEM_ERR
   4453  *  REQUEST_RATE_LIMITED
   4454  *  MODEM_ERR
   4455  *
   4456  */
   4457 #define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91
   4458 
   4459 /**
   4460  * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG
   4461  *
   4462  * Request the setting of CDMA Broadcast SMS config
   4463  *
   4464  * "data" is NULL
   4465  *
   4466  * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo **
   4467  * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *)
   4468  *
   4469  * Valid errors:
   4470  *  SUCCESS
   4471  *  RADIO_NOT_AVAILABLE
   4472  *  INVALID_STATE
   4473  *  NO_MEMORY
   4474  *  REQUEST_RATE_LIMITED
   4475  *  SYSTEM_ERR
   4476  *  NO_RESOURCES
   4477  *  MODEM_ERR
   4478  *  SYSTEM_ERR
   4479  *
   4480  */
   4481 #define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92
   4482 
   4483 /**
   4484  * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG
   4485  *
   4486  * Set CDMA Broadcast SMS config
   4487  *
   4488  * "data" is a const RIL_CDMA_BroadcastSmsConfigInfo **
   4489  * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *)
   4490  *
   4491  * "response" is NULL
   4492  *
   4493  * Valid errors:
   4494  *  SUCCESS
   4495  *  RADIO_NOT_AVAILABLE
   4496  *  INVALID_STATE
   4497  *  INVALID_ARGUMENTS
   4498  *  NO_MEMORY
   4499  *  SYSTEM_ERR
   4500  *  REQUEST_RATE_LIMITED
   4501  *  MODEM_ERR
   4502  *  SYSTEM_ERR
   4503  *
   4504  */
   4505 #define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93
   4506 
   4507 /**
   4508  * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION
   4509  *
   4510  * Enable or disable the reception of CDMA Broadcast SMS
   4511  *
   4512  * "data" is const int *
   4513  * (const int *)data[0] indicates to activate or turn off the
   4514  * reception of CDMA Broadcast SMS, 0-1,
   4515  *                       0 - Activate, 1 - Turn off
   4516  *
   4517  * "response" is NULL
   4518  *
   4519  * Valid errors:
   4520  *  SUCCESS
   4521  *  RADIO_NOT_AVAILABLE
   4522  *  INVALID_STATE
   4523  *  INVALID_ARGUMENTS
   4524  *  NO_MEMORY
   4525  *  SYSTEM_ERR
   4526  *  REQUEST_RATE_LIMITED
   4527  *  MODEM_ERR
   4528  *
   4529  */
   4530 #define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94
   4531 
   4532 /**
   4533  * RIL_REQUEST_CDMA_SUBSCRIPTION
   4534  *
   4535  * Request the device MDN / H_SID / H_NID.
   4536  *
   4537  * The request is only allowed when CDMA subscription is available.  When CDMA
   4538  * subscription is changed, application layer should re-issue the request to
   4539  * update the subscription information.
   4540  *
   4541  * If a NULL value is returned for any of the device id, it means that error
   4542  * accessing the device.
   4543  *
   4544  * "response" is const char **
   4545  * ((const char **)response)[0] is MDN if CDMA subscription is available
   4546  * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if
   4547  *                              CDMA subscription is available, in decimal format
   4548  * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if
   4549  *                              CDMA subscription is available, in decimal format
   4550  * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
   4551  * ((const char **)response)[4] is PRL version if CDMA subscription is available
   4552  *
   4553  * Valid errors:
   4554  *  SUCCESS
   4555  *  RIL_E_SUBSCRIPTION_NOT_AVAILABLE
   4556  *  NO_MEMORY
   4557  *  INTERNAL_ERR
   4558  *  SYSTEM_ERR
   4559  *  INVALID_ARGUMENTS
   4560  *  MODEM_ERR
   4561  *  NOT_PROVISIONED
   4562  *  REQUEST_NOT_SUPPORTED
   4563  *
   4564  */
   4565 
   4566 #define RIL_REQUEST_CDMA_SUBSCRIPTION 95
   4567 
   4568 /**
   4569  * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
   4570  *
   4571  * Stores a CDMA SMS message to RUIM memory.
   4572  *
   4573  * "data" is RIL_CDMA_SMS_WriteArgs *
   4574  *
   4575  * "response" is int *
   4576  * ((const int *)response)[0] is the record index where the message is stored.
   4577  *
   4578  * Valid errors:
   4579  *  SUCCESS
   4580  *  RADIO_NOT_AVAILABLE
   4581  *  SIM_FULL
   4582  *  INVALID_ARGUMENTS
   4583  *  INVALID_SMS_FORMAT
   4584  *  INTERNAL_ERR
   4585  *  MODEM_ERR
   4586  *  ENCODING_ERR
   4587  *  NO_MEMORY
   4588  *  NO_RESOURCES
   4589  *  INVALID_MODEM_STATE
   4590  *  MODE_NOT_SUPPORTED
   4591  *  INVALID_SMSC_ADDRESS
   4592  *
   4593  */
   4594 #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96
   4595 
   4596 /**
   4597  * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
   4598  *
   4599  * Deletes a CDMA SMS message from RUIM memory.
   4600  *
   4601  * "data" is int  *
   4602  * ((int *)data)[0] is the record index of the message to delete.
   4603  *
   4604  * "response" is NULL
   4605  *
   4606  * Valid errors:
   4607  *  SUCCESS
   4608  *  RADIO_NOT_AVAILABLE
   4609  *  INVALID_ARGUMENTS
   4610  *  NO_MEMORY
   4611  *  REQUEST_RATE_LIMITED
   4612  *  SYSTEM_ERR
   4613  *  MODEM_ERR
   4614  *  NO_SUCH_ENTRY
   4615  *
   4616  */
   4617 #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97
   4618 
   4619 /**
   4620  * RIL_REQUEST_DEVICE_IDENTITY
   4621  *
   4622  * Request the device ESN / MEID / IMEI / IMEISV.
   4623  *
   4624  * The request is always allowed and contains GSM and CDMA device identity;
   4625  * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and
   4626  * RIL_REQUEST_GET_IMEISV.
   4627  *
   4628  * If a NULL value is returned for any of the device id, it means that error
   4629  * accessing the device.
   4630  *
   4631  * When CDMA subscription is changed the ESN/MEID may change.  The application
   4632  * layer should re-issue the request to update the device identity in this case.
   4633  *
   4634  * "response" is const char **
   4635  * ((const char **)response)[0] is IMEI if GSM subscription is available
   4636  * ((const char **)response)[1] is IMEISV if GSM subscription is available
   4637  * ((const char **)response)[2] is ESN if CDMA subscription is available
   4638  * ((const char **)response)[3] is MEID if CDMA subscription is available
   4639  *
   4640  * Valid errors:
   4641  *  SUCCESS
   4642  *  RADIO_NOT_AVAILABLE
   4643  *  NO_MEMORY
   4644  *  INTERNAL_ERR
   4645  *  SYSTEM_ERR
   4646  *  INVALID_ARGUMENTS
   4647  *  MODEM_ERR
   4648  *  NOT_PROVISIONED
   4649  *  REQUEST_NOT_SUPPORTED
   4650  *
   4651  */
   4652 #define RIL_REQUEST_DEVICE_IDENTITY 98
   4653 
   4654 /**
   4655  * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE
   4656  *
   4657  * Request the radio's system selection module to exit emergency
   4658  * callback mode.  RIL will not respond with SUCCESS until the modem has
   4659  * completely exited from Emergency Callback Mode.
   4660  *
   4661  * "data" is NULL
   4662  *
   4663  * "response" is NULL
   4664  *
   4665  * Valid errors:
   4666  *  SUCCESS
   4667  *  RADIO_NOT_AVAILABLE
   4668  *  OPERATION_NOT_ALLOWED
   4669  *  NO_MEMORY
   4670  *  INTERNAL_ERR
   4671  *  SYSTEM_ERR
   4672  *  INVALID_ARGUMENTS
   4673  *  MODEM_ERR
   4674  *  REQUEST_NOT_SUPPORTED
   4675  *
   4676  */
   4677 #define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99
   4678 
   4679 /**
   4680  * RIL_REQUEST_GET_SMSC_ADDRESS
   4681  *
   4682  * Queries the default Short Message Service Center address on the device.
   4683  *
   4684  * "data" is NULL
   4685  *
   4686  * "response" is const char * containing the SMSC address.
   4687  *
   4688  * Valid errors:
   4689  *  SUCCESS
   4690  *  RADIO_NOT_AVAILABLE
   4691  *  NO_MEMORY
   4692  *  REQUEST_RATE_LIMITED
   4693  *  SYSTEM_ERR
   4694  *  INTERNAL_ERR
   4695  *  MODEM_ERR
   4696  *  INVALID_ARGUMENTS
   4697  *  INVALID_MODEM_STATE
   4698  *  NOT_PROVISIONED
   4699  *
   4700  */
   4701 #define RIL_REQUEST_GET_SMSC_ADDRESS 100
   4702 
   4703 /**
   4704  * RIL_REQUEST_SET_SMSC_ADDRESS
   4705  *
   4706  * Sets the default Short Message Service Center address on the device.
   4707  *
   4708  * "data" is const char * containing the SMSC address.
   4709  *
   4710  * "response" is NULL
   4711  *
   4712  * Valid errors:
   4713  *  SUCCESS
   4714  *  RADIO_NOT_AVAILABLE
   4715  *  INVALID_ARGUMENTS
   4716  *  INVALID_SMS_FORMAT
   4717  *  NO_MEMORY
   4718  *  SYSTEM_ERR
   4719  *  REQUEST_RATE_LIMITED
   4720  *  MODEM_ERR
   4721  *  NO_RESOURCES
   4722  *
   4723  */
   4724 #define RIL_REQUEST_SET_SMSC_ADDRESS 101
   4725 
   4726 /**
   4727  * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS
   4728  *
   4729  * Indicates whether there is storage available for new SMS messages.
   4730  *
   4731  * "data" is int *
   4732  * ((int *)data)[0] is 1 if memory is available for storing new messages
   4733  *                  is 0 if memory capacity is exceeded
   4734  *
   4735  * "response" is NULL
   4736  *
   4737  * Valid errors:
   4738  *  SUCCESS
   4739  *  RADIO_NOT_AVAILABLE
   4740  *  INVALID_ARGUMENTS
   4741  *  NO_MEMORY
   4742  *  INVALID_STATE
   4743  *  SYSTEM_ERR
   4744  *  REQUEST_RATE_LIMITED
   4745  *  MODEM_ERR
   4746  *
   4747  */
   4748 #define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102
   4749 
   4750 /**
   4751  * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING
   4752  *
   4753  * Indicates that the StkSerivce is running and is
   4754  * ready to receive RIL_UNSOL_STK_XXXXX commands.
   4755  *
   4756  * "data" is NULL
   4757  * "response" is NULL
   4758  *
   4759  * Valid errors:
   4760  *  SUCCESS
   4761  *  RADIO_NOT_AVAILABLE
   4762  *
   4763  */
   4764 #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103
   4765 
   4766 /**
   4767  * RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
   4768  *
   4769  * Request to query the location where the CDMA subscription shall
   4770  * be retrieved
   4771  *
   4772  * "data" is NULL
   4773  *
   4774  * "response" is int *
   4775  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
   4776  *
   4777  * Valid errors:
   4778  *  SUCCESS
   4779  *  RADIO_NOT_AVAILABLE
   4780  *  SUBSCRIPTION_NOT_AVAILABLE
   4781  *
   4782  * See also: RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
   4783  */
   4784 #define RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 104
   4785 
   4786 /**
   4787  * RIL_REQUEST_ISIM_AUTHENTICATION
   4788  *
   4789  * Request the ISIM application on the UICC to perform AKA
   4790  * challenge/response algorithm for IMS authentication
   4791  *
   4792  * "data" is a const char * containing the challenge string in Base64 format
   4793  * "response" is a const char * containing the response in Base64 format
   4794  *
   4795  * Valid errors:
   4796  *  SUCCESS
   4797  *  RADIO_NOT_AVAILABLE
   4798  */
   4799 #define RIL_REQUEST_ISIM_AUTHENTICATION 105
   4800 
   4801 /**
   4802  * RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU
   4803  *
   4804  * Acknowledge successful or failed receipt of SMS previously indicated
   4805  * via RIL_UNSOL_RESPONSE_NEW_SMS, including acknowledgement TPDU to send
   4806  * as the RP-User-Data element of the RP-ACK or RP-ERROR PDU.
   4807  *
   4808  * "data" is const char **
   4809  * ((const char **)data)[0] is "1" on successful receipt (send RP-ACK)
   4810  *                          is "0" on failed receipt (send RP-ERROR)
   4811  * ((const char **)data)[1] is the acknowledgement TPDU in hexadecimal format
   4812  *
   4813  * "response" is NULL
   4814  *
   4815  * Valid errors:
   4816  *  SUCCESS
   4817  *  RADIO_NOT_AVAILABLE
   4818  */
   4819 #define RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 106
   4820 
   4821 /**
   4822  * RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS
   4823  *
   4824  * Requests to send a SAT/USAT envelope command to SIM.
   4825  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111.
   4826  *
   4827  * This request has one difference from RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND:
   4828  * the SW1 and SW2 status bytes from the UICC response are returned along with
   4829  * the response data, using the same structure as RIL_REQUEST_SIM_IO.
   4830  *
   4831  * The RIL implementation shall perform the normal processing of a '91XX'
   4832  * response in SW1/SW2 to retrieve the pending proactive command and send it
   4833  * as an unsolicited response, as RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND does.
   4834  *
   4835  * "data" is a const char * containing the SAT/USAT command
   4836  * in hexadecimal format starting with command tag
   4837  *
   4838  * "response" is a const RIL_SIM_IO_Response *
   4839  *
   4840  * Valid errors:
   4841  *  RIL_E_SUCCESS
   4842  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   4843  *  SIM_BUSY
   4844  *  OPERATION_NOT_ALLOWED
   4845  */
   4846 #define RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 107
   4847 
   4848 /**
   4849  * RIL_REQUEST_VOICE_RADIO_TECH
   4850  *
   4851  * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only
   4852  * when radio state is not RADIO_STATE_UNAVAILABLE
   4853  *
   4854  * "data" is NULL
   4855  * "response" is int *
   4856  * ((int *) response)[0] is of type const RIL_RadioTechnology
   4857  *
   4858  * Valid errors:
   4859  *  SUCCESS
   4860  *  RADIO_NOT_AVAILABLE
   4861  */
   4862 #define RIL_REQUEST_VOICE_RADIO_TECH 108
   4863 
   4864 /**
   4865  * RIL_REQUEST_GET_CELL_INFO_LIST
   4866  *
   4867  * Request all of the current cell information known to the radio. The radio
   4868  * must a list of all current cells, including the neighboring cells. If for a particular
   4869  * cell information isn't known then the appropriate unknown value will be returned.
   4870  * This does not cause or change the rate of RIL_UNSOL_CELL_INFO_LIST.
   4871  *
   4872  * "data" is NULL
   4873  *
   4874  * "response" is an array of  RIL_CellInfo_v12.
   4875  *
   4876  * Valid errors:
   4877  *  SUCCESS
   4878  *  RADIO_NOT_AVAILABLE
   4879  *  NO_MEMORY
   4880  *  INTERNAL_ERR
   4881  *  SYSTEM_ERR
   4882  *  MODEM_ERR
   4883  *  NO_NETWORK_FOUND
   4884  *  REQUEST_NOT_SUPPORTED
   4885  *
   4886  */
   4887 #define RIL_REQUEST_GET_CELL_INFO_LIST 109
   4888 
   4889 /**
   4890  * RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE
   4891  *
   4892  * Sets the minimum time between when RIL_UNSOL_CELL_INFO_LIST should be invoked.
   4893  * A value of 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported
   4894  * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
   4895  * a RIL_UNSOL_CELL_INFO_LIST.
   4896  *
   4897  * "data" is int *
   4898  * ((int *)data)[0] is minimum time in milliseconds
   4899  *
   4900  * "response" is NULL
   4901  *
   4902  * Valid errors:
   4903  *  SUCCESS
   4904  *  RADIO_NOT_AVAILABLE
   4905  *  NO_MEMORY
   4906  *  INTERNAL_ERR
   4907  *  SYSTEM_ERR
   4908  *  INVALID_ARGUMENTS
   4909  *  REQUEST_NOT_SUPPORTED
   4910  */
   4911 #define RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 110
   4912 
   4913 /**
   4914  * RIL_REQUEST_SET_INITIAL_ATTACH_APN
   4915  *
   4916  * Set an apn to initial attach network
   4917  *
   4918  * "data" is a const char **
   4919  * ((const char **)data)[0] is the APN to connect if radio technology is LTE
   4920  * ((const char **)data)[1] is the connection type to request must be one of the
   4921  *                          PDP_type values in TS 27.007 section 10.1.1.
   4922  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
   4923  * ((const char **)data)[2] is the PAP / CHAP auth type. Values:
   4924  *                          0 => PAP and CHAP is never performed.
   4925  *                          1 => PAP may be performed; CHAP is never performed.
   4926  *                          2 => CHAP may be performed; PAP is never performed.
   4927  *                          3 => PAP / CHAP may be performed - baseband dependent.
   4928  * ((const char **)data)[3] is the username for APN, or NULL
   4929  * ((const char **)data)[4] is the password for APN, or NULL
   4930  *
   4931  * "response" is NULL
   4932  *
   4933  * Valid errors:
   4934  *  SUCCESS
   4935  *  RADIO_NOT_AVAILABLE (radio resetting)
   4936  *  SUBSCRIPTION_NOT_AVAILABLE
   4937  *  NO_MEMORY
   4938  *  INTERNAL_ERR
   4939  *  SYSTEM_ERR
   4940  *  INVALID_ARGUMENTS
   4941  *  MODEM_ERR
   4942  *  NOT_PROVISIONED
   4943  *  REQUEST_NOT_SUPPORTED
   4944  *
   4945  */
   4946 #define RIL_REQUEST_SET_INITIAL_ATTACH_APN 111
   4947 
   4948 /**
   4949  * RIL_REQUEST_IMS_REGISTRATION_STATE
   4950  *
   4951  * This message is DEPRECATED and shall be removed in a future release (target: 2018);
   4952  * instead, provide IMS registration status via an IMS Service.
   4953  *
   4954  * Request current IMS registration state
   4955  *
   4956  * "data" is NULL
   4957  *
   4958  * "response" is int *
   4959  * ((int *)response)[0] is registration state:
   4960  *              0 - Not registered
   4961  *              1 - Registered
   4962  *
   4963  * If ((int*)response)[0] is = 1, then ((int *) response)[1]
   4964  * must follow with IMS SMS format:
   4965  *
   4966  * ((int *) response)[1] is of type RIL_RadioTechnologyFamily
   4967  *
   4968  * Valid errors:
   4969  *  SUCCESS
   4970  *  RADIO_NOT_AVAILABLE
   4971  */
   4972 #define RIL_REQUEST_IMS_REGISTRATION_STATE 112
   4973 
   4974 /**
   4975  * RIL_REQUEST_IMS_SEND_SMS
   4976  *
   4977  * Send a SMS message over IMS
   4978  *
   4979  * "data" is const RIL_IMS_SMS_Message *
   4980  *
   4981  * "response" is a const RIL_SMS_Response *
   4982  *
   4983  * Based on the return error, caller decides to resend if sending sms
   4984  * fails. SMS_SEND_FAIL_RETRY means retry, and other errors means no retry.
   4985  * In case of retry, data is encoded based on Voice Technology available.
   4986  *
   4987  * Valid errors:
   4988  *  SUCCESS
   4989  *  RADIO_NOT_AVAILABLE
   4990  *  SMS_SEND_FAIL_RETRY
   4991  *  FDN_CHECK_FAILURE
   4992  *  NETWORK_REJECT
   4993  *  INVALID_ARGUMENTS
   4994  *  INVALID_STATE
   4995  *  NO_MEMORY
   4996  *  INVALID_SMS_FORMAT
   4997  *  SYSTEM_ERR
   4998  *  REQUEST_RATE_LIMITED
   4999  *  MODEM_ERR
   5000  *  NETWORK_ERR
   5001  *  ENCODING_ERR
   5002  *  INVALID_SMSC_ADDRESS
   5003  *  MODE_NOT_SUPPORTED
   5004  *
   5005  */
   5006 #define RIL_REQUEST_IMS_SEND_SMS 113
   5007 
   5008 /**
   5009  * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC
   5010  *
   5011  * Request APDU exchange on the basic channel. This command reflects TS 27.007
   5012  * "generic SIM access" operation (+CSIM). The modem must ensure proper function
   5013  * of GSM/CDMA, and filter commands appropriately. It should filter
   5014  * channel management and SELECT by DF name commands.
   5015  *
   5016  * "data" is a const RIL_SIM_APDU *
   5017  * "sessionid" field should be ignored.
   5018  *
   5019  * "response" is a const RIL_SIM_IO_Response *
   5020  *
   5021  * Valid errors:
   5022  *  SUCCESS
   5023  *  RADIO_NOT_AVAILABLE
   5024  */
   5025 #define RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC 114
   5026 
   5027 /**
   5028  * RIL_REQUEST_SIM_OPEN_CHANNEL
   5029  *
   5030  * Open a new logical channel and select the given application. This command
   5031  * reflects TS 27.007 "open logical channel" operation (+CCHO). This request
   5032  * also specifies the P2 parameter (described in ISO 7816-4).
   5033  *
   5034  * "data" is a const RIL_OpenChannelParam *
   5035  *
   5036  * "response" is int *
   5037  * ((int *)data)[0] contains the session id of the logical channel.
   5038  * ((int *)data)[1] onwards may optionally contain the select response for the
   5039  *     open channel command with one byte per integer.
   5040  *
   5041  * Valid errors:
   5042  *  SUCCESS
   5043  *  RADIO_NOT_AVAILABLE
   5044  *  MISSING_RESOURCE
   5045  *  NO_SUCH_ELEMENT
   5046  */
   5047 #define RIL_REQUEST_SIM_OPEN_CHANNEL 115
   5048 
   5049 /**
   5050  * RIL_REQUEST_SIM_CLOSE_CHANNEL
   5051  *
   5052  * Close a previously opened logical channel. This command reflects TS 27.007
   5053  * "close logical channel" operation (+CCHC).
   5054  *
   5055  * "data" is int *
   5056  * ((int *)data)[0] is the session id of logical the channel to close.
   5057  *
   5058  * "response" is NULL
   5059  *
   5060  * Valid errors:
   5061  *  SUCCESS
   5062  *  RADIO_NOT_AVAILABLE
   5063  */
   5064 #define RIL_REQUEST_SIM_CLOSE_CHANNEL 116
   5065 
   5066 /**
   5067  * RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL
   5068  *
   5069  * Exchange APDUs with a UICC over a previously opened logical channel. This
   5070  * command reflects TS 27.007 "generic logical channel access" operation
   5071  * (+CGLA). The modem should filter channel management and SELECT by DF name
   5072  * commands.
   5073  *
   5074  * "data" is a const RIL_SIM_APDU*
   5075  *
   5076  * "response" is a const RIL_SIM_IO_Response *
   5077  *
   5078  * Valid errors:
   5079  *  SUCCESS
   5080  *  RADIO_NOT_AVAILABLE
   5081  */
   5082 #define RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL 117
   5083 
   5084 /**
   5085  * RIL_REQUEST_NV_READ_ITEM
   5086  *
   5087  * Read one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h.
   5088  * This is used for device configuration by some CDMA operators.
   5089  *
   5090  * "data" is a const RIL_NV_ReadItem *
   5091  *
   5092  * "response" is const char * containing the contents of the NV item
   5093  *
   5094  * Valid errors:
   5095  *  SUCCESS
   5096  *  RADIO_NOT_AVAILABLE
   5097  */
   5098 #define RIL_REQUEST_NV_READ_ITEM 118
   5099 
   5100 /**
   5101  * RIL_REQUEST_NV_WRITE_ITEM
   5102  *
   5103  * Write one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h.
   5104  * This is used for device configuration by some CDMA operators.
   5105  *
   5106  * "data" is a const RIL_NV_WriteItem *
   5107  *
   5108  * "response" is NULL
   5109  *
   5110  * Valid errors:
   5111  *  SUCCESS
   5112  *  RADIO_NOT_AVAILABLE
   5113  */
   5114 #define RIL_REQUEST_NV_WRITE_ITEM 119
   5115 
   5116 /**
   5117  * RIL_REQUEST_NV_WRITE_CDMA_PRL
   5118  *
   5119  * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
   5120  * This is used for device configuration by some CDMA operators.
   5121  *
   5122  * "data" is a const char * containing the PRL as a byte array
   5123  *
   5124  * "response" is NULL
   5125  *
   5126  * Valid errors:
   5127  *  SUCCESS
   5128  *  RADIO_NOT_AVAILABLE
   5129  */
   5130 #define RIL_REQUEST_NV_WRITE_CDMA_PRL 120
   5131 
   5132 /**
   5133  * RIL_REQUEST_NV_RESET_CONFIG
   5134  *
   5135  * Reset the radio NV configuration to the factory state.
   5136  * This is used for device configuration by some CDMA operators.
   5137  *
   5138  * "data" is int *
   5139  * ((int *)data)[0] is 1 to reload all NV items
   5140  * ((int *)data)[0] is 2 for erase NV reset (SCRTN)
   5141  * ((int *)data)[0] is 3 for factory reset (RTN)
   5142  *
   5143  * "response" is NULL
   5144  *
   5145  * Valid errors:
   5146  *  SUCCESS
   5147  *  RADIO_NOT_AVAILABLE
   5148  */
   5149 #define RIL_REQUEST_NV_RESET_CONFIG 121
   5150 
   5151  /** RIL_REQUEST_SET_UICC_SUBSCRIPTION
   5152  * FIXME This API needs to have more documentation.
   5153  *
   5154  * Selection/de-selection of a subscription from a SIM card
   5155  * "data" is const  RIL_SelectUiccSub*
   5156 
   5157  *
   5158  * "response" is NULL
   5159  *
   5160  *  Valid errors:
   5161  *  SUCCESS
   5162  *  RADIO_NOT_AVAILABLE (radio resetting)
   5163  *  SUBSCRIPTION_NOT_SUPPORTED
   5164  *  NO_MEMORY
   5165  *  INTERNAL_ERR
   5166  *  SYSTEM_ERR
   5167  *  INVALID_ARGUMENTS
   5168  *  MODEM_ERR
   5169  *  REQUEST_NOT_SUPPORTED
   5170  *
   5171  */
   5172 #define RIL_REQUEST_SET_UICC_SUBSCRIPTION  122
   5173 
   5174 /**
   5175  *  RIL_REQUEST_ALLOW_DATA
   5176  *
   5177  *  Tells the modem whether data calls are allowed or not
   5178  *
   5179  * "data" is int *
   5180  * FIXME slotId and aid will be added.
   5181  * ((int *)data)[0] is == 0 to allow data calls
   5182  * ((int *)data)[0] is == 1 to disallow data calls
   5183  *
   5184  * "response" is NULL
   5185  *
   5186  *  Valid errors:
   5187  *
   5188  *  SUCCESS
   5189  *  RADIO_NOT_AVAILABLE (radio resetting)
   5190  *  NO_MEMORY
   5191  *  INTERNAL_ERR
   5192  *  SYSTEM_ERR
   5193  *  MODEM_ERR
   5194  *  INVALID_ARGUMENTS
   5195  *  DEVICE_IN_USE
   5196  *  INVALID_MODEM_STATE
   5197  *  REQUEST_NOT_SUPPORTED
   5198  *
   5199  */
   5200 #define RIL_REQUEST_ALLOW_DATA  123
   5201 
   5202 /**
   5203  * RIL_REQUEST_GET_HARDWARE_CONFIG
   5204  *
   5205  * Request all of the current hardware (modem and sim) associated
   5206  * with the RIL.
   5207  *
   5208  * "data" is NULL
   5209  *
   5210  * "response" is an array of  RIL_HardwareConfig.
   5211  */
   5212 #define RIL_REQUEST_GET_HARDWARE_CONFIG 124
   5213 
   5214 /**
   5215  * RIL_REQUEST_SIM_AUTHENTICATION
   5216  *
   5217  * Returns the response of SIM Authentication through RIL to a
   5218  * challenge request.
   5219  *
   5220  * "data" Base64 encoded string containing challenge:
   5221  *      int   authContext;          P2 value of authentication command, see P2 parameter in
   5222  *                                  3GPP TS 31.102 7.1.2
   5223  *      char *authData;             the challenge string in Base64 format, see 3GPP
   5224  *                                  TS 31.102 7.1.2
   5225  *      char *aid;                  AID value, See ETSI 102.221 8.1 and 101.220 4,
   5226  *                                  NULL if no value
   5227  *
   5228  * "response" Base64 encoded strings containing response:
   5229  *      int   sw1;                  Status bytes per 3GPP TS 31.102 section 7.3
   5230  *      int   sw2;
   5231  *      char *simResponse;          Response in Base64 format, see 3GPP TS 31.102 7.1.2
   5232  */
   5233 #define RIL_REQUEST_SIM_AUTHENTICATION 125
   5234 
   5235 /**
   5236  * RIL_REQUEST_GET_DC_RT_INFO
   5237  *
   5238  * The request is DEPRECATED, use RIL_REQUEST_GET_ACTIVITY_INFO
   5239  * Requests the Data Connection Real Time Info
   5240  *
   5241  * "data" is NULL
   5242  *
   5243  * "response" is the most recent RIL_DcRtInfo
   5244  *
   5245  * Valid errors:
   5246  *  SUCCESS
   5247  *  RADIO_NOT_AVAILABLE
   5248  *  REQUEST_NOT_SUPPORTED
   5249  *
   5250  * See also: RIL_UNSOL_DC_RT_INFO_CHANGED
   5251  */
   5252 #define RIL_REQUEST_GET_DC_RT_INFO 126
   5253 
   5254 /**
   5255  * RIL_REQUEST_SET_DC_RT_INFO_RATE
   5256  *
   5257  * The request is DEPRECATED
   5258  * This is the minimum number of milliseconds between successive
   5259  * RIL_UNSOL_DC_RT_INFO_CHANGED messages and defines the highest rate
   5260  * at which RIL_UNSOL_DC_RT_INFO_CHANGED's will be sent. A value of
   5261  * 0 means send as fast as possible.
   5262  *
   5263  * "data" The number of milliseconds as an int
   5264  *
   5265  * "response" is null
   5266  *
   5267  * Valid errors:
   5268  *  SUCCESS must not fail
   5269  */
   5270 #define RIL_REQUEST_SET_DC_RT_INFO_RATE 127
   5271 
   5272 /**
   5273  * RIL_REQUEST_SET_DATA_PROFILE
   5274  *
   5275  * Set data profile in modem
   5276  * Modem should erase existed profiles from framework, and apply new profiles
   5277  * "data" is a const RIL_DataProfileInfo **
   5278  * "datalen" is count * sizeof(const RIL_DataProfileInfo *)
   5279  * "response" is NULL
   5280  *
   5281  * Valid errors:
   5282  *  SUCCESS
   5283  *  RADIO_NOT_AVAILABLE (radio resetting)
   5284  *  SUBSCRIPTION_NOT_AVAILABLE
   5285  */
   5286 #define RIL_REQUEST_SET_DATA_PROFILE 128
   5287 
   5288 /**
   5289  * RIL_REQUEST_SHUTDOWN
   5290  *
   5291  * Device is shutting down. All further commands are ignored
   5292  * and RADIO_NOT_AVAILABLE must be returned.
   5293  *
   5294  * "data" is null
   5295  * "response" is NULL
   5296  *
   5297  * Valid errors:
   5298  *  SUCCESS
   5299  *  RADIO_NOT_AVAILABLE
   5300  *  OPERATION_NOT_ALLOWED
   5301  *  NO_MEMORY
   5302  *  INTERNAL_ERR
   5303  *  SYSTEM_ERR
   5304  *  REQUEST_NOT_SUPPORTED
   5305  */
   5306 #define RIL_REQUEST_SHUTDOWN 129
   5307 
   5308 /**
   5309  * RIL_REQUEST_GET_RADIO_CAPABILITY
   5310  *
   5311  * Used to get phone radio capablility.
   5312  *
   5313  * "data" is the RIL_RadioCapability structure
   5314  *
   5315  * Valid errors:
   5316  *  SUCCESS
   5317  *  RADIO_NOT_AVAILABLE
   5318  *  OPERATION_NOT_ALLOWED
   5319  *  INVALID_STATE
   5320  *  REQUEST_NOT_SUPPORTED
   5321  */
   5322 #define RIL_REQUEST_GET_RADIO_CAPABILITY 130
   5323 
   5324 /**
   5325  * RIL_REQUEST_SET_RADIO_CAPABILITY
   5326  *
   5327  * Used to set the phones radio capability. Be VERY careful
   5328  * using this request as it may cause some vendor modems to reset. Because
   5329  * of the possible modem reset any RIL commands after this one may not be
   5330  * processed.
   5331  *
   5332  * "data" is the RIL_RadioCapability structure
   5333  *
   5334  * "response" is the RIL_RadioCapability structure, used to feedback return status
   5335  *
   5336  * Valid errors:
   5337  *  SUCCESS means a RIL_UNSOL_RADIO_CAPABILITY will be sent within 30 seconds.
   5338  *  RADIO_NOT_AVAILABLE
   5339  *  OPERATION_NOT_ALLOWED
   5340  *  NO_MEMORY
   5341  *  INTERNAL_ERR
   5342  *  SYSTEM_ERR
   5343  *  INVALID_ARGUMENTS
   5344  *  MODEM_ERR
   5345  *  INVALID_STATE
   5346  *  REQUEST_NOT_SUPPORTED
   5347  */
   5348 #define RIL_REQUEST_SET_RADIO_CAPABILITY 131
   5349 
   5350 /**
   5351  * RIL_REQUEST_START_LCE
   5352  *
   5353  * Start Link Capacity Estimate (LCE) service if supported by the radio.
   5354  *
   5355  * "data" is const int *
   5356  * ((const int*)data)[0] specifies the desired reporting interval (ms).
   5357  * ((const int*)data)[1] specifies the LCE service mode. 1: PULL; 0: PUSH.
   5358  *
   5359  * "response" is the RIL_LceStatusInfo.
   5360  *
   5361  * Valid errors:
   5362  * SUCCESS
   5363  * RADIO_NOT_AVAILABLE
   5364  * LCE_NOT_SUPPORTED
   5365  * INTERNAL_ERR
   5366  * REQUEST_NOT_SUPPORTED
   5367  */
   5368 #define RIL_REQUEST_START_LCE 132
   5369 
   5370 /**
   5371  * RIL_REQUEST_STOP_LCE
   5372  *
   5373  * Stop Link Capacity Estimate (LCE) service, the STOP operation should be
   5374  * idempotent for the radio modem.
   5375  *
   5376  * "response" is the RIL_LceStatusInfo.
   5377  *
   5378  * Valid errors:
   5379  * SUCCESS
   5380  * RADIO_NOT_AVAILABLE
   5381  * LCE_NOT_SUPPORTED
   5382  */
   5383 #define RIL_REQUEST_STOP_LCE 133
   5384 
   5385 /**
   5386  * RIL_REQUEST_PULL_LCEDATA
   5387  *
   5388  * Pull LCE service for capacity information.
   5389  *
   5390  * "response" is the RIL_LceDataInfo.
   5391  *
   5392  * Valid errors:
   5393  * SUCCESS
   5394  * RADIO_NOT_AVAILABLE
   5395  * LCE_NOT_SUPPORTED
   5396  */
   5397 #define RIL_REQUEST_PULL_LCEDATA 134
   5398 
   5399 /**
   5400  * RIL_REQUEST_GET_ACTIVITY_INFO
   5401  *
   5402  * Get modem activity information for power consumption estimation.
   5403  *
   5404  * Request clear-on-read statistics information that is used for
   5405  * estimating the per-millisecond power consumption of the cellular
   5406  * modem.
   5407  *
   5408  * "data" is null
   5409  * "response" is const RIL_ActivityStatsInfo *
   5410  *
   5411  * Valid errors:
   5412  *
   5413  * SUCCESS
   5414  * RADIO_NOT_AVAILABLE (radio resetting)
   5415  * NO_MEMORY
   5416  * INTERNAL_ERR
   5417  * SYSTEM_ERR
   5418  * MODEM_ERR
   5419  * NOT_PROVISIONED
   5420  * REQUEST_NOT_SUPPORTED
   5421  */
   5422 #define RIL_REQUEST_GET_ACTIVITY_INFO 135
   5423 
   5424 /**
   5425  * RIL_REQUEST_SET_CARRIER_RESTRICTIONS
   5426  *
   5427  * Set carrier restrictions for this sim slot. Expected modem behavior:
   5428  *  If never receives this command
   5429  *  - Must allow all carriers
   5430  *  Receives this command with data being NULL
   5431  *  - Must allow all carriers. If a previously allowed SIM is present, modem must not reload
   5432  *    the SIM. If a previously disallowed SIM is present, reload the SIM and notify Android.
   5433  *  Receives this command with a list of carriers
   5434  *  - Only allow specified carriers, persist across power cycles and FDR. If a present SIM
   5435  *    is in the allowed list, modem must not reload the SIM. If a present SIM is *not* in
   5436  *    the allowed list, modem must detach from the registered network and only keep emergency
   5437  *    service, and notify Android SIM refresh reset with new SIM state being
   5438  *    RIL_CARDSTATE_RESTRICTED. Emergency service must be enabled.
   5439  *
   5440  * "data" is const RIL_CarrierRestrictions *
   5441  * A list of allowed carriers and possibly a list of excluded carriers.
   5442  * If data is NULL, means to clear previous carrier restrictions and allow all carriers
   5443  *
   5444  * "response" is int *
   5445  * ((int *)data)[0] contains the number of allowed carriers which have been set correctly.
   5446  * On success, it should match the length of list data->allowed_carriers.
   5447  * If data is NULL, the value must be 0.
   5448  *
   5449  * Valid errors:
   5450  *  RIL_E_SUCCESS
   5451  *  RIL_E_INVALID_ARGUMENTS
   5452  *  RIL_E_RADIO_NOT_AVAILABLE
   5453  *  RIL_E_REQUEST_NOT_SUPPORTED
   5454  */
   5455 #define RIL_REQUEST_SET_CARRIER_RESTRICTIONS 136
   5456 
   5457 /**
   5458  * RIL_REQUEST_GET_CARRIER_RESTRICTIONS
   5459  *
   5460  * Get carrier restrictions for this sim slot. Expected modem behavior:
   5461  *  Return list of allowed carriers, or null if all carriers are allowed.
   5462  *
   5463  * "data" is NULL
   5464  *
   5465  * "response" is const RIL_CarrierRestrictions *.
   5466  * If response is NULL, it means all carriers are allowed.
   5467  *
   5468  * Valid errors:
   5469  *  RIL_E_SUCCESS
   5470  *  RIL_E_RADIO_NOT_AVAILABLE
   5471  *  RIL_E_REQUEST_NOT_SUPPORTED
   5472  */
   5473 #define RIL_REQUEST_GET_CARRIER_RESTRICTIONS 137
   5474 
   5475 /**
   5476  * RIL_REQUEST_SEND_DEVICE_STATE
   5477  *
   5478  * Send the updated device state.
   5479  * Modem can perform power saving based on the provided device state.
   5480  * "data" is const int *
   5481  * ((const int*)data)[0] A RIL_DeviceStateType that specifies the device state type.
   5482  * ((const int*)data)[1] Specifies the state. See RIL_DeviceStateType for the definition of each
   5483  *                       type.
   5484  *
   5485  * "datalen" is count * sizeof(const RIL_DeviceState *)
   5486  * "response" is NULL
   5487  *
   5488  * Valid errors:
   5489  *  SUCCESS
   5490  *  RADIO_NOT_AVAILABLE (radio resetting)
   5491  *  NO_MEMORY
   5492  *  INTERNAL_ERR
   5493  *  SYSTEM_ERR
   5494  *  INVALID_ARGUMENTS
   5495  *  REQUEST_NOT_SUPPORTED
   5496  */
   5497 #define RIL_REQUEST_SEND_DEVICE_STATE 138
   5498 
   5499 /**
   5500  * RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER
   5501  *
   5502  * Set the unsolicited response filter
   5503  * This is used to prevent unnecessary application processor
   5504  * wake up for power saving purposes by suppressing the
   5505  * unsolicited responses in certain scenarios.
   5506  *
   5507  * "data" is an int *
   5508  *
   5509  * ((int *)data)[0] is a 32-bit bitmask of RIL_UnsolicitedResponseFilter
   5510  *
   5511  * "response" is NULL
   5512  *
   5513  * Valid errors:
   5514  *  SUCCESS
   5515  *  INVALID_ARGUMENTS (e.g. the requested filter doesn't exist)
   5516  *  RADIO_NOT_AVAILABLE (radio resetting)
   5517  *  NO_MEMORY
   5518  *  INTERNAL_ERR
   5519  *  SYSTEM_ERR
   5520  *  REQUEST_NOT_SUPPORTED
   5521  */
   5522 #define RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER 139
   5523 
   5524  /**
   5525   * RIL_REQUEST_SET_SIM_CARD_POWER
   5526   *
   5527   * Set SIM card power up or down
   5528   *
   5529   * Request is equivalent to inserting and removing the card, with
   5530   * an additional effect where the ability to detect card removal/insertion
   5531   * is disabled when the SIM card is powered down.
   5532   *
   5533   * This will generate RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
   5534   * as if the SIM had been inserted or removed.
   5535   *
   5536   * "data" is int *
   5537   * ((int *)data)[0] is 1 for "SIM POWER UP"
   5538   * ((int *)data)[0] is 0 for "SIM POWER DOWN"
   5539   *
   5540   * "response" is NULL
   5541   *
   5542   * Valid errors:
   5543   *  SUCCESS
   5544   *  RADIO_NOT_AVAILABLE
   5545   *  REQUEST_NOT_SUPPORTED
   5546   *  SIM_ABSENT
   5547   *  INVALID_ARGUMENTS
   5548   */
   5549 #define RIL_REQUEST_SET_SIM_CARD_POWER 140
   5550 /***********************************************************************/
   5551 
   5552 /**
   5553  * RIL_RESPONSE_ACKNOWLEDGEMENT
   5554  *
   5555  * This is used by Asynchronous solicited messages and Unsolicited messages
   5556  * to acknowledge the receipt of those messages in RIL.java so that the ack
   5557  * can be used to let ril.cpp to release wakelock.
   5558  *
   5559  * Valid errors
   5560  * SUCCESS
   5561  * RADIO_NOT_AVAILABLE
   5562  */
   5563 
   5564 #define RIL_RESPONSE_ACKNOWLEDGEMENT 800
   5565 
   5566 /***********************************************************************/
   5567 
   5568 
   5569 #define RIL_UNSOL_RESPONSE_BASE 1000
   5570 
   5571 /**
   5572  * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
   5573  *
   5574  * Indicate when value of RIL_RadioState has changed.
   5575  *
   5576  * Callee will invoke RIL_RadioStateRequest method on main thread
   5577  *
   5578  * "data" is NULL
   5579  */
   5580 
   5581 #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
   5582 
   5583 
   5584 /**
   5585  * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
   5586  *
   5587  * Indicate when call state has changed
   5588  *
   5589  * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
   5590  *
   5591  * "data" is NULL
   5592  *
   5593  * Response should be invoked on, for example,
   5594  * "RING", "BUSY", "NO CARRIER", and also call state
   5595  * transitions (DIALING->ALERTING ALERTING->ACTIVE)
   5596  *
   5597  * Redundent or extraneous invocations are tolerated
   5598  */
   5599 #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
   5600 
   5601 
   5602 /**
   5603  * RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
   5604  *
   5605  * Called when the voice network state changed
   5606  *
   5607  * Callee will invoke the following requests on main thread:
   5608  *
   5609  * RIL_REQUEST_VOICE_REGISTRATION_STATE
   5610  * RIL_REQUEST_OPERATOR
   5611  *
   5612  * "data" is NULL
   5613  *
   5614  * FIXME should this happen when SIM records are loaded? (eg, for
   5615  * EONS)
   5616  */
   5617 #define RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 1002
   5618 
   5619 /**
   5620  * RIL_UNSOL_RESPONSE_NEW_SMS
   5621  *
   5622  * Called when new SMS is received.
   5623  *
   5624  * "data" is const char *
   5625  * This is a pointer to a string containing the PDU of an SMS-DELIVER
   5626  * as an ascii string of hex digits. The PDU starts with the SMSC address
   5627  * per TS 27.005 (+CMT:)
   5628  *
   5629  * Callee will subsequently confirm the receipt of thei SMS with a
   5630  * RIL_REQUEST_SMS_ACKNOWLEDGE
   5631  *
   5632  * No new RIL_UNSOL_RESPONSE_NEW_SMS
   5633  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
   5634  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
   5635  */
   5636 
   5637 #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
   5638 
   5639 /**
   5640  * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
   5641  *
   5642  * Called when new SMS Status Report is received.
   5643  *
   5644  * "data" is const char *
   5645  * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
   5646  * as an ascii string of hex digits. The PDU starts with the SMSC address
   5647  * per TS 27.005 (+CDS:).
   5648  *
   5649  * Callee will subsequently confirm the receipt of the SMS with a
   5650  * RIL_REQUEST_SMS_ACKNOWLEDGE
   5651  *
   5652  * No new RIL_UNSOL_RESPONSE_NEW_SMS
   5653  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
   5654  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
   5655  */
   5656 
   5657 #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
   5658 
   5659 /**
   5660  * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
   5661  *
   5662  * Called when new SMS has been stored on SIM card
   5663  *
   5664  * "data" is const int *
   5665  * ((const int *)data)[0] contains the slot index on the SIM that contains
   5666  * the new message
   5667  */
   5668 
   5669 #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
   5670 
   5671 /**
   5672  * RIL_UNSOL_ON_USSD
   5673  *
   5674  * Called when a new USSD message is received.
   5675  *
   5676  * "data" is const char **
   5677  * ((const char **)data)[0] points to a type code, which is
   5678  *  one of these string values:
   5679  *      "0"   USSD-Notify -- text in ((const char **)data)[1]
   5680  *      "1"   USSD-Request -- text in ((const char **)data)[1]
   5681  *      "2"   Session terminated by network
   5682  *      "3"   other local client (eg, SIM Toolkit) has responded
   5683  *      "4"   Operation not supported
   5684  *      "5"   Network timeout
   5685  *
   5686  * The USSD session is assumed to persist if the type code is "1", otherwise
   5687  * the current session (if any) is assumed to have terminated.
   5688  *
   5689  * ((const char **)data)[1] points to a message string if applicable, which
   5690  * should always be in UTF-8.
   5691  */
   5692 #define RIL_UNSOL_ON_USSD 1006
   5693 /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006   */
   5694 
   5695 /**
   5696  * RIL_UNSOL_ON_USSD_REQUEST
   5697  *
   5698  * Obsolete. Send via RIL_UNSOL_ON_USSD
   5699  */
   5700 #define RIL_UNSOL_ON_USSD_REQUEST 1007
   5701 
   5702 /**
   5703  * RIL_UNSOL_NITZ_TIME_RECEIVED
   5704  *
   5705  * Called when radio has received a NITZ time message
   5706  *
   5707  * "data" is const char * pointing to NITZ time string
   5708  * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
   5709  */
   5710 #define RIL_UNSOL_NITZ_TIME_RECEIVED  1008
   5711 
   5712 /**
   5713  * RIL_UNSOL_SIGNAL_STRENGTH
   5714  *
   5715  * Radio may report signal strength rather han have it polled.
   5716  *
   5717  * "data" is a const RIL_SignalStrength *
   5718  */
   5719 #define RIL_UNSOL_SIGNAL_STRENGTH  1009
   5720 
   5721 
   5722 /**
   5723  * RIL_UNSOL_DATA_CALL_LIST_CHANGED
   5724  *
   5725  * "data" is an array of RIL_Data_Call_Response_v6 identical to that
   5726  * returned by RIL_REQUEST_DATA_CALL_LIST. It is the complete list
   5727  * of current data contexts including new contexts that have been
   5728  * activated. A data call is only removed from this list when the
   5729  * framework sends a RIL_REQUEST_DEACTIVATE_DATA_CALL or the radio
   5730  * is powered off/on.
   5731  *
   5732  * See also: RIL_REQUEST_DATA_CALL_LIST
   5733  */
   5734 
   5735 #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010
   5736 
   5737 /**
   5738  * RIL_UNSOL_SUPP_SVC_NOTIFICATION
   5739  *
   5740  * Reports supplementary service related notification from the network.
   5741  *
   5742  * "data" is a const RIL_SuppSvcNotification *
   5743  *
   5744  */
   5745 
   5746 #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
   5747 
   5748 /**
   5749  * RIL_UNSOL_STK_SESSION_END
   5750  *
   5751  * Indicate when STK session is terminated by SIM.
   5752  *
   5753  * "data" is NULL
   5754  */
   5755 #define RIL_UNSOL_STK_SESSION_END 1012
   5756 
   5757 /**
   5758  * RIL_UNSOL_STK_PROACTIVE_COMMAND
   5759  *
   5760  * Indicate when SIM issue a STK proactive command to applications
   5761  *
   5762  * "data" is a const char * containing SAT/USAT proactive command
   5763  * in hexadecimal format string starting with command tag
   5764  *
   5765  */
   5766 #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
   5767 
   5768 /**
   5769  * RIL_UNSOL_STK_EVENT_NOTIFY
   5770  *
   5771  * Indicate when SIM notifies applcations some event happens.
   5772  * Generally, application does not need to have any feedback to
   5773  * SIM but shall be able to indicate appropriate messages to users.
   5774  *
   5775  * "data" is a const char * containing SAT/USAT commands or responses
   5776  * sent by ME to SIM or commands handled by ME, in hexadecimal format string
   5777  * starting with first byte of response data or command tag
   5778  *
   5779  */
   5780 #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
   5781 
   5782 /**
   5783  * RIL_UNSOL_STK_CALL_SETUP
   5784  *
   5785  * Indicate when SIM wants application to setup a voice call.
   5786  *
   5787  * "data" is const int *
   5788  * ((const int *)data)[0] contains timeout value (in milliseconds)
   5789  */
   5790 #define RIL_UNSOL_STK_CALL_SETUP 1015
   5791 
   5792 /**
   5793  * RIL_UNSOL_SIM_SMS_STORAGE_FULL
   5794  *
   5795  * Indicates that SMS storage on the SIM is full.  Sent when the network
   5796  * attempts to deliver a new SMS message.  Messages cannot be saved on the
   5797  * SIM until space is freed.  In particular, incoming Class 2 messages
   5798  * cannot be stored.
   5799  *
   5800  * "data" is null
   5801  *
   5802  */
   5803 #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
   5804 
   5805 /**
   5806  * RIL_UNSOL_SIM_REFRESH
   5807  *
   5808  * Indicates that file(s) on the SIM have been updated, or the SIM
   5809  * has been reinitialized.
   5810  *
   5811  * In the case where RIL is version 6 or older:
   5812  * "data" is an int *
   5813  * ((int *)data)[0] is a RIL_SimRefreshResult.
   5814  * ((int *)data)[1] is the EFID of the updated file if the result is
   5815  * SIM_FILE_UPDATE or NULL for any other result.
   5816  *
   5817  * In the case where RIL is version 7:
   5818  * "data" is a RIL_SimRefreshResponse_v7 *
   5819  *
   5820  * Note: If the SIM state changes as a result of the SIM refresh (eg,
   5821  * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
   5822  * should be sent.
   5823  */
   5824 #define RIL_UNSOL_SIM_REFRESH 1017
   5825 
   5826 /**
   5827  * RIL_UNSOL_CALL_RING
   5828  *
   5829  * Ring indication for an incoming call (eg, RING or CRING event).
   5830  * There must be at least one RIL_UNSOL_CALL_RING at the beginning
   5831  * of a call and sending multiple is optional. If the system property
   5832  * ro.telephony.call_ring.multiple is false then the upper layers
   5833  * will generate the multiple events internally. Otherwise the vendor
   5834  * ril must generate multiple RIL_UNSOL_CALL_RING if
   5835  * ro.telephony.call_ring.multiple is true or if it is absent.
   5836  *
   5837  * The rate of these events is controlled by ro.telephony.call_ring.delay
   5838  * and has a default value of 3000 (3 seconds) if absent.
   5839  *
   5840  * "data" is null for GSM
   5841  * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA
   5842  */
   5843 #define RIL_UNSOL_CALL_RING 1018
   5844 
   5845 /**
   5846  * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
   5847  *
   5848  * Indicates that SIM state changes.
   5849  *
   5850  * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread
   5851 
   5852  * "data" is null
   5853  */
   5854 #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019
   5855 
   5856 /**
   5857  * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
   5858  *
   5859  * Called when new CDMA SMS is received
   5860  *
   5861  * "data" is const RIL_CDMA_SMS_Message *
   5862  *
   5863  * Callee will subsequently confirm the receipt of the SMS with
   5864  * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
   5865  *
   5866  * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until
   5867  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received
   5868  *
   5869  */
   5870 #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020
   5871 
   5872 /**
   5873  * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS
   5874  *
   5875  * Called when new Broadcast SMS is received
   5876  *
   5877  * "data" can be one of the following:
   5878  * If received from GSM network, "data" is const char of 88 bytes
   5879  * which indicates each page of a CBS Message sent to the MS by the
   5880  * BTS as coded in 3GPP 23.041 Section 9.4.1.2.
   5881  * If received from UMTS network, "data" is const char of 90 up to 1252
   5882  * bytes which contain between 1 and 15 CBS Message pages sent as one
   5883  * packet to the MS by the BTS as coded in 3GPP 23.041 Section 9.4.2.2.
   5884  *
   5885  */
   5886 #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021
   5887 
   5888 /**
   5889  * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL
   5890  *
   5891  * Indicates that SMS storage on the RUIM is full.  Messages
   5892  * cannot be saved on the RUIM until space is freed.
   5893  *
   5894  * "data" is null
   5895  *
   5896  */
   5897 #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022
   5898 
   5899 /**
   5900  * RIL_UNSOL_RESTRICTED_STATE_CHANGED
   5901  *
   5902  * Indicates a restricted state change (eg, for Domain Specific Access Control).
   5903  *
   5904  * Radio need send this msg after radio off/on cycle no matter it is changed or not.
   5905  *
   5906  * "data" is an int *
   5907  * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values.
   5908  */
   5909 #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023
   5910 
   5911 /**
   5912  * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE
   5913  *
   5914  * Indicates that the radio system selection module has
   5915  * autonomously entered emergency callback mode.
   5916  *
   5917  * "data" is null
   5918  *
   5919  */
   5920 #define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024
   5921 
   5922 /**
   5923  * RIL_UNSOL_CDMA_CALL_WAITING
   5924  *
   5925  * Called when CDMA radio receives a call waiting indication.
   5926  *
   5927  * "data" is const RIL_CDMA_CallWaiting *
   5928  *
   5929  */
   5930 #define RIL_UNSOL_CDMA_CALL_WAITING 1025
   5931 
   5932 /**
   5933  * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS
   5934  *
   5935  * Called when CDMA radio receives an update of the progress of an
   5936  * OTASP/OTAPA call.
   5937  *
   5938  * "data" is const int *
   5939  *  For CDMA this is an integer OTASP/OTAPA status listed in
   5940  *  RIL_CDMA_OTA_ProvisionStatus.
   5941  *
   5942  */
   5943 #define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026
   5944 
   5945 /**
   5946  * RIL_UNSOL_CDMA_INFO_REC
   5947  *
   5948  * Called when CDMA radio receives one or more info recs.
   5949  *
   5950  * "data" is const RIL_CDMA_InformationRecords *
   5951  *
   5952  */
   5953 #define RIL_UNSOL_CDMA_INFO_REC 1027
   5954 
   5955 /**
   5956  * RIL_UNSOL_OEM_HOOK_RAW
   5957  *
   5958  * This is for OEM specific use.
   5959  *
   5960  * "data" is a byte[]
   5961  */
   5962 #define RIL_UNSOL_OEM_HOOK_RAW 1028
   5963 
   5964 /**
   5965  * RIL_UNSOL_RINGBACK_TONE
   5966  *
   5967  * Indicates that nework doesn't have in-band information,  need to
   5968  * play out-band tone.
   5969  *
   5970  * "data" is an int *
   5971  * ((int *)data)[0] == 0 for stop play ringback tone.
   5972  * ((int *)data)[0] == 1 for start play ringback tone.
   5973  */
   5974 #define RIL_UNSOL_RINGBACK_TONE 1029
   5975 
   5976 /**
   5977  * RIL_UNSOL_RESEND_INCALL_MUTE
   5978  *
   5979  * Indicates that framework/application need reset the uplink mute state.
   5980  *
   5981  * There may be situations where the mute state becomes out of sync
   5982  * between the application and device in some GSM infrastructures.
   5983  *
   5984  * "data" is null
   5985  */
   5986 #define RIL_UNSOL_RESEND_INCALL_MUTE 1030
   5987 
   5988 /**
   5989  * RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED
   5990  *
   5991  * Called when CDMA subscription source changed.
   5992  *
   5993  * "data" is int *
   5994  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
   5995  */
   5996 #define RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 1031
   5997 
   5998 /**
   5999  * RIL_UNSOL_CDMA_PRL_CHANGED
   6000  *
   6001  * Called when PRL (preferred roaming list) changes.
   6002  *
   6003  * "data" is int *
   6004  * ((int *)data)[0] is PRL_VERSION as would be returned by RIL_REQUEST_CDMA_SUBSCRIPTION
   6005  */
   6006 #define RIL_UNSOL_CDMA_PRL_CHANGED 1032
   6007 
   6008 /**
   6009  * RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE
   6010  *
   6011  * Called when Emergency Callback Mode Ends
   6012  *
   6013  * Indicates that the radio system selection module has
   6014  * proactively exited emergency callback mode.
   6015  *
   6016  * "data" is NULL
   6017  *
   6018  */
   6019 #define RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 1033
   6020 
   6021 /**
   6022  * RIL_UNSOL_RIL_CONNECTED
   6023  *
   6024  * Called the ril connects and returns the version
   6025  *
   6026  * "data" is int *
   6027  * ((int *)data)[0] is RIL_VERSION
   6028  */
   6029 #define RIL_UNSOL_RIL_CONNECTED 1034
   6030 
   6031 /**
   6032  * RIL_UNSOL_VOICE_RADIO_TECH_CHANGED
   6033  *
   6034  * Indicates that voice technology has changed. Contains new radio technology
   6035  * as a data in the message.
   6036  *
   6037  * "data" is int *
   6038  * ((int *)data)[0] is of type const RIL_RadioTechnology
   6039  *
   6040  */
   6041 #define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035
   6042 
   6043 /**
   6044  * RIL_UNSOL_CELL_INFO_LIST
   6045  *
   6046  * Same information as returned by RIL_REQUEST_GET_CELL_INFO_LIST, but returned
   6047  * at the rate no greater than specified by RIL_REQUEST_SET_UNSOL_CELL_INFO_RATE.
   6048  *
   6049  * "data" is NULL
   6050  *
   6051  * "response" is an array of RIL_CellInfo_v12.
   6052  */
   6053 #define RIL_UNSOL_CELL_INFO_LIST 1036
   6054 
   6055 /**
   6056  * RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED
   6057  *
   6058  * This message is DEPRECATED and shall be removed in a future release (target: 2018);
   6059  * instead, provide IMS registration status via an IMS Service.
   6060  *
   6061  * Called when IMS registration state has changed
   6062  *
   6063  * To get IMS registration state and IMS SMS format, callee needs to invoke the
   6064  * following request on main thread:
   6065  *
   6066  * RIL_REQUEST_IMS_REGISTRATION_STATE
   6067  *
   6068  * "data" is NULL
   6069  *
   6070  */
   6071 #define RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED 1037
   6072 
   6073 /**
   6074  * RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED
   6075  *
   6076  * Indicated when there is a change in subscription status.
   6077  * This event will be sent in the following scenarios
   6078  *  - subscription readiness at modem, which was selected by telephony layer
   6079  *  - when subscription is deactivated by modem due to UICC card removal
   6080  *  - When network invalidates the subscription i.e. attach reject due to authentication reject
   6081  *
   6082  * "data" is const int *
   6083  * ((const int *)data)[0] == 0 for Subscription Deactivated
   6084  * ((const int *)data)[0] == 1 for Subscription Activated
   6085  *
   6086  */
   6087 #define RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED 1038
   6088 
   6089 /**
   6090  * RIL_UNSOL_SRVCC_STATE_NOTIFY
   6091  *
   6092  * Called when Single Radio Voice Call Continuity(SRVCC)
   6093  * progress state has changed
   6094  *
   6095  * "data" is int *
   6096  * ((int *)data)[0] is of type const RIL_SrvccState
   6097  *
   6098  */
   6099 
   6100 #define RIL_UNSOL_SRVCC_STATE_NOTIFY 1039
   6101 
   6102 /**
   6103  * RIL_UNSOL_HARDWARE_CONFIG_CHANGED
   6104  *
   6105  * Called when the hardware configuration associated with the RILd changes
   6106  *
   6107  * "data" is an array of RIL_HardwareConfig
   6108  *
   6109  */
   6110 #define RIL_UNSOL_HARDWARE_CONFIG_CHANGED 1040
   6111 
   6112 /**
   6113  * RIL_UNSOL_DC_RT_INFO_CHANGED
   6114  *
   6115  * The message is DEPRECATED, use RIL_REQUEST_GET_ACTIVITY_INFO
   6116  * Sent when the DC_RT_STATE changes but the time
   6117  * between these messages must not be less than the
   6118  * value set by RIL_REQUEST_SET_DC_RT_RATE.
   6119  *
   6120  * "data" is the most recent RIL_DcRtInfo
   6121  *
   6122  */
   6123 #define RIL_UNSOL_DC_RT_INFO_CHANGED 1041
   6124 
   6125 /**
   6126  * RIL_UNSOL_RADIO_CAPABILITY
   6127  *
   6128  * Sent when RIL_REQUEST_SET_RADIO_CAPABILITY completes.
   6129  * Returns the phone radio capability exactly as
   6130  * RIL_REQUEST_GET_RADIO_CAPABILITY and should be the
   6131  * same set as sent by RIL_REQUEST_SET_RADIO_CAPABILITY.
   6132  *
   6133  * "data" is the RIL_RadioCapability structure
   6134  */
   6135 #define RIL_UNSOL_RADIO_CAPABILITY 1042
   6136 
   6137 /*
   6138  * RIL_UNSOL_ON_SS
   6139  *
   6140  * Called when SS response is received when DIAL/USSD/SS is changed to SS by
   6141  * call control.
   6142  *
   6143  * "data" is const RIL_StkCcUnsolSsResponse *
   6144  *
   6145  */
   6146 #define RIL_UNSOL_ON_SS 1043
   6147 
   6148 /**
   6149  * RIL_UNSOL_STK_CC_ALPHA_NOTIFY
   6150  *
   6151  * Called when there is an ALPHA from UICC during Call Control.
   6152  *
   6153  * "data" is const char * containing ALPHA string from UICC in UTF-8 format.
   6154  *
   6155  */
   6156 #define RIL_UNSOL_STK_CC_ALPHA_NOTIFY 1044
   6157 
   6158 /**
   6159  * RIL_UNSOL_LCEDATA_RECV
   6160  *
   6161  * Called when there is an incoming Link Capacity Estimate (LCE) info report.
   6162  *
   6163  * "data" is the RIL_LceDataInfo structure.
   6164  *
   6165  */
   6166 #define RIL_UNSOL_LCEDATA_RECV 1045
   6167 
   6168  /**
   6169   * RIL_UNSOL_PCO_DATA
   6170   *
   6171   * Called when there is new Carrier PCO data received for a data call.  Ideally
   6172   * only new data will be forwarded, though this is not required.  Multiple
   6173   * boxes of carrier PCO data for a given call should result in a series of
   6174   * RIL_UNSOL_PCO_DATA calls.
   6175   *
   6176   * "data" is the RIL_PCO_Data structure.
   6177   *
   6178   */
   6179 #define RIL_UNSOL_PCO_DATA 1046
   6180 
   6181  /**
   6182   * RIL_UNSOL_MODEM_RESTART
   6183   *
   6184   * Called when there is a modem reset.
   6185   *
   6186   * "reason" is "const char *" containing the reason for the reset. It
   6187   * could be a crash signature if the restart was due to a crash or some
   6188   * string such as "user-initiated restart" or "AT command initiated
   6189   * restart" that explains the cause of the modem restart.
   6190   *
   6191   * When modem restarts, one of the following radio state transitions will happen
   6192   * 1) RADIO_STATE_ON->RADIO_STATE_UNAVAILABLE->RADIO_STATE_ON or
   6193   * 2) RADIO_STATE_OFF->RADIO_STATE_UNAVAILABLE->RADIO_STATE_OFF
   6194   * This message can be sent either just before the RADIO_STATE changes to RADIO_STATE_UNAVAILABLE
   6195   * or just after but should never be sent after the RADIO_STATE changes from UNAVAILABLE to
   6196   * AVAILABLE(RADIO_STATE_ON/RADIO_STATE_OFF) again.
   6197   *
   6198   * It should NOT be sent after the RADIO_STATE changes to AVAILABLE after the
   6199   * modem restart as that could be interpreted as a second modem reset by the
   6200   * framework.
   6201   */
   6202 #define RIL_UNSOL_MODEM_RESTART 1047
   6203 
   6204 /***********************************************************************/
   6205 
   6206 
   6207 #if defined(ANDROID_MULTI_SIM)
   6208 /**
   6209  * RIL_Request Function pointer
   6210  *
   6211  * @param request is one of RIL_REQUEST_*
   6212  * @param data is pointer to data defined for that RIL_REQUEST_*
   6213  *        data is owned by caller, and should not be modified or freed by callee
   6214  *        structures passed as data may contain pointers to non-contiguous memory
   6215  * @param t should be used in subsequent call to RIL_onResponse
   6216  * @param datalen is the length of "data" which is defined as other argument. It may or may
   6217  *        not be equal to sizeof(data). Refer to the documentation of individual structures
   6218  *        to find if pointers listed in the structure are contiguous and counted in the datalen
   6219  *        length or not.
   6220  *        (Eg: RIL_IMS_SMS_Message where we don't have datalen equal to sizeof(data))
   6221  *
   6222  */
   6223 typedef void (*RIL_RequestFunc) (int request, void *data,
   6224                                     size_t datalen, RIL_Token t, RIL_SOCKET_ID socket_id);
   6225 
   6226 /**
   6227  * This function should return the current radio state synchronously
   6228  */
   6229 typedef RIL_RadioState (*RIL_RadioStateRequest)(RIL_SOCKET_ID socket_id);
   6230 
   6231 #else
   6232 /* Backward compatible */
   6233 
   6234 /**
   6235  * RIL_Request Function pointer
   6236  *
   6237  * @param request is one of RIL_REQUEST_*
   6238  * @param data is pointer to data defined for that RIL_REQUEST_*
   6239  *        data is owned by caller, and should not be modified or freed by callee
   6240  *        structures passed as data may contain pointers to non-contiguous memory
   6241  * @param t should be used in subsequent call to RIL_onResponse
   6242  * @param datalen is the length of "data" which is defined as other argument. It may or may
   6243  *        not be equal to sizeof(data). Refer to the documentation of individual structures
   6244  *        to find if pointers listed in the structure are contiguous and counted in the datalen
   6245  *        length or not.
   6246  *        (Eg: RIL_IMS_SMS_Message where we don't have datalen equal to sizeof(data))
   6247  *
   6248  */
   6249 typedef void (*RIL_RequestFunc) (int request, void *data,
   6250                                     size_t datalen, RIL_Token t);
   6251 
   6252 /**
   6253  * This function should return the current radio state synchronously
   6254  */
   6255 typedef RIL_RadioState (*RIL_RadioStateRequest)();
   6256 
   6257 #endif
   6258 
   6259 
   6260 /**
   6261  * This function returns "1" if the specified RIL_REQUEST code is
   6262  * supported and 0 if it is not
   6263  *
   6264  * @param requestCode is one of RIL_REQUEST codes
   6265  */
   6266 
   6267 typedef int (*RIL_Supports)(int requestCode);
   6268 
   6269 /**
   6270  * This function is called from a separate thread--not the
   6271  * thread that calls RIL_RequestFunc--and indicates that a pending
   6272  * request should be cancelled.
   6273  *
   6274  * On cancel, the callee should do its best to abandon the request and
   6275  * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
   6276  *
   6277  * Subsequent calls to  RIL_onRequestComplete for this request with
   6278  * other results will be tolerated but ignored. (That is, it is valid
   6279  * to ignore the cancellation request)
   6280  *
   6281  * RIL_Cancel calls should return immediately, and not wait for cancellation
   6282  *
   6283  * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007
   6284  * interface
   6285  *
   6286  * @param t token wants to be canceled
   6287  */
   6288 
   6289 typedef void (*RIL_Cancel)(RIL_Token t);
   6290 
   6291 typedef void (*RIL_TimedCallback) (void *param);
   6292 
   6293 /**
   6294  * Return a version string for your RIL implementation
   6295  */
   6296 typedef const char * (*RIL_GetVersion) (void);
   6297 
   6298 typedef struct {
   6299     int version;        /* set to RIL_VERSION */
   6300     RIL_RequestFunc onRequest;
   6301     RIL_RadioStateRequest onStateRequest;
   6302     RIL_Supports supports;
   6303     RIL_Cancel onCancel;
   6304     RIL_GetVersion getVersion;
   6305 } RIL_RadioFunctions;
   6306 
   6307 typedef struct {
   6308     char *apn;                  /* the APN to connect to */
   6309     char *protocol;             /* one of the PDP_type values in TS 27.007 section 10.1.1 used on
   6310                                    roaming network. For example, "IP", "IPV6", "IPV4V6", or "PPP".*/
   6311     int authtype;               /* authentication protocol used for this PDP context
   6312                                    (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3) */
   6313     char *username;             /* the username for APN, or NULL */
   6314     char *password;             /* the password for APN, or NULL */
   6315 } RIL_InitialAttachApn;
   6316 
   6317 typedef struct {
   6318     char *apn;                  /* the APN to connect to */
   6319     char *protocol;             /* one of the PDP_type values in TS 27.007 section 10.1.1 used on
   6320                                    home network. For example, "IP", "IPV6", "IPV4V6", or "PPP". */
   6321     char *roamingProtocol;      /* one of the PDP_type values in TS 27.007 section 10.1.1 used on
   6322                                    roaming network. For example, "IP", "IPV6", "IPV4V6", or "PPP".*/
   6323     int authtype;               /* authentication protocol used for this PDP context
   6324                                    (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3) */
   6325     char *username;             /* the username for APN, or NULL */
   6326     char *password;             /* the password for APN, or NULL */
   6327     int supportedTypesBitmask;  /* supported APN types bitmask. See RIL_ApnTypes for the value of
   6328                                    each bit. */
   6329     int bearerBitmask;          /* the bearer bitmask. See RIL_RadioAccessFamily for the value of
   6330                                    each bit. */
   6331     int modemCognitive;         /* indicating the APN setting was sent to the modem through
   6332                                    setDataProfile earlier. */
   6333     int mtu;                    /* maximum transmission unit (MTU) size in bytes */
   6334     char *mvnoType;             /* the MVNO type: possible values are "imsi", "gid", "spn" */
   6335     char *mvnoMatchData;        /* MVNO match data. Can be anything defined by the carrier.
   6336                                    For example,
   6337                                      SPN like: "A MOBILE", "BEN NL", etc...
   6338                                      IMSI like: "302720x94", "2060188", etc...
   6339                                      GID like: "4E", "33", etc... */
   6340 } RIL_InitialAttachApn_v15;
   6341 
   6342 typedef struct {
   6343     int authContext;            /* P2 value of authentication command, see P2 parameter in
   6344                                    3GPP TS 31.102 7.1.2 */
   6345     char *authData;             /* the challenge string in Base64 format, see 3GPP
   6346                                    TS 31.102 7.1.2 */
   6347     char *aid;                  /* AID value, See ETSI 102.221 8.1 and 101.220 4,
   6348                                    NULL if no value. */
   6349 } RIL_SimAuthentication;
   6350 
   6351 typedef struct {
   6352     int cid;                    /* Context ID, uniquely identifies this call */
   6353     char *bearer_proto;         /* One of the PDP_type values in TS 27.007 section 10.1.1.
   6354                                    For example, "IP", "IPV6", "IPV4V6". */
   6355     int pco_id;                 /* The protocol ID for this box.  Note that only IDs from
   6356                                    FF00H - FFFFH are accepted.  If more than one is included
   6357                                    from the network, multiple calls should be made to send all
   6358                                    of them. */
   6359     int contents_length;        /* The number of octets in the contents. */
   6360     char *contents;             /* Carrier-defined content.  It is binary, opaque and
   6361                                    loosely defined in LTE Layer 3 spec 24.008 */
   6362 } RIL_PCO_Data;
   6363 
   6364 #ifdef RIL_SHLIB
   6365 struct RIL_Env {
   6366     /**
   6367      * "t" is parameter passed in on previous call to RIL_Notification
   6368      * routine.
   6369      *
   6370      * If "e" != SUCCESS, then response can be null/is ignored
   6371      *
   6372      * "response" is owned by caller, and should not be modified or
   6373      * freed by callee
   6374      *
   6375      * RIL_onRequestComplete will return as soon as possible
   6376      */
   6377     void (*OnRequestComplete)(RIL_Token t, RIL_Errno e,
   6378                            void *response, size_t responselen);
   6379 
   6380 #if defined(ANDROID_MULTI_SIM)
   6381     /**
   6382      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
   6383      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
   6384      *
   6385      * "data" is owned by caller, and should not be modified or freed by callee
   6386      */
   6387     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen, RIL_SOCKET_ID socket_id);
   6388 #else
   6389     /**
   6390      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
   6391      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
   6392      *
   6393      * "data" is owned by caller, and should not be modified or freed by callee
   6394      */
   6395     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen);
   6396 #endif
   6397     /**
   6398      * Call user-specifed "callback" function on on the same thread that
   6399      * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
   6400      * a relative time value at which the callback is invoked. If relativeTime is
   6401      * NULL or points to a 0-filled structure, the callback will be invoked as
   6402      * soon as possible
   6403      */
   6404 
   6405     void (*RequestTimedCallback) (RIL_TimedCallback callback,
   6406                                    void *param, const struct timeval *relativeTime);
   6407    /**
   6408     * "t" is parameter passed in on previous call RIL_Notification routine
   6409     *
   6410     * RIL_onRequestAck will be called by vendor when an Async RIL request was received
   6411     * by them and an ack needs to be sent back to java ril.
   6412     */
   6413     void (*OnRequestAck) (RIL_Token t);
   6414 };
   6415 
   6416 
   6417 /**
   6418  *  RIL implementations must defined RIL_Init
   6419  *  argc and argv will be command line arguments intended for the RIL implementation
   6420  *  Return NULL on error
   6421  *
   6422  * @param env is environment point defined as RIL_Env
   6423  * @param argc number of arguments
   6424  * @param argv list fo arguments
   6425  *
   6426  */
   6427 const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
   6428 
   6429 /**
   6430  *  If BT SAP(SIM Access Profile) is supported, then RIL implementations must define RIL_SAP_Init
   6431  *  for initializing RIL_RadioFunctions used for BT SAP communcations. It is called whenever RILD
   6432  *  starts or modem restarts. Returns handlers for SAP related request that are made on SAP
   6433  *  sepecific socket, analogous to the RIL_RadioFunctions returned by the call to RIL_Init
   6434  *  and used on the general RIL socket.
   6435  *  argc and argv will be command line arguments intended for the RIL implementation
   6436  *  Return NULL on error.
   6437  *
   6438  * @param env is environment point defined as RIL_Env
   6439  * @param argc number of arguments
   6440  * @param argv list fo arguments
   6441  *
   6442  */
   6443 const RIL_RadioFunctions *RIL_SAP_Init(const struct RIL_Env *env, int argc, char **argv);
   6444 
   6445 #else /* RIL_SHLIB */
   6446 
   6447 /**
   6448  * Call this once at startup to register notification routine
   6449  *
   6450  * @param callbacks user-specifed callback function
   6451  */
   6452 void RIL_register (const RIL_RadioFunctions *callbacks);
   6453 
   6454 void rilc_thread_pool();
   6455 
   6456 
   6457 /**
   6458  *
   6459  * RIL_onRequestComplete will return as soon as possible
   6460  *
   6461  * @param t is parameter passed in on previous call to RIL_Notification
   6462  *          routine.
   6463  * @param e error code
   6464  *          if "e" != SUCCESS, then response can be null/is ignored
   6465  * @param response is owned by caller, and should not be modified or
   6466  *                 freed by callee
   6467  * @param responselen the length of response in byte
   6468  */
   6469 void RIL_onRequestComplete(RIL_Token t, RIL_Errno e,
   6470                            void *response, size_t responselen);
   6471 
   6472 /**
   6473  * RIL_onRequestAck will be called by vendor when an Async RIL request was received by them and
   6474  * an ack needs to be sent back to java ril. This doesn't mark the end of the command or it's
   6475  * results, just that the command was received and will take a while. After sending this Ack
   6476  * its vendor's responsibility to make sure that AP is up whenever needed while command is
   6477  * being processed.
   6478  *
   6479  * @param t is parameter passed in on previous call to RIL_Notification
   6480  *          routine.
   6481  */
   6482 void RIL_onRequestAck(RIL_Token t);
   6483 
   6484 #if defined(ANDROID_MULTI_SIM)
   6485 /**
   6486  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
   6487  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
   6488  *     "data" is owned by caller, and should not be modified or freed by callee
   6489  * @param datalen the length of data in byte
   6490  */
   6491 
   6492 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
   6493                                 size_t datalen, RIL_SOCKET_ID socket_id);
   6494 #else
   6495 /**
   6496  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
   6497  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
   6498  *     "data" is owned by caller, and should not be modified or freed by callee
   6499  * @param datalen the length of data in byte
   6500  */
   6501 
   6502 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
   6503                                 size_t datalen);
   6504 #endif
   6505 
   6506 /**
   6507  * Call user-specifed "callback" function on on the same thread that
   6508  * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
   6509  * a relative time value at which the callback is invoked. If relativeTime is
   6510  * NULL or points to a 0-filled structure, the callback will be invoked as
   6511  * soon as possible
   6512  *
   6513  * @param callback user-specifed callback function
   6514  * @param param parameter list
   6515  * @param relativeTime a relative time value at which the callback is invoked
   6516  */
   6517 
   6518 void RIL_requestTimedCallback (RIL_TimedCallback callback,
   6519                                void *param, const struct timeval *relativeTime);
   6520 
   6521 #endif /* RIL_SHLIB */
   6522 
   6523 #ifdef __cplusplus
   6524 }
   6525 #endif
   6526 
   6527 #endif /*ANDROID_RIL_H*/
   6528