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