OSDN Git Service

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