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