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