• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef FEATURE_UNIT_TEST
22 #include <sys/time.h>
23 #endif /* !FEATURE_UNIT_TEST */
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #define RIL_VERSION 7     /* Current version */
30 #define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */
31 
32 #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
33 #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
34 
35 typedef void * RIL_Token;
36 
37 typedef enum {
38     RIL_E_SUCCESS = 0,
39     RIL_E_RADIO_NOT_AVAILABLE = 1,     /* If radio did not start or is resetting */
40     RIL_E_GENERIC_FAILURE = 2,
41     RIL_E_PASSWORD_INCORRECT = 3,      /* for PIN/PIN2 methods only! */
42     RIL_E_SIM_PIN2 = 4,                /* Operation requires SIM PIN2 to be entered */
43     RIL_E_SIM_PUK2 = 5,                /* Operation requires SIM PIN2 to be entered */
44     RIL_E_REQUEST_NOT_SUPPORTED = 6,
45     RIL_E_CANCELLED = 7,
46     RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
47                                                    call on a Class C GPRS device */
48     RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  /* data ops are not allowed before device
49                                                    registers in network */
50     RIL_E_SMS_SEND_FAIL_RETRY = 10,             /* fail to send sms and need retry */
51     RIL_E_SIM_ABSENT = 11,                      /* fail to set the location where CDMA subscription
52                                                    shall be retrieved because of SIM or RUIM
53                                                    card absent */
54     RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12,      /* fail to find CDMA subscription from specified
55                                                    location */
56     RIL_E_MODE_NOT_SUPPORTED = 13,              /* HW does not support preferred network type */
57     RIL_E_FDN_CHECK_FAILURE = 14,               /* command failed because recipient is not on FDN list */
58     RIL_E_ILLEGAL_SIM_OR_ME = 15                /* network selection failed due to
59                                                    illegal SIM or ME */
60 } RIL_Errno;
61 
62 typedef enum {
63     RIL_CALL_ACTIVE = 0,
64     RIL_CALL_HOLDING = 1,
65     RIL_CALL_DIALING = 2,    /* MO call only */
66     RIL_CALL_ALERTING = 3,   /* MO call only */
67     RIL_CALL_INCOMING = 4,   /* MT call only */
68     RIL_CALL_WAITING = 5     /* MT call only */
69 } RIL_CallState;
70 
71 typedef enum {
72     RADIO_STATE_OFF = 0,                   /* Radio explictly powered off (eg CFUN=0) */
73     RADIO_STATE_UNAVAILABLE = 1,           /* Radio unavailable (eg, resetting or not booted) */
74     /* States 2-9 below are deprecated. Just leaving them here for backward compatibility. */
75     RADIO_STATE_SIM_NOT_READY = 2,         /* Radio is on, but the SIM interface is not ready */
76     RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3,  /* SIM PIN locked, PUK required, network
77                                               personalization locked, or SIM absent */
78     RADIO_STATE_SIM_READY = 4,             /* Radio is on and SIM interface is available */
79     RADIO_STATE_RUIM_NOT_READY = 5,        /* Radio is on, but the RUIM interface is not ready */
80     RADIO_STATE_RUIM_READY = 6,            /* Radio is on and the RUIM interface is available */
81     RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network
82                                               personalization locked, or RUIM absent */
83     RADIO_STATE_NV_NOT_READY = 8,          /* Radio is on, but the NV interface is not available */
84     RADIO_STATE_NV_READY = 9,              /* Radio is on and the NV interface is available */
85     RADIO_STATE_ON = 10                    /* Radio is on */
86 } RIL_RadioState;
87 
88 typedef enum {
89     RADIO_TECH_UNKNOWN = 0,
90     RADIO_TECH_GPRS = 1,
91     RADIO_TECH_EDGE = 2,
92     RADIO_TECH_UMTS = 3,
93     RADIO_TECH_IS95A = 4,
94     RADIO_TECH_IS95B = 5,
95     RADIO_TECH_1xRTT =  6,
96     RADIO_TECH_EVDO_0 = 7,
97     RADIO_TECH_EVDO_A = 8,
98     RADIO_TECH_HSDPA = 9,
99     RADIO_TECH_HSUPA = 10,
100     RADIO_TECH_HSPA = 11,
101     RADIO_TECH_EVDO_B = 12,
102     RADIO_TECH_EHRPD = 13,
103     RADIO_TECH_LTE = 14,
104     RADIO_TECH_HSPAP = 15, // HSPA+
105     RADIO_TECH_GSM = 16 // Only supports voice
106 } RIL_RadioTechnology;
107 
108 // Do we want to split Data from Voice and the use
109 // RIL_RadioTechnology for get/setPreferredVoice/Data ?
110 typedef enum {
111     PREF_NET_TYPE_GSM_WCDMA                = 0, /* GSM/WCDMA (WCDMA preferred) */
112     PREF_NET_TYPE_GSM_ONLY                 = 1, /* GSM only */
113     PREF_NET_TYPE_WCDMA                    = 2, /* WCDMA  */
114     PREF_NET_TYPE_GSM_WCDMA_AUTO           = 3, /* GSM/WCDMA (auto mode, according to PRL) */
115     PREF_NET_TYPE_CDMA_EVDO_AUTO           = 4, /* CDMA and EvDo (auto mode, according to PRL) */
116     PREF_NET_TYPE_CDMA_ONLY                = 5, /* CDMA only */
117     PREF_NET_TYPE_EVDO_ONLY                = 6, /* EvDo only */
118     PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */
119     PREF_NET_TYPE_LTE_CDMA_EVDO            = 8, /* LTE, CDMA and EvDo */
120     PREF_NET_TYPE_LTE_GSM_WCDMA            = 9, /* LTE, GSM/WCDMA */
121     PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA  = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */
122     PREF_NET_TYPE_LTE_ONLY                 = 11  /* LTE only */
123 } RIL_PreferredNetworkType;
124 
125 /* Source for cdma subscription */
126 typedef enum {
127    CDMA_SUBSCRIPTION_SOURCE_RUIM_SIM = 0,
128    CDMA_SUBSCRIPTION_SOURCE_NV = 1
129 } RIL_CdmaSubscriptionSource;
130 
131 /* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
132 typedef enum {
133     RIL_UUS_TYPE1_IMPLICIT = 0,
134     RIL_UUS_TYPE1_REQUIRED = 1,
135     RIL_UUS_TYPE1_NOT_REQUIRED = 2,
136     RIL_UUS_TYPE2_REQUIRED = 3,
137     RIL_UUS_TYPE2_NOT_REQUIRED = 4,
138     RIL_UUS_TYPE3_REQUIRED = 5,
139     RIL_UUS_TYPE3_NOT_REQUIRED = 6
140 } RIL_UUS_Type;
141 
142 /* User-to-User Signaling Information data coding schemes. Possible values for
143  * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
144  * specified in section 10.5.4.25 of 3GPP TS 24.008 */
145 typedef enum {
146     RIL_UUS_DCS_USP = 0,          /* User specified protocol */
147     RIL_UUS_DCS_OSIHLP = 1,       /* OSI higher layer protocol */
148     RIL_UUS_DCS_X244 = 2,         /* X.244 */
149     RIL_UUS_DCS_RMCF = 3,         /* Reserved for system mangement
150                                      convergence function */
151     RIL_UUS_DCS_IA5c = 4          /* IA5 characters */
152 } RIL_UUS_DCS;
153 
154 /* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
155  * This data is passed in RIL_ExtensionRecord and rec contains this
156  * structure when type is RIL_UUS_INFO_EXT_REC */
157 typedef struct {
158   RIL_UUS_Type    uusType;    /* UUS Type */
159   RIL_UUS_DCS     uusDcs;     /* UUS Data Coding Scheme */
160   int             uusLength;  /* Length of UUS Data */
161   char *          uusData;    /* UUS Data */
162 } RIL_UUS_Info;
163 
164 /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
165 typedef struct {
166   char isPresent;    /* non-zero if signal information record is present */
167   char signalType;   /* as defined 3.7.5.5-1 */
168   char alertPitch;   /* as defined 3.7.5.5-2 */
169   char signal;       /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */
170 } RIL_CDMA_SignalInfoRecord;
171 
172 typedef struct {
173     RIL_CallState   state;
174     int             index;      /* Connection Index for use with, eg, AT+CHLD */
175     int             toa;        /* type of address, eg 145 = intl */
176     char            isMpty;     /* nonzero if is mpty call */
177     char            isMT;       /* nonzero if call is mobile terminated */
178     char            als;        /* ALS line indicator if available
179                                    (0 = line 1) */
180     char            isVoice;    /* nonzero if this is is a voice call */
181     char            isVoicePrivacy;     /* nonzero if CDMA voice privacy mode is active */
182     char *          number;     /* Remote party number */
183     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
184     char *          name;       /* Remote party name */
185     int             namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
186     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
187 } RIL_Call;
188 
189 /* Deprecated, use RIL_Data_Call_Response_v6 */
190 typedef struct {
191     int             cid;        /* Context ID, uniquely identifies this call */
192     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
193     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
194                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". */
195     char *          apn;        /* ignored */
196     char *          address;    /* An address, e.g., "192.0.1.3" or "2001:db8::1". */
197 } RIL_Data_Call_Response_v4;
198 
199 /*
200  * Returned by RIL_REQUEST_SETUP_DATA_CALL, RIL_REQUEST_DATA_CALL_LIST
201  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED, on error status != 0.
202  */
203 typedef struct {
204     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
205     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
206                                            back-off timer value RIL wants to override the one
207                                            pre-configured in FW.
208                                            The unit is miliseconds.
209                                            The value < 0 means no value is suggested.
210                                            The value 0 means retry should be done ASAP.
211                                            The value of MAX_INT(0x7fffffff) means no retry. */
212     int             cid;        /* Context ID, uniquely identifies this call */
213     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
214     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
215                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
216                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
217                                    such as "IP" or "IPV6" */
218     char *          ifname;     /* The network interface name */
219     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
220                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
221                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
222                                    one of each. If the prefix length is absent the addresses
223                                    are assumed to be point to point with IPv4 having a prefix
224                                    length of 32 and IPv6 128. */
225     char *          dnses;      /* A space-delimited list of DNS server addresses,
226                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
227                                    May be empty. */
228     char *          gateways;   /* A space-delimited list of default gateway addresses,
229                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
230                                    May be empty in which case the addresses represent point
231                                    to point connections. */
232 } RIL_Data_Call_Response_v6;
233 
234 typedef struct {
235     int messageRef;   /* TP-Message-Reference for GSM,
236                          and BearerData MessageId for CDMA
237                          (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
238     char *ackPDU;     /* or NULL if n/a */
239     int errorCode;    /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
240                          3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
241                          -1 if unknown or not applicable*/
242 } RIL_SMS_Response;
243 
244 /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
245 typedef struct {
246     int status;     /* Status of message.  See TS 27.005 3.1, "<stat>": */
247                     /*      0 = "REC UNREAD"    */
248                     /*      1 = "REC READ"      */
249                     /*      2 = "STO UNSENT"    */
250                     /*      3 = "STO SENT"      */
251     char * pdu;     /* PDU of message to write, as an ASCII hex string less the SMSC address,
252                        the TP-layer length is "strlen(pdu)/2". */
253     char * smsc;    /* SMSC address in GSM BCD format prefixed by a length byte
254                        (as expected by TS 27.005) or NULL for default SMSC */
255 } RIL_SMS_WriteArgs;
256 
257 /** Used by RIL_REQUEST_DIAL */
258 typedef struct {
259     char * address;
260     int clir;
261             /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
262              * clir == 0 on "use subscription default value"
263              * clir == 1 on "CLIR invocation" (restrict CLI presentation)
264              * clir == 2 on "CLIR suppression" (allow CLI presentation)
265              */
266     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
267 } RIL_Dial;
268 
269 typedef struct {
270     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
271     int fileid;     /* EF id */
272     char *path;     /* "pathid" from TS 27.007 +CRSM command.
273                        Path is in hex asciii format eg "7f205f70"
274                        Path must always be provided.
275                      */
276     int p1;
277     int p2;
278     int p3;
279     char *data;     /* May be NULL*/
280     char *pin2;     /* May be NULL*/
281 } RIL_SIM_IO_v5;
282 
283 typedef struct {
284     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
285     int fileid;     /* EF id */
286     char *path;     /* "pathid" from TS 27.007 +CRSM command.
287                        Path is in hex asciii format eg "7f205f70"
288                        Path must always be provided.
289                      */
290     int p1;
291     int p2;
292     int p3;
293     char *data;     /* May be NULL*/
294     char *pin2;     /* May be NULL*/
295     char *aidPtr;   /* AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. */
296 } RIL_SIM_IO_v6;
297 
298 typedef struct {
299     int sw1;
300     int sw2;
301     char *simResponse;  /* In hex string format ([a-fA-F0-9]*). */
302 } RIL_SIM_IO_Response;
303 
304 /* See also com.android.internal.telephony.gsm.CallForwardInfo */
305 
306 typedef struct {
307     int             status;     /*
308                                  * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
309                                  * status 1 = active, 0 = not active
310                                  *
311                                  * For RIL_REQUEST_SET_CALL_FORWARD:
312                                  * status is:
313                                  * 0 = disable
314                                  * 1 = enable
315                                  * 2 = interrogate
316                                  * 3 = registeration
317                                  * 4 = erasure
318                                  */
319 
320     int             reason;      /* from TS 27.007 7.11 "reason" */
321     int             serviceClass;/* From 27.007 +CCFC/+CLCK "class"
322                                     See table for Android mapping from
323                                     MMI service code
324                                     0 means user doesn't input class */
325     int             toa;         /* "type" from TS 27.007 7.11 */
326     char *          number;      /* "number" from TS 27.007 7.11. May be NULL */
327     int             timeSeconds; /* for CF no reply only */
328 }RIL_CallForwardInfo;
329 
330 typedef struct {
331    char * cid;         /* Combination of LAC and Cell Id in 32 bits in GSM.
332                         * Upper 16 bits is LAC and lower 16 bits
333                         * is CID (as described in TS 27.005)
334                         * Primary Scrambling Code (as described in TS 25.331)
335                         *         in 9 bits in UMTS
336                         * Valid values are hexadecimal 0x0000 - 0xffffffff.
337                         */
338    int    rssi;        /* Received RSSI in GSM,
339                         * Level index of CPICH Received Signal Code Power in UMTS
340                         */
341 } RIL_NeighboringCell;
342 
343 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
344 typedef enum {
345     CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
346     CALL_FAIL_NORMAL = 16,
347     CALL_FAIL_BUSY = 17,
348     CALL_FAIL_CONGESTION = 34,
349     CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
350     CALL_FAIL_CALL_BARRED = 240,
351     CALL_FAIL_FDN_BLOCKED = 241,
352     CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
353     CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
354     CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
355     CALL_FAIL_CDMA_DROP = 1001,
356     CALL_FAIL_CDMA_INTERCEPT = 1002,
357     CALL_FAIL_CDMA_REORDER = 1003,
358     CALL_FAIL_CDMA_SO_REJECT = 1004,
359     CALL_FAIL_CDMA_RETRY_ORDER = 1005,
360     CALL_FAIL_CDMA_ACCESS_FAILURE = 1006,
361     CALL_FAIL_CDMA_PREEMPTED = 1007,
362     CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
363                                             during emergency callback mode */
364     CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
365     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
366 } RIL_LastCallFailCause;
367 
368 /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
369 typedef enum {
370     PDP_FAIL_NONE = 0, /* No error, connection ok */
371 
372     /* an integer cause code defined in TS 24.008
373        section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B.
374        If the implementation does not have access to the exact cause codes,
375        then it should return one of the following values,
376        as the UI layer needs to distinguish these
377        cases for error notification and potential retries. */
378     PDP_FAIL_OPERATOR_BARRED = 0x08,               /* no retry */
379     PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A,
380     PDP_FAIL_MISSING_UKNOWN_APN = 0x1B,            /* no retry */
381     PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C,      /* no retry */
382     PDP_FAIL_USER_AUTHENTICATION = 0x1D,           /* no retry */
383     PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E,        /* no retry */
384     PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
385     PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20,  /* no retry */
386     PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */
387     PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
388     PDP_FAIL_NSAPI_IN_USE = 0x23,                  /* no retry */
389     PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32,             /* no retry */
390     PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33,             /* no retry */
391     PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
392     PDP_FAIL_PROTOCOL_ERRORS   = 0x6F,             /* no retry */
393 
394     /* Not mentioned in the specification */
395     PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
396     PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
397 
398    /* reasons for data call drop - network/modem disconnect */
399     PDP_FAIL_SIGNAL_LOST = -3,            /* no retry */
400     PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry
401                                              with parameters appropriate for new technology */
402     PDP_FAIL_RADIO_POWER_OFF = -5,        /* data call was disconnected because radio was resetting,
403                                              powered off - no retry */
404     PDP_FAIL_TETHERED_CALL_ACTIVE = -6,   /* data call was disconnected by modem because tethered
405                                              mode was up on same APN/data profile - no retry until
406                                              tethered call is off */
407 
408     PDP_FAIL_ERROR_UNSPECIFIED = 0xffff,  /* retry silently */
409 } RIL_DataCallFailCause;
410 
411 /* See RIL_REQUEST_SETUP_DATA_CALL */
412 typedef enum {
413     RIL_DATA_PROFILE_DEFAULT    = 0,
414     RIL_DATA_PROFILE_TETHERED   = 1,
415     RIL_DATA_PROFILE_OEM_BASE   = 1000    /* Start of OEM-specific profiles */
416 } RIL_DataProfile;
417 
418 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
419 typedef struct {
420     int     notificationType;   /*
421                                  * 0 = MO intermediate result code
422                                  * 1 = MT unsolicited result code
423                                  */
424     int     code;               /* See 27.007 7.17
425                                    "code1" for MO
426                                    "code2" for MT. */
427     int     index;              /* CUG index. See 27.007 7.17. */
428     int     type;               /* "type" from 27.007 7.17 (MT only). */
429     char *  number;             /* "number" from 27.007 7.17
430                                    (MT only, may be NULL). */
431 } RIL_SuppSvcNotification;
432 
433 #define RIL_CARD_MAX_APPS     8
434 
435 typedef enum {
436     RIL_CARDSTATE_ABSENT   = 0,
437     RIL_CARDSTATE_PRESENT  = 1,
438     RIL_CARDSTATE_ERROR    = 2
439 } RIL_CardState;
440 
441 typedef enum {
442     RIL_PERSOSUBSTATE_UNKNOWN                   = 0, /* initial state */
443     RIL_PERSOSUBSTATE_IN_PROGRESS               = 1, /* in between each lock transition */
444     RIL_PERSOSUBSTATE_READY                     = 2, /* when either SIM or RUIM Perso is finished
445                                                         since each app can only have 1 active perso
446                                                         involved */
447     RIL_PERSOSUBSTATE_SIM_NETWORK               = 3,
448     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET        = 4,
449     RIL_PERSOSUBSTATE_SIM_CORPORATE             = 5,
450     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER      = 6,
451     RIL_PERSOSUBSTATE_SIM_SIM                   = 7,
452     RIL_PERSOSUBSTATE_SIM_NETWORK_PUK           = 8, /* The corresponding perso lock is blocked */
453     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK    = 9,
454     RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK         = 10,
455     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK  = 11,
456     RIL_PERSOSUBSTATE_SIM_SIM_PUK               = 12,
457     RIL_PERSOSUBSTATE_RUIM_NETWORK1             = 13,
458     RIL_PERSOSUBSTATE_RUIM_NETWORK2             = 14,
459     RIL_PERSOSUBSTATE_RUIM_HRPD                 = 15,
460     RIL_PERSOSUBSTATE_RUIM_CORPORATE            = 16,
461     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER     = 17,
462     RIL_PERSOSUBSTATE_RUIM_RUIM                 = 18,
463     RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK         = 19, /* The corresponding perso lock is blocked */
464     RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK         = 20,
465     RIL_PERSOSUBSTATE_RUIM_HRPD_PUK             = 21,
466     RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK        = 22,
467     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
468     RIL_PERSOSUBSTATE_RUIM_RUIM_PUK             = 24
469 } RIL_PersoSubstate;
470 
471 typedef enum {
472     RIL_APPSTATE_UNKNOWN               = 0,
473     RIL_APPSTATE_DETECTED              = 1,
474     RIL_APPSTATE_PIN                   = 2, /* If PIN1 or UPin is required */
475     RIL_APPSTATE_PUK                   = 3, /* If PUK1 or Puk for UPin is required */
476     RIL_APPSTATE_SUBSCRIPTION_PERSO    = 4, /* perso_substate should be look at
477                                                when app_state is assigned to this value */
478     RIL_APPSTATE_READY                 = 5
479 } RIL_AppState;
480 
481 typedef enum {
482     RIL_PINSTATE_UNKNOWN              = 0,
483     RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
484     RIL_PINSTATE_ENABLED_VERIFIED     = 2,
485     RIL_PINSTATE_DISABLED             = 3,
486     RIL_PINSTATE_ENABLED_BLOCKED      = 4,
487     RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
488 } RIL_PinState;
489 
490 typedef enum {
491   RIL_APPTYPE_UNKNOWN = 0,
492   RIL_APPTYPE_SIM     = 1,
493   RIL_APPTYPE_USIM    = 2,
494   RIL_APPTYPE_RUIM    = 3,
495   RIL_APPTYPE_CSIM    = 4,
496   RIL_APPTYPE_ISIM    = 5
497 } RIL_AppType;
498 
499 typedef struct
500 {
501   RIL_AppType      app_type;
502   RIL_AppState     app_state;
503   RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
504                                        RIL_APPSTATE_SUBSCRIPTION_PERSO */
505   char             *aid_ptr;        /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
506                                        0x30, 0x30, 0x30 */
507   char             *app_label_ptr;  /* null terminated string */
508   int              pin1_replaced;   /* applicable to USIM, CSIM & ISIM */
509   RIL_PinState     pin1;
510   RIL_PinState     pin2;
511 } RIL_AppStatus;
512 
513 /* Deprecated, use RIL_CardStatus_v6 */
514 typedef struct
515 {
516   RIL_CardState card_state;
517   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
518   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
519   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
520   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
521   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
522 } RIL_CardStatus_v5;
523 
524 typedef struct
525 {
526   RIL_CardState card_state;
527   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
528   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
529   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
530   int           ims_subscription_app_index;      /* value < RIL_CARD_MAX_APPS, -1 if none */
531   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
532   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
533 } RIL_CardStatus_v6;
534 
535 /** The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH
536  *      or as part of RIL_SimRefreshResponse_v7
537  */
538 typedef enum {
539     /* A file on SIM has been updated.  data[1] contains the EFID. */
540     SIM_FILE_UPDATE = 0,
541     /* SIM initialized.  All files should be re-read. */
542     SIM_INIT = 1,
543     /* SIM reset.  SIM power required, SIM may be locked and all files should be re-read. */
544     SIM_RESET = 2
545 } RIL_SimRefreshResult;
546 
547 typedef struct {
548     RIL_SimRefreshResult result;
549     int                  ef_id; /* is the EFID of the updated file if the result is */
550                                 /* SIM_FILE_UPDATE or 0 for any other result. */
551     char *               aid;   /* is AID(application ID) of the card application */
552                                 /* See ETSI 102.221 8.1 and 101.220 4 */
553                                 /*     For SIM_FILE_UPDATE result it can be set to AID of */
554                                 /*         application in which updated EF resides or it can be */
555                                 /*         NULL if EF is outside of an application. */
556                                 /*     For SIM_INIT result this field is set to AID of */
557                                 /*         application that caused REFRESH */
558                                 /*     For SIM_RESET result it is NULL. */
559 } RIL_SimRefreshResponse_v7;
560 
561 /* Deprecated, use RIL_CDMA_CallWaiting_v6 */
562 typedef struct {
563     char *          number;             /* Remote party number */
564     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
565     char *          name;               /* Remote party name */
566     RIL_CDMA_SignalInfoRecord signalInfoRecord;
567 } RIL_CDMA_CallWaiting_v5;
568 
569 typedef struct {
570     char *          number;             /* Remote party number */
571     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
572     char *          name;               /* Remote party name */
573     RIL_CDMA_SignalInfoRecord signalInfoRecord;
574     /* Number type/Number plan required to support International Call Waiting */
575     int             number_type;        /* 0=Unknown, 1=International, 2=National,
576                                            3=Network specific, 4=subscriber */
577     int             number_plan;        /* 0=Unknown, 1=ISDN, 3=Data, 4=Telex, 8=Nat'l, 9=Private */
578 } RIL_CDMA_CallWaiting_v6;
579 
580 /**
581  * Which types of Cell Broadcast Message (CBM) are to be received by the ME
582  *
583  * uFromServiceID - uToServiceID defines a range of CBM message identifiers
584  * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
585  * and 9.4.4.2.2 for UMTS. All other values can be treated as empty
586  * CBM message ID.
587  *
588  * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
589  * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
590  * and 9.4.4.2.3 for UMTS.
591  * All other values can be treated as empty CBM data coding scheme.
592  *
593  * selected 0 means message types specified in <fromServiceId, toServiceId>
594  * and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted.
595  *
596  * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and
597  * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG.
598  */
599 typedef struct {
600     int fromServiceId;
601     int toServiceId;
602     int fromCodeScheme;
603     int toCodeScheme;
604     unsigned char selected;
605 } RIL_GSM_BroadcastSmsConfigInfo;
606 
607 /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
608 #define RIL_RESTRICTED_STATE_NONE           0x00
609 /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
610 #define RIL_RESTRICTED_STATE_CS_EMERGENCY   0x01
611 /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
612 #define RIL_RESTRICTED_STATE_CS_NORMAL      0x02
613 /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
614 #define RIL_RESTRICTED_STATE_CS_ALL         0x04
615 /* Block packet data access due to restriction. */
616 #define RIL_RESTRICTED_STATE_PS_ALL         0x10
617 
618 /* The status for an OTASP/OTAPA session */
619 typedef enum {
620     CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED,
621     CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED,
622     CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED,
623     CDMA_OTA_PROVISION_STATUS_SSD_UPDATED,
624     CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED,
625     CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED,
626     CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED,
627     CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED,
628     CDMA_OTA_PROVISION_STATUS_COMMITTED,
629     CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED,
630     CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED,
631     CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED
632 } RIL_CDMA_OTA_ProvisionStatus;
633 
634 typedef struct {
635     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
636     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
637 } RIL_GW_SignalStrength;
638 
639 
640 typedef struct {
641     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
642                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
643                * value will be 75.
644                */
645     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
646                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
647                * will be 125.
648                */
649 } RIL_CDMA_SignalStrength;
650 
651 
652 typedef struct {
653     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
654                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
655                * value will be 75.
656                */
657     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
658                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
659                * will be 125.
660                */
661     int signalNoiseRatio; /* Valid values are 0-8.  8 is the highest signal to noise ratio. */
662 } RIL_EVDO_SignalStrength;
663 
664 typedef struct {
665     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
666     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
667                           * Range: 44 to 140 dBm
668                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
669                           * Reference: 3GPP TS 36.133 9.1.4 */
670     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
671                           * Range: 20 to 3 dB.
672                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
673                           * Reference: 3GPP TS 36.133 9.1.7 */
674     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
675                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
676                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
677                           * Reference: 3GPP TS 36.101 8.1.1 */
678     int cqi;             /* The current Channel Quality Indicator.
679                           * Range: 0 to 15.
680                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
681                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
682 } RIL_LTE_SignalStrength;
683 
684 /* Deprecated, use RIL_SignalStrength_v6 */
685 typedef struct {
686     RIL_GW_SignalStrength   GW_SignalStrength;
687     RIL_CDMA_SignalStrength CDMA_SignalStrength;
688     RIL_EVDO_SignalStrength EVDO_SignalStrength;
689 } RIL_SignalStrength_v5;
690 
691 typedef struct {
692     RIL_GW_SignalStrength   GW_SignalStrength;
693     RIL_CDMA_SignalStrength CDMA_SignalStrength;
694     RIL_EVDO_SignalStrength EVDO_SignalStrength;
695     RIL_LTE_SignalStrength  LTE_SignalStrength;
696 } RIL_SignalStrength_v6;
697 
698 /* Names of the CDMA info records (C.S0005 section 3.7.5) */
699 typedef enum {
700   RIL_CDMA_DISPLAY_INFO_REC,
701   RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC,
702   RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC,
703   RIL_CDMA_CONNECTED_NUMBER_INFO_REC,
704   RIL_CDMA_SIGNAL_INFO_REC,
705   RIL_CDMA_REDIRECTING_NUMBER_INFO_REC,
706   RIL_CDMA_LINE_CONTROL_INFO_REC,
707   RIL_CDMA_EXTENDED_DISPLAY_INFO_REC,
708   RIL_CDMA_T53_CLIR_INFO_REC,
709   RIL_CDMA_T53_RELEASE_INFO_REC,
710   RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC
711 } RIL_CDMA_InfoRecName;
712 
713 /* Display Info Rec as defined in C.S0005 section 3.7.5.1
714    Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
715    Note: the Extended Display info rec contains multiple records of the
716    form: display_tag, display_len, and display_len occurrences of the
717    chari field if the display_tag is not 10000000 or 10000001.
718    To save space, the records are stored consecutively in a byte buffer.
719    The display_tag, display_len and chari fields are all 1 byte.
720 */
721 
722 typedef struct {
723   char alpha_len;
724   char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH];
725 } RIL_CDMA_DisplayInfoRecord;
726 
727 /* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
728    Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
729    Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
730 */
731 
732 typedef struct {
733   char len;
734   char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH];
735   char number_type;
736   char number_plan;
737   char pi;
738   char si;
739 } RIL_CDMA_NumberInfoRecord;
740 
741 /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
742 typedef enum {
743   RIL_REDIRECTING_REASON_UNKNOWN = 0,
744   RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1,
745   RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2,
746   RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9,
747   RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
748   RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15,
749   RIL_REDIRECTING_REASON_RESERVED
750 } RIL_CDMA_RedirectingReason;
751 
752 typedef struct {
753   RIL_CDMA_NumberInfoRecord redirectingNumber;
754   /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */
755   RIL_CDMA_RedirectingReason redirectingReason;
756 } RIL_CDMA_RedirectingNumberInfoRecord;
757 
758 /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
759 typedef struct {
760   char lineCtrlPolarityIncluded;
761   char lineCtrlToggle;
762   char lineCtrlReverse;
763   char lineCtrlPowerDenial;
764 } RIL_CDMA_LineControlInfoRecord;
765 
766 /* T53 CLIR Information Record */
767 typedef struct {
768   char cause;
769 } RIL_CDMA_T53_CLIRInfoRecord;
770 
771 /* T53 Audio Control Information Record */
772 typedef struct {
773   char upLink;
774   char downLink;
775 } RIL_CDMA_T53_AudioControlInfoRecord;
776 
777 typedef struct {
778 
779   RIL_CDMA_InfoRecName name;
780 
781   union {
782     /* Display and Extended Display Info Rec */
783     RIL_CDMA_DisplayInfoRecord           display;
784 
785     /* Called Party Number, Calling Party Number, Connected Number Info Rec */
786     RIL_CDMA_NumberInfoRecord            number;
787 
788     /* Signal Info Rec */
789     RIL_CDMA_SignalInfoRecord            signal;
790 
791     /* Redirecting Number Info Rec */
792     RIL_CDMA_RedirectingNumberInfoRecord redir;
793 
794     /* Line Control Info Rec */
795     RIL_CDMA_LineControlInfoRecord       lineCtrl;
796 
797     /* T53 CLIR Info Rec */
798     RIL_CDMA_T53_CLIRInfoRecord          clir;
799 
800     /* T53 Audio Control Info Rec */
801     RIL_CDMA_T53_AudioControlInfoRecord  audioCtrl;
802   } rec;
803 } RIL_CDMA_InformationRecord;
804 
805 #define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10
806 
807 typedef struct {
808   char numberOfInfoRecs;
809   RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS];
810 } RIL_CDMA_InformationRecords;
811 
812 /**
813  * RIL_REQUEST_GET_SIM_STATUS
814  *
815  * Requests status of the SIM interface and the SIM card
816  *
817  * "data" is NULL
818  *
819  * "response" is const RIL_CardStatus_v6 *
820  *
821  * Valid errors:
822  *  Must never fail
823  */
824 #define RIL_REQUEST_GET_SIM_STATUS 1
825 
826 /**
827  * RIL_REQUEST_ENTER_SIM_PIN
828  *
829  * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
830  *
831  * "data" is const char **
832  * ((const char **)data)[0] is PIN value
833  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
834  *
835  * "response" is int *
836  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
837  *
838  * Valid errors:
839  *
840  * SUCCESS
841  * RADIO_NOT_AVAILABLE (radio resetting)
842  * GENERIC_FAILURE
843  * PASSWORD_INCORRECT
844  */
845 
846 #define RIL_REQUEST_ENTER_SIM_PIN 2
847 
848 
849 /**
850  * RIL_REQUEST_ENTER_SIM_PUK
851  *
852  * Supplies SIM PUK and new PIN.
853  *
854  * "data" is const char **
855  * ((const char **)data)[0] is PUK value
856  * ((const char **)data)[1] is new PIN value
857  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
858  *
859  * "response" is int *
860  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
861  *
862  * Valid errors:
863  *
864  *  SUCCESS
865  *  RADIO_NOT_AVAILABLE (radio resetting)
866  *  GENERIC_FAILURE
867  *  PASSWORD_INCORRECT
868  *     (PUK is invalid)
869  */
870 
871 #define RIL_REQUEST_ENTER_SIM_PUK 3
872 
873 /**
874  * RIL_REQUEST_ENTER_SIM_PIN2
875  *
876  * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
877  * returned as a a failure from a previous operation.
878  *
879  * "data" is const char **
880  * ((const char **)data)[0] is PIN2 value
881  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
882  *
883  * "response" is int *
884  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
885  *
886  * Valid errors:
887  *
888  *  SUCCESS
889  *  RADIO_NOT_AVAILABLE (radio resetting)
890  *  GENERIC_FAILURE
891  *  PASSWORD_INCORRECT
892  */
893 
894 #define RIL_REQUEST_ENTER_SIM_PIN2 4
895 
896 /**
897  * RIL_REQUEST_ENTER_SIM_PUK2
898  *
899  * Supplies SIM PUK2 and new PIN2.
900  *
901  * "data" is const char **
902  * ((const char **)data)[0] is PUK2 value
903  * ((const char **)data)[1] is new PIN2 value
904  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
905  *
906  * "response" is int *
907  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
908  *
909  * Valid errors:
910  *
911  *  SUCCESS
912  *  RADIO_NOT_AVAILABLE (radio resetting)
913  *  GENERIC_FAILURE
914  *  PASSWORD_INCORRECT
915  *     (PUK2 is invalid)
916  */
917 
918 #define RIL_REQUEST_ENTER_SIM_PUK2 5
919 
920 /**
921  * RIL_REQUEST_CHANGE_SIM_PIN
922  *
923  * Supplies old SIM PIN and new PIN.
924  *
925  * "data" is const char **
926  * ((const char **)data)[0] is old PIN value
927  * ((const char **)data)[1] is new PIN value
928  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
929  *
930  * "response" is int *
931  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
932  *
933  * Valid errors:
934  *
935  *  SUCCESS
936  *  RADIO_NOT_AVAILABLE (radio resetting)
937  *  GENERIC_FAILURE
938  *  PASSWORD_INCORRECT
939  *     (old PIN is invalid)
940  *
941  */
942 
943 #define RIL_REQUEST_CHANGE_SIM_PIN 6
944 
945 
946 /**
947  * RIL_REQUEST_CHANGE_SIM_PIN2
948  *
949  * Supplies old SIM PIN2 and new PIN2.
950  *
951  * "data" is const char **
952  * ((const char **)data)[0] is old PIN2 value
953  * ((const char **)data)[1] is new PIN2 value
954  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
955  *
956  * "response" is int *
957  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
958  *
959  * Valid errors:
960  *
961  *  SUCCESS
962  *  RADIO_NOT_AVAILABLE (radio resetting)
963  *  GENERIC_FAILURE
964  *  PASSWORD_INCORRECT
965  *     (old PIN2 is invalid)
966  *
967  */
968 
969 #define RIL_REQUEST_CHANGE_SIM_PIN2 7
970 
971 /**
972  * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
973  *
974  * Requests that network personlization be deactivated
975  *
976  * "data" is const char **
977  * ((const char **)(data))[0]] is network depersonlization code
978  *
979  * "response" is int *
980  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
981  *
982  * Valid errors:
983  *
984  *  SUCCESS
985  *  RADIO_NOT_AVAILABLE (radio resetting)
986  *  GENERIC_FAILURE
987  *  PASSWORD_INCORRECT
988  *     (code is invalid)
989  */
990 
991 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
992 
993 /**
994  * RIL_REQUEST_GET_CURRENT_CALLS
995  *
996  * Requests current call list
997  *
998  * "data" is NULL
999  *
1000  * "response" must be a "const RIL_Call **"
1001  *
1002  * Valid errors:
1003  *
1004  *  SUCCESS
1005  *  RADIO_NOT_AVAILABLE (radio resetting)
1006  *  GENERIC_FAILURE
1007  *      (request will be made again in a few hundred msec)
1008  */
1009 
1010 #define RIL_REQUEST_GET_CURRENT_CALLS 9
1011 
1012 
1013 /**
1014  * RIL_REQUEST_DIAL
1015  *
1016  * Initiate voice call
1017  *
1018  * "data" is const RIL_Dial *
1019  * "response" is NULL
1020  *
1021  * This method is never used for supplementary service codes
1022  *
1023  * Valid errors:
1024  *  SUCCESS
1025  *  RADIO_NOT_AVAILABLE (radio resetting)
1026  *  GENERIC_FAILURE
1027  */
1028 #define RIL_REQUEST_DIAL 10
1029 
1030 /**
1031  * RIL_REQUEST_GET_IMSI
1032  *
1033  * Get the SIM IMSI
1034  *
1035  * Only valid when radio state is "RADIO_STATE_ON"
1036  *
1037  * "data" is const char **
1038  * ((const char **)data)[0] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1039  * "response" is a const char * containing the IMSI
1040  *
1041  * Valid errors:
1042  *  SUCCESS
1043  *  RADIO_NOT_AVAILABLE (radio resetting)
1044  *  GENERIC_FAILURE
1045  */
1046 
1047 #define RIL_REQUEST_GET_IMSI 11
1048 
1049 /**
1050  * RIL_REQUEST_HANGUP
1051  *
1052  * Hang up a specific line (like AT+CHLD=1x)
1053  *
1054  * After this HANGUP request returns, RIL should show the connection is NOT
1055  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
1056  *
1057  * "data" is an int *
1058  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
1059  *
1060  * "response" is NULL
1061  *
1062  * Valid errors:
1063  *  SUCCESS
1064  *  RADIO_NOT_AVAILABLE (radio resetting)
1065  *  GENERIC_FAILURE
1066  */
1067 
1068 #define RIL_REQUEST_HANGUP 12
1069 
1070 /**
1071  * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
1072  *
1073  * Hang up waiting or held (like AT+CHLD=0)
1074  *
1075  * After this HANGUP request returns, RIL should show the connection is NOT
1076  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
1077  *
1078  * "data" is NULL
1079  * "response" is NULL
1080  *
1081  * Valid errors:
1082  *  SUCCESS
1083  *  RADIO_NOT_AVAILABLE (radio resetting)
1084  *  GENERIC_FAILURE
1085  */
1086 
1087 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
1088 
1089 /**
1090  * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
1091  *
1092  * Hang up waiting or held (like AT+CHLD=1)
1093  *
1094  * After this HANGUP request returns, RIL should show the connection is NOT
1095  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
1096  *
1097  * "data" is NULL
1098  * "response" is NULL
1099  *
1100  * Valid errors:
1101  *  SUCCESS
1102  *  RADIO_NOT_AVAILABLE (radio resetting)
1103  *  GENERIC_FAILURE
1104  */
1105 
1106 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
1107 
1108 /**
1109  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
1110  *
1111  * Switch waiting or holding call and active call (like AT+CHLD=2)
1112  *
1113  * State transitions should be is follows:
1114  *
1115  * If call 1 is waiting and call 2 is active, then if this re
1116  *
1117  *   BEFORE                               AFTER
1118  * Call 1   Call 2                 Call 1       Call 2
1119  * ACTIVE   HOLDING                HOLDING     ACTIVE
1120  * ACTIVE   WAITING                HOLDING     ACTIVE
1121  * HOLDING  WAITING                HOLDING     ACTIVE
1122  * ACTIVE   IDLE                   HOLDING     IDLE
1123  * IDLE     IDLE                   IDLE        IDLE
1124  *
1125  * "data" is NULL
1126  * "response" is NULL
1127  *
1128  * Valid errors:
1129  *  SUCCESS
1130  *  RADIO_NOT_AVAILABLE (radio resetting)
1131  *  GENERIC_FAILURE
1132  */
1133 
1134 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
1135 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
1136 
1137 /**
1138  * RIL_REQUEST_CONFERENCE
1139  *
1140  * Conference holding and active (like AT+CHLD=3)
1141 
1142  * "data" is NULL
1143  * "response" is NULL
1144  *
1145  * Valid errors:
1146  *  SUCCESS
1147  *  RADIO_NOT_AVAILABLE (radio resetting)
1148  *  GENERIC_FAILURE
1149  */
1150 #define RIL_REQUEST_CONFERENCE 16
1151 
1152 /**
1153  * RIL_REQUEST_UDUB
1154  *
1155  * Send UDUB (user determined used busy) to ringing or
1156  * waiting call answer)(RIL_BasicRequest r);
1157  *
1158  * "data" is NULL
1159  * "response" is NULL
1160  *
1161  * Valid errors:
1162  *  SUCCESS
1163  *  RADIO_NOT_AVAILABLE (radio resetting)
1164  *  GENERIC_FAILURE
1165  */
1166 #define RIL_REQUEST_UDUB 17
1167 
1168 /**
1169  * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
1170  *
1171  * Requests the failure cause code for the most recently terminated call
1172  *
1173  * "data" is NULL
1174  * "response" is a "int *"
1175  * ((int *)response)[0] is RIL_LastCallFailCause.  GSM failure reasons are
1176  * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
1177  * failure reasons are derived from the possible call failure scenarios
1178  * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
1179  *
1180  * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
1181  * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
1182  *
1183  * If the implementation does not have access to the exact cause codes,
1184  * then it should return one of the values listed in RIL_LastCallFailCause,
1185  * as the UI layer needs to distinguish these cases for tone generation or
1186  * error notification.
1187  *
1188  * Valid errors:
1189  *  SUCCESS
1190  *  RADIO_NOT_AVAILABLE
1191  *  GENERIC_FAILURE
1192  *
1193  * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
1194  */
1195 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
1196 
1197 /**
1198  * RIL_REQUEST_SIGNAL_STRENGTH
1199  *
1200  * Requests current signal strength and associated information
1201  *
1202  * Must succeed if radio is on.
1203  *
1204  * "data" is NULL
1205  *
1206  * "response" is a const RIL_SignalStrength *
1207  *
1208  * Valid errors:
1209  *  SUCCESS
1210  *  RADIO_NOT_AVAILABLE
1211  */
1212 #define RIL_REQUEST_SIGNAL_STRENGTH 19
1213 
1214 /**
1215  * RIL_REQUEST_VOICE_REGISTRATION_STATE
1216  *
1217  * Request current registration state
1218  *
1219  * "data" is NULL
1220  * "response" is a "char **"
1221  * ((const char **)response)[0] is registration state 0-6,
1222  *              0 - Not registered, MT is not currently searching
1223  *                  a new operator to register
1224  *              1 - Registered, home network
1225  *              2 - Not registered, but MT is currently searching
1226  *                  a new operator to register
1227  *              3 - Registration denied
1228  *              4 - Unknown
1229  *              5 - Registered, roaming
1230  *             10 - Same as 0, but indicates that emergency calls
1231  *                  are enabled.
1232  *             12 - Same as 2, but indicates that emergency calls
1233  *                  are enabled.
1234  *             13 - Same as 3, but indicates that emergency calls
1235  *                  are enabled.
1236  *             14 - Same as 4, but indicates that emergency calls
1237  *                  are enabled.
1238  *
1239  * ((const char **)response)[1] is LAC if registered on a GSM/WCDMA system or
1240  *                              NULL if not.Valid LAC are 0x0000 - 0xffff
1241  * ((const char **)response)[2] is CID if registered on a * GSM/WCDMA or
1242  *                              NULL if not.
1243  *                                 Valid CID are 0x00000000 - 0xffffffff
1244  *                                    In GSM, CID is Cell ID (see TS 27.007)
1245  *                                            in 16 bits
1246  *                                    In UMTS, CID is UMTS Cell Identity
1247  *                                             (see TS 25.331) in 28 bits
1248  * ((const char **)response)[3] indicates the available voice radio technology,
1249  *                              valid values as defined by RIL_RadioTechnology.
1250  * ((const char **)response)[4] is Base Station ID if registered on a CDMA
1251  *                              system or NULL if not.  Base Station ID in
1252  *                              decimal format
1253  * ((const char **)response)[5] is Base Station latitude if registered on a
1254  *                              CDMA system or NULL if not. Base Station
1255  *                              latitude is a decimal number as specified in
1256  *                              3GPP2 C.S0005-A v6.0. It is represented in
1257  *                              units of 0.25 seconds and ranges from -1296000
1258  *                              to 1296000, both values inclusive (corresponding
1259  *                              to a range of -90 to +90 degrees).
1260  * ((const char **)response)[6] is Base Station longitude if registered on a
1261  *                              CDMA system or NULL if not. Base Station
1262  *                              longitude is a decimal number as specified in
1263  *                              3GPP2 C.S0005-A v6.0. It is represented in
1264  *                              units of 0.25 seconds and ranges from -2592000
1265  *                              to 2592000, both values inclusive (corresponding
1266  *                              to a range of -180 to +180 degrees).
1267  * ((const char **)response)[7] is concurrent services support indicator if
1268  *                              registered on a CDMA system 0-1.
1269  *                                   0 - Concurrent services not supported,
1270  *                                   1 - Concurrent services supported
1271  * ((const char **)response)[8] is System ID if registered on a CDMA system or
1272  *                              NULL if not. Valid System ID are 0 - 32767
1273  * ((const char **)response)[9] is Network ID if registered on a CDMA system or
1274  *                              NULL if not. Valid System ID are 0 - 65535
1275  * ((const char **)response)[10] is the TSB-58 Roaming Indicator if registered
1276  *                               on a CDMA or EVDO system or NULL if not. Valid values
1277  *                               are 0-255.
1278  * ((const char **)response)[11] indicates whether the current system is in the
1279  *                               PRL if registered on a CDMA or EVDO system or NULL if
1280  *                               not. 0=not in the PRL, 1=in the PRL
1281  * ((const char **)response)[12] is the default Roaming Indicator from the PRL,
1282  *                               if registered on a CDMA or EVDO system or NULL if not.
1283  *                               Valid values are 0-255.
1284  * ((const char **)response)[13] if registration state is 3 (Registration
1285  *                               denied) this is an enumerated reason why
1286  *                               registration was denied.  See 3GPP TS 24.008,
1287  *                               10.5.3.6 and Annex G.
1288  *                                 0 - General
1289  *                                 1 - Authentication Failure
1290  *                                 2 - IMSI unknown in HLR
1291  *                                 3 - Illegal MS
1292  *                                 4 - Illegal ME
1293  *                                 5 - PLMN not allowed
1294  *                                 6 - Location area not allowed
1295  *                                 7 - Roaming not allowed
1296  *                                 8 - No Suitable Cells in this Location Area
1297  *                                 9 - Network failure
1298  *                                10 - Persistent location update reject
1299  *                                11 - PLMN not allowed
1300  *                                12 - Location area not allowed
1301  *                                13 - Roaming not allowed in this Location Area
1302  *                                15 - No Suitable Cells in this Location Area
1303  *                                17 - Network Failure
1304  *                                20 - MAC Failure
1305  *                                21 - Sync Failure
1306  *                                22 - Congestion
1307  *                                23 - GSM Authentication unacceptable
1308  *                                25 - Not Authorized for this CSG
1309  *                                32 - Service option not supported
1310  *                                33 - Requested service option not subscribed
1311  *                                34 - Service option temporarily out of order
1312  *                                38 - Call cannot be identified
1313  *                                48-63 - Retry upon entry into a new cell
1314  *                                95 - Semantically incorrect message
1315  *                                96 - Invalid mandatory information
1316  *                                97 - Message type non-existent or not implemented
1317  *                                98 - Message not compatible with protocol state
1318  *                                99 - Information element non-existent or not implemented
1319  *                               100 - Conditional IE error
1320  *                               101 - Message not compatible with protocol state
1321  *                               111 - Protocol error, unspecified
1322  * ((const char **)response)[14] is the Primary Scrambling Code of the current
1323  *                               cell as described in TS 25.331, in hexadecimal
1324  *                               format, or NULL if unknown or not registered
1325  *                               to a UMTS network.
1326  *
1327  * Please note that registration state 4 ("unknown") is treated
1328  * as "out of service" in the Android telephony system
1329  *
1330  * Registration state 3 can be returned if Location Update Reject
1331  * (with cause 17 - Network Failure) is received repeatedly from the network,
1332  * to facilitate "managed roaming"
1333  *
1334  * Valid errors:
1335  *  SUCCESS
1336  *  RADIO_NOT_AVAILABLE
1337  *  GENERIC_FAILURE
1338  */
1339 #define RIL_REQUEST_VOICE_REGISTRATION_STATE 20
1340 
1341 /**
1342  * RIL_REQUEST_DATA_REGISTRATION_STATE
1343  *
1344  * Request current DATA registration state
1345  *
1346  * "data" is NULL
1347  * "response" is a "char **"
1348  * ((const char **)response)[0] is registration state 0-5 from TS 27.007 10.1.20 AT+CGREG
1349  * ((const char **)response)[1] is LAC if registered or NULL if not
1350  * ((const char **)response)[2] is CID if registered or NULL if not
1351  * ((const char **)response)[3] indicates the available data radio technology,
1352  *                              valid values as defined by RIL_RadioTechnology.
1353  * ((const char **)response)[4] if registration state is 3 (Registration
1354  *                               denied) this is an enumerated reason why
1355  *                               registration was denied.  See 3GPP TS 24.008,
1356  *                               Annex G.6 "Additonal cause codes for GMM".
1357  *      7 == GPRS services not allowed
1358  *      8 == GPRS services and non-GPRS services not allowed
1359  *      9 == MS identity cannot be derived by the network
1360  *      10 == Implicitly detached
1361  *      14 == GPRS services not allowed in this PLMN
1362  *      16 == MSC temporarily not reachable
1363  *      40 == No PDP context activated
1364  * ((const char **)response)[5] The maximum number of simultaneous Data Calls that can be
1365  *                              established using RIL_REQUEST_SETUP_DATA_CALL.
1366  *
1367  * LAC and CID are in hexadecimal format.
1368  * valid LAC are 0x0000 - 0xffff
1369  * valid CID are 0x00000000 - 0x0fffffff
1370  *
1371  * Please note that registration state 4 ("unknown") is treated
1372  * as "out of service" in the Android telephony system
1373  *
1374  * Valid errors:
1375  *  SUCCESS
1376  *  RADIO_NOT_AVAILABLE
1377  *  GENERIC_FAILURE
1378  */
1379 #define RIL_REQUEST_DATA_REGISTRATION_STATE 21
1380 
1381 /**
1382  * RIL_REQUEST_OPERATOR
1383  *
1384  * Request current operator ONS or EONS
1385  *
1386  * "data" is NULL
1387  * "response" is a "const char **"
1388  * ((const char **)response)[0] is long alpha ONS or EONS
1389  *                                  or NULL if unregistered
1390  *
1391  * ((const char **)response)[1] is short alpha ONS or EONS
1392  *                                  or NULL if unregistered
1393  * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
1394  *                                  or NULL if unregistered
1395  *
1396  * Valid errors:
1397  *  SUCCESS
1398  *  RADIO_NOT_AVAILABLE
1399  *  GENERIC_FAILURE
1400  */
1401 #define RIL_REQUEST_OPERATOR 22
1402 
1403 /**
1404  * RIL_REQUEST_RADIO_POWER
1405  *
1406  * Toggle radio on and off (for "airplane" mode)
1407  * If the radio is is turned off/on the radio modem subsystem
1408  * is expected return to an initialized state. For instance,
1409  * any voice and data calls will be terminated and all associated
1410  * lists emptied.
1411  *
1412  * "data" is int *
1413  * ((int *)data)[0] is > 0 for "Radio On"
1414  * ((int *)data)[0] is == 0 for "Radio Off"
1415  *
1416  * "response" is NULL
1417  *
1418  * Turn radio on if "on" > 0
1419  * Turn radio off if "on" == 0
1420  *
1421  * Valid errors:
1422  *  SUCCESS
1423  *  RADIO_NOT_AVAILABLE
1424  *  GENERIC_FAILURE
1425  */
1426 #define RIL_REQUEST_RADIO_POWER 23
1427 
1428 /**
1429  * RIL_REQUEST_DTMF
1430  *
1431  * Send a DTMF tone
1432  *
1433  * If the implementation is currently playing a tone requested via
1434  * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
1435  * should be played instead
1436  *
1437  * "data" is a char * containing a single character with one of 12 values: 0-9,*,#
1438  * "response" is NULL
1439  *
1440  * FIXME should this block/mute microphone?
1441  * How does this interact with local DTMF feedback?
1442  *
1443  * Valid errors:
1444  *  SUCCESS
1445  *  RADIO_NOT_AVAILABLE
1446  *  GENERIC_FAILURE
1447  *
1448  * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
1449  *
1450  */
1451 #define RIL_REQUEST_DTMF 24
1452 
1453 /**
1454  * RIL_REQUEST_SEND_SMS
1455  *
1456  * Send an SMS message
1457  *
1458  * "data" is const char **
1459  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
1460  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
1461  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
1462  *      less the SMSC address
1463  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
1464  *
1465  * "response" is a const RIL_SMS_Response *
1466  *
1467  * Based on the return error, caller decides to resend if sending sms
1468  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
1469  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
1470  *
1471  * Valid errors:
1472  *  SUCCESS
1473  *  RADIO_NOT_AVAILABLE
1474  *  SMS_SEND_FAIL_RETRY
1475  *  FDN_CHECK_FAILURE
1476  *  GENERIC_FAILURE
1477  *
1478  * FIXME how do we specify TP-Message-Reference if we need to resend?
1479  */
1480 #define RIL_REQUEST_SEND_SMS 25
1481 
1482 
1483 /**
1484  * RIL_REQUEST_SEND_SMS_EXPECT_MORE
1485  *
1486  * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
1487  * except that more messages are expected to be sent soon. If possible,
1488  * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
1489  *
1490  * "data" is const char **
1491  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
1492  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
1493  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
1494  *      less the SMSC address
1495  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
1496  *
1497  * "response" is a const RIL_SMS_Response *
1498  *
1499  * Based on the return error, caller decides to resend if sending sms
1500  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
1501  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
1502  *
1503  * Valid errors:
1504  *  SUCCESS
1505  *  RADIO_NOT_AVAILABLE
1506  *  SMS_SEND_FAIL_RETRY
1507  *  GENERIC_FAILURE
1508  *
1509  */
1510 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
1511 
1512 
1513 /**
1514  * RIL_REQUEST_SETUP_DATA_CALL
1515  *
1516  * Setup a packet data connection. If RIL_Data_Call_Response_v6.status
1517  * return success it is added to the list of data calls and a
1518  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is sent. The call remains in the
1519  * list until RIL_REQUEST_DEACTIVATE_DATA_CALL is issued or the
1520  * radio is powered off/on. This list is returned by RIL_REQUEST_DATA_CALL_LIST
1521  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED.
1522  *
1523  * The RIL is expected to:
1524  *  - Create one data call context.
1525  *  - Create and configure a dedicated interface for the context
1526  *  - The interface must be point to point.
1527  *  - The interface is configured with one or more addresses and
1528  *    is capable of sending and receiving packets. The prefix length
1529  *    of the addresses must be /32 for IPv4 and /128 for IPv6.
1530  *  - Must NOT change the linux routing table.
1531  *  - Support up to RIL_REQUEST_DATA_REGISTRATION_STATE response[5]
1532  *    number of simultaneous data call contexts.
1533  *
1534  * "data" is a const char **
1535  * ((const char **)data)[0] Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2...
1536  *                          for values above 2 this is RIL_RadioTechnology + 2.
1537  * ((const char **)data)[1] is a RIL_DataProfile (support is optional)
1538  * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will
1539  *                          override the one in the profile. NULL indicates no APN overrride.
1540  * ((const char **)data)[3] is the username for APN, or NULL
1541  * ((const char **)data)[4] is the password for APN, or NULL
1542  * ((const char **)data)[5] is the PAP / CHAP auth type. Values:
1543  *                          0 => PAP and CHAP is never performed.
1544  *                          1 => PAP may be performed; CHAP is never performed.
1545  *                          2 => CHAP may be performed; PAP is never performed.
1546  *                          3 => PAP / CHAP may be performed - baseband dependent.
1547  * ((const char **)data)[6] is the connection type to request must be one of the
1548  *                          PDP_type values in TS 27.007 section 10.1.1.
1549  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
1550  * ((const char **)data)[7] Optional connection property parameters, format to be defined.
1551  *
1552  * "response" is a RIL_Data_Call_Response_v6
1553  *
1554  * FIXME may need way to configure QoS settings
1555  *
1556  * Valid errors:
1557  *  SUCCESS should be returned on both success and failure of setup with
1558  *  the RIL_Data_Call_Response_v6.status containing the actual status.
1559  *  For all other errors the RIL_Data_Call_Resonse_v6 is ignored.
1560  *
1561  *  Other errors could include:
1562  *    RADIO_NOT_AVAILABLE, GENERIC_FAILURE, OP_NOT_ALLOWED_BEFORE_REG_TO_NW,
1563  *    OP_NOT_ALLOWED_DURING_VOICE_CALL and REQUEST_NOT_SUPPORTED.
1564  *
1565  * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL
1566  */
1567 #define RIL_REQUEST_SETUP_DATA_CALL 27
1568 
1569 
1570 /**
1571  * RIL_REQUEST_SIM_IO
1572  *
1573  * Request SIM I/O operation.
1574  * This is similar to the TS 27.007 "restricted SIM" operation
1575  * where it assumes all of the EF selection will be done by the
1576  * callee.
1577  *
1578  * "data" is a const RIL_SIM_IO_v6 *
1579  * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
1580  * or may specify a PIN2 for operations that require a PIN2 (eg
1581  * updating FDN records)
1582  *
1583  * "response" is a const RIL_SIM_IO_Response *
1584  *
1585  * Arguments and responses that are unused for certain
1586  * values of "command" should be ignored or set to NULL
1587  *
1588  * Valid errors:
1589  *  SUCCESS
1590  *  RADIO_NOT_AVAILABLE
1591  *  GENERIC_FAILURE
1592  *  SIM_PIN2
1593  *  SIM_PUK2
1594  */
1595 #define RIL_REQUEST_SIM_IO 28
1596 
1597 /**
1598  * RIL_REQUEST_SEND_USSD
1599  *
1600  * Send a USSD message
1601  *
1602  * If a USSD session already exists, the message should be sent in the
1603  * context of that session. Otherwise, a new session should be created.
1604  *
1605  * The network reply should be reported via RIL_UNSOL_ON_USSD
1606  *
1607  * Only one USSD session may exist at a time, and the session is assumed
1608  * to exist until:
1609  *   a) The android system invokes RIL_REQUEST_CANCEL_USSD
1610  *   b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
1611  *      of "0" (USSD-Notify/no further action) or "2" (session terminated)
1612  *
1613  * "data" is a const char * containing the USSD request in UTF-8 format
1614  * "response" is NULL
1615  *
1616  * Valid errors:
1617  *  SUCCESS
1618  *  RADIO_NOT_AVAILABLE
1619  *  FDN_CHECK_FAILURE
1620  *  GENERIC_FAILURE
1621  *
1622  * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
1623  */
1624 
1625 #define RIL_REQUEST_SEND_USSD 29
1626 
1627 /**
1628  * RIL_REQUEST_CANCEL_USSD
1629  *
1630  * Cancel the current USSD session if one exists
1631  *
1632  * "data" is null
1633  * "response" is NULL
1634  *
1635  * Valid errors:
1636  *  SUCCESS
1637  *  RADIO_NOT_AVAILABLE
1638  *  GENERIC_FAILURE
1639  */
1640 
1641 #define RIL_REQUEST_CANCEL_USSD 30
1642 
1643 /**
1644  * RIL_REQUEST_GET_CLIR
1645  *
1646  * Gets current CLIR status
1647  * "data" is NULL
1648  * "response" is int *
1649  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
1650  * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
1651  *
1652  * Valid errors:
1653  *  SUCCESS
1654  *  RADIO_NOT_AVAILABLE
1655  *  GENERIC_FAILURE
1656  */
1657 #define RIL_REQUEST_GET_CLIR 31
1658 
1659 /**
1660  * RIL_REQUEST_SET_CLIR
1661  *
1662  * "data" is int *
1663  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
1664  *
1665  * "response" is NULL
1666  *
1667  * Valid errors:
1668  *  SUCCESS
1669  *  RADIO_NOT_AVAILABLE
1670  *  GENERIC_FAILURE
1671  */
1672 #define RIL_REQUEST_SET_CLIR 32
1673 
1674 /**
1675  * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
1676  *
1677  * "data" is const RIL_CallForwardInfo *
1678  *
1679  * "response" is const RIL_CallForwardInfo **
1680  * "response" points to an array of RIL_CallForwardInfo *'s, one for
1681  * each distinct registered phone number.
1682  *
1683  * For example, if data is forwarded to +18005551212 and voice is forwarded
1684  * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
1685  *
1686  * If, however, both data and voice are forwarded to +18005551212, then
1687  * a single RIL_CallForwardInfo can be returned with the service class
1688  * set to "data + voice = 3")
1689  *
1690  * Valid errors:
1691  *  SUCCESS
1692  *  RADIO_NOT_AVAILABLE
1693  *  GENERIC_FAILURE
1694  */
1695 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
1696 
1697 
1698 /**
1699  * RIL_REQUEST_SET_CALL_FORWARD
1700  *
1701  * Configure call forward rule
1702  *
1703  * "data" is const RIL_CallForwardInfo *
1704  * "response" is NULL
1705  *
1706  * Valid errors:
1707  *  SUCCESS
1708  *  RADIO_NOT_AVAILABLE
1709  *  GENERIC_FAILURE
1710  */
1711 #define RIL_REQUEST_SET_CALL_FORWARD 34
1712 
1713 
1714 /**
1715  * RIL_REQUEST_QUERY_CALL_WAITING
1716  *
1717  * Query current call waiting state
1718  *
1719  * "data" is const int *
1720  * ((const int *)data)[0] is the TS 27.007 service class to query.
1721  * "response" is a const int *
1722  * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
1723  *
1724  * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
1725  * must follow, with the TS 27.007 service class bit vector of services
1726  * for which call waiting is enabled.
1727  *
1728  * For example, if ((const int *)response)[0]  is 1 and
1729  * ((const int *)response)[1] is 3, then call waiting is enabled for data
1730  * and voice and disabled for everything else
1731  *
1732  * Valid errors:
1733  *  SUCCESS
1734  *  RADIO_NOT_AVAILABLE
1735  *  GENERIC_FAILURE
1736  */
1737 #define RIL_REQUEST_QUERY_CALL_WAITING 35
1738 
1739 
1740 /**
1741  * RIL_REQUEST_SET_CALL_WAITING
1742  *
1743  * Configure current call waiting state
1744  *
1745  * "data" is const int *
1746  * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
1747  * ((const int *)data)[1] is the TS 27.007 service class bit vector of
1748  *                           services to modify
1749  * "response" is NULL
1750  *
1751  * Valid errors:
1752  *  SUCCESS
1753  *  RADIO_NOT_AVAILABLE
1754  *  GENERIC_FAILURE
1755  */
1756 #define RIL_REQUEST_SET_CALL_WAITING 36
1757 
1758 /**
1759  * RIL_REQUEST_SMS_ACKNOWLEDGE
1760  *
1761  * Acknowledge successful or failed receipt of SMS previously indicated
1762  * via RIL_UNSOL_RESPONSE_NEW_SMS
1763  *
1764  * "data" is int *
1765  * ((int *)data)[0] is 1 on successful receipt
1766  *                  (basically, AT+CNMA=1 from TS 27.005
1767  *                  is 0 on failed receipt
1768  *                  (basically, AT+CNMA=2 from TS 27.005)
1769  * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined
1770  *                  in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory
1771  *                  capacity exceeded) and 0xFF (unspecified error) are
1772  *                  reported.
1773  *
1774  * "response" is NULL
1775  *
1776  * FIXME would like request that specified RP-ACK/RP-ERROR PDU
1777  *
1778  * Valid errors:
1779  *  SUCCESS
1780  *  RADIO_NOT_AVAILABLE
1781  *  GENERIC_FAILURE
1782  */
1783 #define RIL_REQUEST_SMS_ACKNOWLEDGE  37
1784 
1785 /**
1786  * RIL_REQUEST_GET_IMEI - DEPRECATED
1787  *
1788  * Get the device IMEI, including check digit
1789  *
1790  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
1791  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
1792  *
1793  * "data" is NULL
1794  * "response" is a const char * containing the IMEI
1795  *
1796  * Valid errors:
1797  *  SUCCESS
1798  *  RADIO_NOT_AVAILABLE (radio resetting)
1799  *  GENERIC_FAILURE
1800  */
1801 
1802 #define RIL_REQUEST_GET_IMEI 38
1803 
1804 /**
1805  * RIL_REQUEST_GET_IMEISV - DEPRECATED
1806  *
1807  * Get the device IMEISV, which should be two decimal digits
1808  *
1809  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
1810  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
1811  *
1812  * "data" is NULL
1813  * "response" is a const char * containing the IMEISV
1814  *
1815  * Valid errors:
1816  *  SUCCESS
1817  *  RADIO_NOT_AVAILABLE (radio resetting)
1818  *  GENERIC_FAILURE
1819  */
1820 
1821 #define RIL_REQUEST_GET_IMEISV 39
1822 
1823 
1824 /**
1825  * RIL_REQUEST_ANSWER
1826  *
1827  * Answer incoming call
1828  *
1829  * Will not be called for WAITING calls.
1830  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
1831  * instead
1832  *
1833  * "data" is NULL
1834  * "response" is NULL
1835  *
1836  * Valid errors:
1837  *  SUCCESS
1838  *  RADIO_NOT_AVAILABLE (radio resetting)
1839  *  GENERIC_FAILURE
1840  */
1841 
1842 #define RIL_REQUEST_ANSWER 40
1843 
1844 /**
1845  * RIL_REQUEST_DEACTIVATE_DATA_CALL
1846  *
1847  * Deactivate packet data connection and remove from the
1848  * data call list if SUCCESS is returned. Any other return
1849  * values should also try to remove the call from the list,
1850  * but that may not be possible. In any event a
1851  * RIL_REQUEST_RADIO_POWER off/on must clear the list. An
1852  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is not expected to be
1853  * issued because of an RIL_REQUEST_DEACTIVATE_DATA_CALL.
1854  *
1855  * "data" is const char **
1856  * ((char**)data)[0] indicating CID
1857  * ((char**)data)[1] indicating Disconnect Reason
1858  *                   0 => No specific reason specified
1859  *                   1 => Radio shutdown requested
1860  *
1861  * "response" is NULL
1862  *
1863  * Valid errors:
1864  *  SUCCESS
1865  *  RADIO_NOT_AVAILABLE
1866  *  GENERIC_FAILURE
1867  *
1868  * See also: RIL_REQUEST_SETUP_DATA_CALL
1869  */
1870 #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41
1871 
1872 /**
1873  * RIL_REQUEST_QUERY_FACILITY_LOCK
1874  *
1875  * Query the status of a facility lock state
1876  *
1877  * "data" is const char **
1878  * ((const char **)data)[0] is the facility string code from TS 27.007 7.4
1879  *                      (eg "AO" for BAOC, "SC" for SIM lock)
1880  * ((const char **)data)[1] is the password, or "" if not required
1881  * ((const char **)data)[2] is the TS 27.007 service class bit vector of
1882  *                           services to query
1883  * ((const char **)data)[3] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1884  *                            This is only applicable in the case of Fixed Dialing Numbers
1885  *                            (FDN) requests.
1886  *
1887  * "response" is an int *
1888  * ((const int *)response) 0 is the TS 27.007 service class bit vector of
1889  *                           services for which the specified barring facility
1890  *                           is active. "0" means "disabled for all"
1891  *
1892  *
1893  * Valid errors:
1894  *  SUCCESS
1895  *  RADIO_NOT_AVAILABLE
1896  *  GENERIC_FAILURE
1897  *
1898  */
1899 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
1900 
1901 /**
1902  * RIL_REQUEST_SET_FACILITY_LOCK
1903  *
1904  * Enable/disable one facility lock
1905  *
1906  * "data" is const char **
1907  *
1908  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
1909  * (eg "AO" for BAOC)
1910  * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
1911  * ((const char **)data)[2] = password
1912  * ((const char **)data)[3] = string representation of decimal TS 27.007
1913  *                            service class bit vector. Eg, the string
1914  *                            "1" means "set this facility for voice services"
1915  * ((const char **)data)[4] = AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1916  *                            This is only applicable in the case of Fixed Dialing Numbers
1917  *                            (FDN) requests.
1918  *
1919  * "response" is int *
1920  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1921  *
1922  * Valid errors:
1923  *  SUCCESS
1924  *  RADIO_NOT_AVAILABLE
1925  *  GENERIC_FAILURE
1926  *
1927  */
1928 #define RIL_REQUEST_SET_FACILITY_LOCK 43
1929 
1930 /**
1931  * RIL_REQUEST_CHANGE_BARRING_PASSWORD
1932  *
1933  * Change call barring facility password
1934  *
1935  * "data" is const char **
1936  *
1937  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
1938  * (eg "AO" for BAOC)
1939  * ((const char **)data)[1] = old password
1940  * ((const char **)data)[2] = new password
1941  *
1942  * "response" is NULL
1943  *
1944  * Valid errors:
1945  *  SUCCESS
1946  *  RADIO_NOT_AVAILABLE
1947  *  GENERIC_FAILURE
1948  *
1949  */
1950 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
1951 
1952 /**
1953  * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
1954  *
1955  * Query current network selectin mode
1956  *
1957  * "data" is NULL
1958  *
1959  * "response" is int *
1960  * ((const int *)response)[0] is
1961  *     0 for automatic selection
1962  *     1 for manual selection
1963  *
1964  * Valid errors:
1965  *  SUCCESS
1966  *  RADIO_NOT_AVAILABLE
1967  *  GENERIC_FAILURE
1968  *
1969  */
1970 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
1971 
1972 /**
1973  * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
1974  *
1975  * Specify that the network should be selected automatically
1976  *
1977  * "data" is NULL
1978  * "response" is NULL
1979  *
1980  * This request must not respond until the new operator is selected
1981  * and registered
1982  *
1983  * Valid errors:
1984  *  SUCCESS
1985  *  RADIO_NOT_AVAILABLE
1986  *  ILLEGAL_SIM_OR_ME
1987  *  GENERIC_FAILURE
1988  *
1989  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
1990  *       no retries needed, such as illegal SIM or ME.
1991  *       Returns GENERIC_FAILURE for all other causes that might be
1992  *       fixed by retries.
1993  *
1994  */
1995 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
1996 
1997 /**
1998  * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
1999  *
2000  * Manually select a specified network.
2001  *
2002  * "data" is const char * specifying MCCMNC of network to select (eg "310170")
2003  * "response" is NULL
2004  *
2005  * This request must not respond until the new operator is selected
2006  * and registered
2007  *
2008  * Valid errors:
2009  *  SUCCESS
2010  *  RADIO_NOT_AVAILABLE
2011  *  ILLEGAL_SIM_OR_ME
2012  *  GENERIC_FAILURE
2013  *
2014  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
2015  *       no retries needed, such as illegal SIM or ME.
2016  *       Returns GENERIC_FAILURE for all other causes that might be
2017  *       fixed by retries.
2018  *
2019  */
2020 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
2021 
2022 /**
2023  * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
2024  *
2025  * Scans for available networks
2026  *
2027  * "data" is NULL
2028  * "response" is const char ** that should be an array of n*4 strings, where
2029  *    n is the number of available networks
2030  * For each available network:
2031  *
2032  * ((const char **)response)[n+0] is long alpha ONS or EONS
2033  * ((const char **)response)[n+1] is short alpha ONS or EONS
2034  * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
2035  * ((const char **)response)[n+3] is a string value of the status:
2036  *           "unknown"
2037  *           "available"
2038  *           "current"
2039  *           "forbidden"
2040  *
2041  * This request must not respond until the new operator is selected
2042  * and registered
2043  *
2044  * Valid errors:
2045  *  SUCCESS
2046  *  RADIO_NOT_AVAILABLE
2047  *  GENERIC_FAILURE
2048  *
2049  */
2050 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
2051 
2052 /**
2053  * RIL_REQUEST_DTMF_START
2054  *
2055  * Start playing a DTMF tone. Continue playing DTMF tone until
2056  * RIL_REQUEST_DTMF_STOP is received
2057  *
2058  * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
2059  * it should cancel the previous tone and play the new one.
2060  *
2061  * "data" is a char *
2062  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
2063  * "response" is NULL
2064  *
2065  * Valid errors:
2066  *  SUCCESS
2067  *  RADIO_NOT_AVAILABLE
2068  *  GENERIC_FAILURE
2069  *
2070  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
2071  */
2072 #define RIL_REQUEST_DTMF_START 49
2073 
2074 /**
2075  * RIL_REQUEST_DTMF_STOP
2076  *
2077  * Stop playing a currently playing DTMF tone.
2078  *
2079  * "data" is NULL
2080  * "response" is NULL
2081  *
2082  * Valid errors:
2083  *  SUCCESS
2084  *  RADIO_NOT_AVAILABLE
2085  *  GENERIC_FAILURE
2086  *
2087  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
2088  */
2089 #define RIL_REQUEST_DTMF_STOP 50
2090 
2091 /**
2092  * RIL_REQUEST_BASEBAND_VERSION
2093  *
2094  * Return string value indicating baseband version, eg
2095  * response from AT+CGMR
2096  *
2097  * "data" is NULL
2098  * "response" is const char * containing version string for log reporting
2099  *
2100  * Valid errors:
2101  *  SUCCESS
2102  *  RADIO_NOT_AVAILABLE
2103  *  GENERIC_FAILURE
2104  *
2105  */
2106 #define RIL_REQUEST_BASEBAND_VERSION 51
2107 
2108 /**
2109  * RIL_REQUEST_SEPARATE_CONNECTION
2110  *
2111  * Separate a party from a multiparty call placing the multiparty call
2112  * (less the specified party) on hold and leaving the specified party
2113  * as the only other member of the current (active) call
2114  *
2115  * Like AT+CHLD=2x
2116  *
2117  * See TS 22.084 1.3.8.2 (iii)
2118  * TS 22.030 6.5.5 "Entering "2X followed by send"
2119  * TS 27.007 "AT+CHLD=2x"
2120  *
2121  * "data" is an int *
2122  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL
2123  *
2124  * "response" is NULL
2125  *
2126  * Valid errors:
2127  *  SUCCESS
2128  *  RADIO_NOT_AVAILABLE (radio resetting)
2129  *  GENERIC_FAILURE
2130  */
2131 #define RIL_REQUEST_SEPARATE_CONNECTION 52
2132 
2133 
2134 /**
2135  * RIL_REQUEST_SET_MUTE
2136  *
2137  * Turn on or off uplink (microphone) mute.
2138  *
2139  * Will only be sent while voice call is active.
2140  * Will always be reset to "disable mute" when a new voice call is initiated
2141  *
2142  * "data" is an int *
2143  * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
2144  *
2145  * "response" is NULL
2146  *
2147  * Valid errors:
2148  *  SUCCESS
2149  *  RADIO_NOT_AVAILABLE (radio resetting)
2150  *  GENERIC_FAILURE
2151  */
2152 
2153 #define RIL_REQUEST_SET_MUTE 53
2154 
2155 /**
2156  * RIL_REQUEST_GET_MUTE
2157  *
2158  * Queries the current state of the uplink mute setting
2159  *
2160  * "data" is NULL
2161  * "response" is an int *
2162  * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
2163  *
2164  * Valid errors:
2165  *  SUCCESS
2166  *  RADIO_NOT_AVAILABLE (radio resetting)
2167  *  GENERIC_FAILURE
2168  */
2169 
2170 #define RIL_REQUEST_GET_MUTE 54
2171 
2172 /**
2173  * RIL_REQUEST_QUERY_CLIP
2174  *
2175  * Queries the status of the CLIP supplementary service
2176  *
2177  * (for MMI code "*#30#")
2178  *
2179  * "data" is NULL
2180  * "response" is an int *
2181  * (int *)response)[0] is 1 for "CLIP provisioned"
2182  *                           and 0 for "CLIP not provisioned"
2183  *                           and 2 for "unknown, e.g. no network etc"
2184  *
2185  * Valid errors:
2186  *  SUCCESS
2187  *  RADIO_NOT_AVAILABLE (radio resetting)
2188  *  GENERIC_FAILURE
2189  */
2190 
2191 #define RIL_REQUEST_QUERY_CLIP 55
2192 
2193 /**
2194  * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE - Deprecated use the status
2195  * field in RIL_Data_Call_Response_v6.
2196  *
2197  * Requests the failure cause code for the most recently failed PDP
2198  * context or CDMA data connection active
2199  * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE
2200  *
2201  * "data" is NULL
2202  *
2203  * "response" is a "int *"
2204  * ((int *)response)[0] is an integer cause code defined in TS 24.008
2205  *   section 6.1.3.1.3 or close approximation
2206  *
2207  * If the implementation does not have access to the exact cause codes,
2208  * then it should return one of the values listed in
2209  * RIL_DataCallFailCause, as the UI layer needs to distinguish these
2210  * cases for error notification
2211  * and potential retries.
2212  *
2213  * Valid errors:
2214  *  SUCCESS
2215  *  RADIO_NOT_AVAILABLE
2216  *  GENERIC_FAILURE
2217  *
2218  * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
2219  *
2220  * Deprecated use the status field in RIL_Data_Call_Response_v6.
2221  */
2222 
2223 #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56
2224 
2225 /**
2226  * RIL_REQUEST_DATA_CALL_LIST
2227  *
2228  * Returns the data call list. An entry is added when a
2229  * RIL_REQUEST_SETUP_DATA_CALL is issued and removed on a
2230  * RIL_REQUEST_DEACTIVATE_DATA_CALL. The list is emptied
2231  * when RIL_REQUEST_RADIO_POWER off/on is issued.
2232  *
2233  * "data" is NULL
2234  * "response" is an array of RIL_Data_Call_Response_v6
2235  *
2236  * Valid errors:
2237  *  SUCCESS
2238  *  RADIO_NOT_AVAILABLE (radio resetting)
2239  *  GENERIC_FAILURE
2240  *
2241  * See also: RIL_UNSOL_DATA_CALL_LIST_CHANGED
2242  */
2243 
2244 #define RIL_REQUEST_DATA_CALL_LIST 57
2245 
2246 /**
2247  * RIL_REQUEST_RESET_RADIO - DEPRECATED
2248  *
2249  * Request a radio reset. The RIL implementation may postpone
2250  * the reset until after this request is responded to if the baseband
2251  * is presently busy.
2252  *
2253  * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER
2254  *
2255  * "data" is NULL
2256  * "response" is NULL
2257  *
2258  * Valid errors:
2259  *  SUCCESS
2260  *  RADIO_NOT_AVAILABLE (radio resetting)
2261  *  GENERIC_FAILURE
2262  *  REQUEST_NOT_SUPPORTED
2263  */
2264 
2265 #define RIL_REQUEST_RESET_RADIO 58
2266 
2267 /**
2268  * RIL_REQUEST_OEM_HOOK_RAW
2269  *
2270  * This request reserved for OEM-specific uses. It passes raw byte arrays
2271  * back and forth.
2272  *
2273  * It can be invoked on the Java side from
2274  * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
2275  *
2276  * "data" is a char * of bytes copied from the byte[] data argument in java
2277  * "response" is a char * of bytes that will returned via the
2278  * caller's "response" Message here:
2279  * (byte[])(((AsyncResult)response.obj).result)
2280  *
2281  * An error response here will result in
2282  * (((AsyncResult)response.obj).result) == null and
2283  * (((AsyncResult)response.obj).exception) being an instance of
2284  * com.android.internal.telephony.gsm.CommandException
2285  *
2286  * Valid errors:
2287  *  All
2288  */
2289 
2290 #define RIL_REQUEST_OEM_HOOK_RAW 59
2291 
2292 /**
2293  * RIL_REQUEST_OEM_HOOK_STRINGS
2294  *
2295  * This request reserved for OEM-specific uses. It passes strings
2296  * back and forth.
2297  *
2298  * It can be invoked on the Java side from
2299  * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
2300  *
2301  * "data" is a const char **, representing an array of null-terminated UTF-8
2302  * strings copied from the "String[] strings" argument to
2303  * invokeOemRilRequestStrings()
2304  *
2305  * "response" is a const char **, representing an array of null-terminated UTF-8
2306  * stings that will be returned via the caller's response message here:
2307  *
2308  * (String[])(((AsyncResult)response.obj).result)
2309  *
2310  * An error response here will result in
2311  * (((AsyncResult)response.obj).result) == null and
2312  * (((AsyncResult)response.obj).exception) being an instance of
2313  * com.android.internal.telephony.gsm.CommandException
2314  *
2315  * Valid errors:
2316  *  All
2317  */
2318 
2319 #define RIL_REQUEST_OEM_HOOK_STRINGS 60
2320 
2321 /**
2322  * RIL_REQUEST_SCREEN_STATE
2323  *
2324  * Indicates the current state of the screen.  When the screen is off, the
2325  * RIL should notify the baseband to suppress certain notifications (eg,
2326  * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
2327  * in an effort to conserve power.  These notifications should resume when the
2328  * screen is on.
2329  *
2330  * "data" is int *
2331  * ((int *)data)[0] is == 1 for "Screen On"
2332  * ((int *)data)[0] is == 0 for "Screen Off"
2333  *
2334  * "response" is NULL
2335  *
2336  * Valid errors:
2337  *  SUCCESS
2338  *  GENERIC_FAILURE
2339  */
2340 #define RIL_REQUEST_SCREEN_STATE 61
2341 
2342 
2343 /**
2344  * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
2345  *
2346  * Enables/disables supplementary service related notifications
2347  * from the network.
2348  *
2349  * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
2350  *
2351  * "data" is int *
2352  * ((int *)data)[0] is == 1 for notifications enabled
2353  * ((int *)data)[0] is == 0 for notifications disabled
2354  *
2355  * "response" is NULL
2356  *
2357  * Valid errors:
2358  *  SUCCESS
2359  *  RADIO_NOT_AVAILABLE
2360  *  GENERIC_FAILURE
2361  *
2362  * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
2363  */
2364 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
2365 
2366 /**
2367  * RIL_REQUEST_WRITE_SMS_TO_SIM
2368  *
2369  * Stores a SMS message to SIM memory.
2370  *
2371  * "data" is RIL_SMS_WriteArgs *
2372  *
2373  * "response" is int *
2374  * ((const int *)response)[0] is the record index where the message is stored.
2375  *
2376  * Valid errors:
2377  *  SUCCESS
2378  *  GENERIC_FAILURE
2379  *
2380  */
2381 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
2382 
2383 /**
2384  * RIL_REQUEST_DELETE_SMS_ON_SIM
2385  *
2386  * Deletes a SMS message from SIM memory.
2387  *
2388  * "data" is int  *
2389  * ((int *)data)[0] is the record index of the message to delete.
2390  *
2391  * "response" is NULL
2392  *
2393  * Valid errors:
2394  *  SUCCESS
2395  *  GENERIC_FAILURE
2396  *
2397  */
2398 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
2399 
2400 /**
2401  * RIL_REQUEST_SET_BAND_MODE
2402  *
2403  * Assign a specified band for RF configuration.
2404  *
2405  * "data" is int *
2406  * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
2407  * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
2408  * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
2409  * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
2410  * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
2411  * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
2412  * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
2413  * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
2414  * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
2415  * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
2416  * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
2417  * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
2418  * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
2419  * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
2420  * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
2421  * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
2422  * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
2423  * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
2424  * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
2425  *
2426  * "response" is NULL
2427  *
2428  * Valid errors:
2429  *  SUCCESS
2430  *  RADIO_NOT_AVAILABLE
2431  *  GENERIC_FAILURE
2432  */
2433 #define RIL_REQUEST_SET_BAND_MODE 65
2434 
2435 /**
2436  * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
2437  *
2438  * Query the list of band mode supported by RF.
2439  *
2440  * "data" is NULL
2441  *
2442  * "response" is int *
2443  * "response" points to an array of int's, the int[0] is the size of array, reset is one for
2444  * each available band mode.
2445  *
2446  *  0 for "unspecified" (selected by baseband automatically)
2447  *  1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
2448  *  2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
2449  *  3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
2450  *  4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
2451  *  5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
2452  *  6 for "Cellular (800-MHz Band)"
2453  *  7 for "PCS (1900-MHz Band)"
2454  *  8 for "Band Class 3 (JTACS Band)"
2455  *  9 for "Band Class 4 (Korean PCS Band)"
2456  *  10 for "Band Class 5 (450-MHz Band)"
2457  *  11 for "Band Class 6 (2-GMHz IMT2000 Band)"
2458  *  12 for "Band Class 7 (Upper 700-MHz Band)"
2459  *  13 for "Band Class 8 (1800-MHz Band)"
2460  *  14 for "Band Class 9 (900-MHz Band)"
2461  *  15 for "Band Class 10 (Secondary 800-MHz Band)"
2462  *  16 for "Band Class 11 (400-MHz European PAMR Band)"
2463  *  17 for "Band Class 15 (AWS Band)"
2464  *  18 for "Band Class 16 (US 2.5-GHz Band)"
2465  *
2466  * Valid errors:
2467  *  SUCCESS
2468  *  RADIO_NOT_AVAILABLE
2469  *  GENERIC_FAILURE
2470  *
2471  * See also: RIL_REQUEST_SET_BAND_MODE
2472  */
2473 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
2474 
2475 /**
2476  * RIL_REQUEST_STK_GET_PROFILE
2477  *
2478  * Requests the profile of SIM tool kit.
2479  * The profile indicates the SAT/USAT features supported by ME.
2480  * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
2481  *
2482  * "data" is NULL
2483  *
2484  * "response" is a const char * containing SAT/USAT profile
2485  * in hexadecimal format string starting with first byte of terminal profile
2486  *
2487  * Valid errors:
2488  *  RIL_E_SUCCESS
2489  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
2490  *  RIL_E_GENERIC_FAILURE
2491  */
2492 #define RIL_REQUEST_STK_GET_PROFILE 67
2493 
2494 /**
2495  * RIL_REQUEST_STK_SET_PROFILE
2496  *
2497  * Download the STK terminal profile as part of SIM initialization
2498  * procedure
2499  *
2500  * "data" is a const char * containing SAT/USAT profile
2501  * in hexadecimal format string starting with first byte of terminal profile
2502  *
2503  * "response" is NULL
2504  *
2505  * Valid errors:
2506  *  RIL_E_SUCCESS
2507  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
2508  *  RIL_E_GENERIC_FAILURE
2509  */
2510 #define RIL_REQUEST_STK_SET_PROFILE 68
2511 
2512 /**
2513  * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
2514  *
2515  * Requests to send a SAT/USAT envelope command to SIM.
2516  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
2517  *
2518  * "data" is a const char * containing SAT/USAT command
2519  * in hexadecimal format string starting with command tag
2520  *
2521  * "response" is a const char * containing SAT/USAT response
2522  * in hexadecimal format string starting with first byte of response
2523  * (May be NULL)
2524  *
2525  * Valid errors:
2526  *  RIL_E_SUCCESS
2527  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
2528  *  RIL_E_GENERIC_FAILURE
2529  */
2530 #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
2531 
2532 /**
2533  * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
2534  *
2535  * Requests to send a terminal response to SIM for a received
2536  * proactive command
2537  *
2538  * "data" is a const char * containing SAT/USAT response
2539  * in hexadecimal format string starting with first byte of response data
2540  *
2541  * "response" is NULL
2542  *
2543  * Valid errors:
2544  *  RIL_E_SUCCESS
2545  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
2546  *  RIL_E_GENERIC_FAILURE
2547  */
2548 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
2549 
2550 /**
2551  * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
2552  *
2553  * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
2554  * been initialized by ME already. (We could see the call has been in the 'call
2555  * list') So, STK application needs to accept/reject the call according as user
2556  * operations.
2557  *
2558  * "data" is int *
2559  * ((int *)data)[0] is > 0 for "accept" the call setup
2560  * ((int *)data)[0] is == 0 for "reject" the call setup
2561  *
2562  * "response" is NULL
2563  *
2564  * Valid errors:
2565  *  RIL_E_SUCCESS
2566  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
2567  *  RIL_E_GENERIC_FAILURE
2568  */
2569 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
2570 
2571 /**
2572  * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
2573  *
2574  * Connects the two calls and disconnects the subscriber from both calls.
2575  *
2576  * "data" is NULL
2577  * "response" is NULL
2578  *
2579  * Valid errors:
2580  *  SUCCESS
2581  *  RADIO_NOT_AVAILABLE (radio resetting)
2582  *  GENERIC_FAILURE
2583  */
2584 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
2585 
2586 /**
2587  * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
2588  *
2589  * Requests to set the preferred network type for searching and registering
2590  * (CS/PS domain, RAT, and operation mode)
2591  *
2592  * "data" is int * which is RIL_PreferredNetworkType
2593  *
2594  * "response" is NULL
2595  *
2596  * Valid errors:
2597  *  SUCCESS
2598  *  RADIO_NOT_AVAILABLE (radio resetting)
2599  *  GENERIC_FAILURE
2600  *  MODE_NOT_SUPPORTED
2601  */
2602 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
2603 
2604 /**
2605  * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
2606  *
2607  * Query the preferred network type (CS/PS domain, RAT, and operation mode)
2608  * for searching and registering
2609  *
2610  * "data" is NULL
2611  *
2612  * "response" is int *
2613  * ((int *)reponse)[0] is == RIL_PreferredNetworkType
2614  *
2615  * Valid errors:
2616  *  SUCCESS
2617  *  RADIO_NOT_AVAILABLE
2618  *  GENERIC_FAILURE
2619  *
2620  * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
2621  */
2622 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
2623 
2624 /**
2625  * RIL_REQUEST_NEIGHBORING_CELL_IDS
2626  *
2627  * Request neighboring cell id in GSM network
2628  *
2629  * "data" is NULL
2630  * "response" must be a " const RIL_NeighboringCell** "
2631  *
2632  * Valid errors:
2633  *  SUCCESS
2634  *  RADIO_NOT_AVAILABLE
2635  *  GENERIC_FAILURE
2636  */
2637 #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
2638 
2639 /**
2640  * RIL_REQUEST_SET_LOCATION_UPDATES
2641  *
2642  * Enables/disables network state change notifications due to changes in
2643  * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
2644  * Basically +CREG=2 vs. +CREG=1 (TS 27.007).
2645  *
2646  * Note:  The RIL implementation should default to "updates enabled"
2647  * when the screen is on and "updates disabled" when the screen is off.
2648  *
2649  * "data" is int *
2650  * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
2651  * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
2652  *
2653  * "response" is NULL
2654  *
2655  * Valid errors:
2656  *  SUCCESS
2657  *  RADIO_NOT_AVAILABLE
2658  *  GENERIC_FAILURE
2659  *
2660  * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
2661  */
2662 #define RIL_REQUEST_SET_LOCATION_UPDATES 76
2663 
2664 /**
2665  * RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
2666  *
2667  * Request to set the location where the CDMA subscription shall
2668  * be retrieved
2669  *
2670  * "data" is int *
2671  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
2672  *
2673  * "response" is NULL
2674  *
2675  * Valid errors:
2676  *  SUCCESS
2677  *  RADIO_NOT_AVAILABLE
2678  *  GENERIC_FAILURE
2679  *  SIM_ABSENT
2680  *  SUBSCRIPTION_NOT_AVAILABLE
2681  *
2682  * See also: RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
2683  */
2684 #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 77
2685 
2686 /**
2687  * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE
2688  *
2689  * Request to set the roaming preferences in CDMA
2690  *
2691  * "data" is int *
2692  * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL
2693  * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
2694  * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL
2695  *
2696  * "response" is NULL
2697  *
2698  * Valid errors:
2699  *  SUCCESS
2700  *  RADIO_NOT_AVAILABLE
2701  *  GENERIC_FAILURE
2702  */
2703 #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78
2704 
2705 /**
2706  * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE
2707  *
2708  * Request the actual setting of the roaming preferences in CDMA in the modem
2709  *
2710  * "data" is NULL
2711  *
2712  * "response" is int *
2713  * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL
2714  * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
2715  * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL
2716  *
2717  * "response" is NULL
2718  *
2719  * Valid errors:
2720  *  SUCCESS
2721  *  RADIO_NOT_AVAILABLE
2722  *  GENERIC_FAILURE
2723  */
2724 #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79
2725 
2726 /**
2727  * RIL_REQUEST_SET_TTY_MODE
2728  *
2729  * Request to set the TTY mode
2730  *
2731  * "data" is int *
2732  * ((int *)data)[0] is == 0 for TTY off
2733  * ((int *)data)[0] is == 1 for TTY Full
2734  * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover)
2735  * ((int *)data)[0] is == 3 for TTY VCO (voice carryover)
2736  *
2737  * "response" is NULL
2738  *
2739  * Valid errors:
2740  *  SUCCESS
2741  *  RADIO_NOT_AVAILABLE
2742  *  GENERIC_FAILURE
2743  */
2744 #define RIL_REQUEST_SET_TTY_MODE 80
2745 
2746 /**
2747  * RIL_REQUEST_QUERY_TTY_MODE
2748  *
2749  * Request the setting of TTY mode
2750  *
2751  * "data" is NULL
2752  *
2753  * "response" is int *
2754  * ((int *)response)[0] is == 0 for TTY off
2755  * ((int *)response)[0] is == 1 for TTY Full
2756  * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover)
2757  * ((int *)response)[0] is == 3 for TTY VCO (voice carryover)
2758  *
2759  * "response" is NULL
2760  *
2761  * Valid errors:
2762  *  SUCCESS
2763  *  RADIO_NOT_AVAILABLE
2764  *  GENERIC_FAILURE
2765  */
2766 #define RIL_REQUEST_QUERY_TTY_MODE 81
2767 
2768 /**
2769  * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE
2770  *
2771  * Request to set the preferred voice privacy mode used in voice
2772  * scrambling
2773  *
2774  * "data" is int *
2775  * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
2776  * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
2777  *
2778  * "response" is NULL
2779  *
2780  * Valid errors:
2781  *  SUCCESS
2782  *  RADIO_NOT_AVAILABLE
2783  *  GENERIC_FAILURE
2784  */
2785 #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82
2786 
2787 /**
2788  * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE
2789  *
2790  * Request the setting of preferred voice privacy mode
2791  *
2792  * "data" is NULL
2793  *
2794  * "response" is int *
2795  * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
2796  * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
2797  *
2798  * "response" is NULL
2799  *
2800  * Valid errors:
2801  *  SUCCESS
2802  *  RADIO_NOT_AVAILABLE
2803  *  GENERIC_FAILURE
2804  */
2805 #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83
2806 
2807 /**
2808  * RIL_REQUEST_CDMA_FLASH
2809  *
2810  * Send FLASH
2811  *
2812  * "data" is const char *
2813  * ((const char *)data)[0] is a FLASH string
2814  *
2815  * "response" is NULL
2816  *
2817  * Valid errors:
2818  *  SUCCESS
2819  *  RADIO_NOT_AVAILABLE
2820  *  GENERIC_FAILURE
2821  *
2822  */
2823 #define RIL_REQUEST_CDMA_FLASH 84
2824 
2825 /**
2826  * RIL_REQUEST_CDMA_BURST_DTMF
2827  *
2828  * Send DTMF string
2829  *
2830  * "data" is const char **
2831  * ((const char **)data)[0] is a DTMF string
2832  * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use
2833  *                          default
2834  * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use
2835  *                          default
2836  *
2837  * "response" is NULL
2838  *
2839  * Valid errors:
2840  *  SUCCESS
2841  *  RADIO_NOT_AVAILABLE
2842  *  GENERIC_FAILURE
2843  *
2844  */
2845 #define RIL_REQUEST_CDMA_BURST_DTMF 85
2846 
2847 /**
2848  * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY
2849  *
2850  * Takes a 26 digit string (20 digit AKEY + 6 digit checksum).
2851  * If the checksum is valid the 20 digit AKEY is written to NV,
2852  * replacing the existing AKEY no matter what it was before.
2853  *
2854  * "data" is const char *
2855  * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9')
2856  *                         where the last 6 digits are a checksum of the
2857  *                         first 20, as specified in TR45.AHAG
2858  *                         "Common Cryptographic Algorithms, Revision D.1
2859  *                         Section 2.2"
2860  *
2861  * "response" is NULL
2862  *
2863  * Valid errors:
2864  *  SUCCESS
2865  *  RADIO_NOT_AVAILABLE
2866  *  GENERIC_FAILURE
2867  *
2868  */
2869 #define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86
2870 
2871 /**
2872  * RIL_REQUEST_CDMA_SEND_SMS
2873  *
2874  * Send a CDMA SMS message
2875  *
2876  * "data" is const RIL_CDMA_SMS_Message *
2877  *
2878  * "response" is a const RIL_SMS_Response *
2879  *
2880  * Based on the return error, caller decides to resend if sending sms
2881  * fails. The CDMA error class is derived as follows,
2882  * SUCCESS is error class 0 (no error)
2883  * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure)
2884  * and GENERIC_FAILURE is error class 3 (permanent and no retry)
2885  *
2886  * Valid errors:
2887  *  SUCCESS
2888  *  RADIO_NOT_AVAILABLE
2889  *  SMS_SEND_FAIL_RETRY
2890  *  GENERIC_FAILURE
2891  *
2892  */
2893 #define RIL_REQUEST_CDMA_SEND_SMS 87
2894 
2895 /**
2896  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
2897  *
2898  * Acknowledge the success or failure in the receipt of SMS
2899  * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
2900  *
2901  * "data" is const RIL_CDMA_SMS_Ack *
2902  *
2903  * "response" is NULL
2904  *
2905  * Valid errors:
2906  *  SUCCESS
2907  *  RADIO_NOT_AVAILABLE
2908  *  GENERIC_FAILURE
2909  *
2910  */
2911 #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88
2912 
2913 /**
2914  * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG
2915  *
2916  * Request the setting of GSM/WCDMA Cell Broadcast SMS config.
2917  *
2918  * "data" is NULL
2919  *
2920  * "response" is a const RIL_GSM_BroadcastSmsConfigInfo **
2921  * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *)
2922  *
2923  * Valid errors:
2924  *  SUCCESS
2925  *  RADIO_NOT_AVAILABLE
2926  *  GENERIC_FAILURE
2927  *
2928  */
2929 #define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89
2930 
2931 /**
2932  * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG
2933  *
2934  * Set GSM/WCDMA Cell Broadcast SMS config
2935  *
2936  * "data" is a const RIL_GSM_BroadcastSmsConfigInfo **
2937  * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *)
2938  *
2939  * "response" is NULL
2940  *
2941  * Valid errors:
2942  *  SUCCESS
2943  *  RADIO_NOT_AVAILABLE
2944  *  GENERIC_FAILURE
2945  *
2946  */
2947 #define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90
2948 
2949 /**
2950  * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION
2951  *
2952 * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
2953  *
2954  * "data" is const int *
2955  * (const int *)data[0] indicates to activate or turn off the
2956  * reception of GSM/WCDMA Cell Broadcast SMS, 0-1,
2957  *                       0 - Activate, 1 - Turn off
2958  *
2959  * "response" is NULL
2960  *
2961  * Valid errors:
2962  *  SUCCESS
2963  *  RADIO_NOT_AVAILABLE
2964  *  GENERIC_FAILURE
2965  *
2966  */
2967 #define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91
2968 
2969 /**
2970  * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG
2971  *
2972  * Request the setting of CDMA Broadcast SMS config
2973  *
2974  * "data" is NULL
2975  *
2976  * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo **
2977  * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *)
2978  *
2979  * Valid errors:
2980  *  SUCCESS
2981  *  RADIO_NOT_AVAILABLE
2982  *  GENERIC_FAILURE
2983  *
2984  */
2985 #define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92
2986 
2987 /**
2988  * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG
2989  *
2990  * Set CDMA Broadcast SMS config
2991  *
2992  * "data" is an const RIL_CDMA_BroadcastSmsConfigInfo **
2993  * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *)
2994  *
2995  * "response" is NULL
2996  *
2997  * Valid errors:
2998  *  SUCCESS
2999  *  RADIO_NOT_AVAILABLE
3000  *  GENERIC_FAILURE
3001  *
3002  */
3003 #define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93
3004 
3005 /**
3006  * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION
3007  *
3008  * Enable or disable the reception of CDMA Broadcast SMS
3009  *
3010  * "data" is const int *
3011  * (const int *)data[0] indicates to activate or turn off the
3012  * reception of CDMA Broadcast SMS, 0-1,
3013  *                       0 - Activate, 1 - Turn off
3014  *
3015  * "response" is NULL
3016  *
3017  * Valid errors:
3018  *  SUCCESS
3019  *  RADIO_NOT_AVAILABLE
3020  *  GENERIC_FAILURE
3021  *
3022  */
3023 #define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94
3024 
3025 /**
3026  * RIL_REQUEST_CDMA_SUBSCRIPTION
3027  *
3028  * Request the device MDN / H_SID / H_NID.
3029  *
3030  * The request is only allowed when CDMA subscription is available.  When CDMA
3031  * subscription is changed, application layer should re-issue the request to
3032  * update the subscription information.
3033  *
3034  * If a NULL value is returned for any of the device id, it means that error
3035  * accessing the device.
3036  *
3037  * "response" is const char **
3038  * ((const char **)response)[0] is MDN if CDMA subscription is available
3039  * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if
3040  *                              CDMA subscription is available, in decimal format
3041  * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if
3042  *                              CDMA subscription is available, in decimal format
3043  * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
3044  * ((const char **)response)[4] is PRL version if CDMA subscription is available
3045  *
3046  * Valid errors:
3047  *  SUCCESS
3048  *  RIL_E_SUBSCRIPTION_NOT_AVAILABLE
3049  */
3050 
3051 #define RIL_REQUEST_CDMA_SUBSCRIPTION 95
3052 
3053 /**
3054  * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
3055  *
3056  * Stores a CDMA SMS message to RUIM memory.
3057  *
3058  * "data" is RIL_CDMA_SMS_WriteArgs *
3059  *
3060  * "response" is int *
3061  * ((const int *)response)[0] is the record index where the message is stored.
3062  *
3063  * Valid errors:
3064  *  SUCCESS
3065  *  RADIO_NOT_AVAILABLE
3066  *  GENERIC_FAILURE
3067  *
3068  */
3069 #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96
3070 
3071 /**
3072  * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
3073  *
3074  * Deletes a CDMA SMS message from RUIM memory.
3075  *
3076  * "data" is int  *
3077  * ((int *)data)[0] is the record index of the message to delete.
3078  *
3079  * "response" is NULL
3080  *
3081  * Valid errors:
3082  *  SUCCESS
3083  *  RADIO_NOT_AVAILABLE
3084  *  GENERIC_FAILURE
3085  *
3086  */
3087 #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97
3088 
3089 /**
3090  * RIL_REQUEST_DEVICE_IDENTITY
3091  *
3092  * Request the device ESN / MEID / IMEI / IMEISV.
3093  *
3094  * The request is always allowed and contains GSM and CDMA device identity;
3095  * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and
3096  * RIL_REQUEST_GET_IMEISV.
3097  *
3098  * If a NULL value is returned for any of the device id, it means that error
3099  * accessing the device.
3100  *
3101  * When CDMA subscription is changed the ESN/MEID may change.  The application
3102  * layer should re-issue the request to update the device identity in this case.
3103  *
3104  * "response" is const char **
3105  * ((const char **)response)[0] is IMEI if GSM subscription is available
3106  * ((const char **)response)[1] is IMEISV if GSM subscription is available
3107  * ((const char **)response)[2] is ESN if CDMA subscription is available
3108  * ((const char **)response)[3] is MEID if CDMA subscription is available
3109  *
3110  * Valid errors:
3111  *  SUCCESS
3112  *  RADIO_NOT_AVAILABLE
3113  *  GENERIC_FAILURE
3114  */
3115 #define RIL_REQUEST_DEVICE_IDENTITY 98
3116 
3117 /**
3118  * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE
3119  *
3120  * Request the radio's system selection module to exit emergency
3121  * callback mode.  RIL will not respond with SUCCESS until the modem has
3122  * completely exited from Emergency Callback Mode.
3123  *
3124  * "data" is NULL
3125  *
3126  * "response" is NULL
3127  *
3128  * Valid errors:
3129  *  SUCCESS
3130  *  RADIO_NOT_AVAILABLE
3131  *  GENERIC_FAILURE
3132  *
3133  */
3134 #define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99
3135 
3136 /**
3137  * RIL_REQUEST_GET_SMSC_ADDRESS
3138  *
3139  * Queries the default Short Message Service Center address on the device.
3140  *
3141  * "data" is NULL
3142  *
3143  * "response" is const char * containing the SMSC address.
3144  *
3145  * Valid errors:
3146  *  SUCCESS
3147  *  RADIO_NOT_AVAILABLE
3148  *  GENERIC_FAILURE
3149  *
3150  */
3151 #define RIL_REQUEST_GET_SMSC_ADDRESS 100
3152 
3153 /**
3154  * RIL_REQUEST_SET_SMSC_ADDRESS
3155  *
3156  * Sets the default Short Message Service Center address on the device.
3157  *
3158  * "data" is const char * containing the SMSC address.
3159  *
3160  * "response" is NULL
3161  *
3162  * Valid errors:
3163  *  SUCCESS
3164  *  RADIO_NOT_AVAILABLE
3165  *  GENERIC_FAILURE
3166  *
3167  */
3168 #define RIL_REQUEST_SET_SMSC_ADDRESS 101
3169 
3170 /**
3171  * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS
3172  *
3173  * Indicates whether there is storage available for new SMS messages.
3174  *
3175  * "data" is int *
3176  * ((int *)data)[0] is 1 if memory is available for storing new messages
3177  *                  is 0 if memory capacity is exceeded
3178  *
3179  * "response" is NULL
3180  *
3181  * Valid errors:
3182  *  SUCCESS
3183  *  RADIO_NOT_AVAILABLE
3184  *  GENERIC_FAILURE
3185  *
3186  */
3187 #define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102
3188 
3189 /**
3190  * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING
3191  *
3192  * Indicates that the StkSerivce is running and is
3193  * ready to receive RIL_UNSOL_STK_XXXXX commands.
3194  *
3195  * "data" is NULL
3196  * "response" is NULL
3197  *
3198  * Valid errors:
3199  *  SUCCESS
3200  *  RADIO_NOT_AVAILABLE
3201  *  GENERIC_FAILURE
3202  *
3203  */
3204 #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103
3205 
3206 /**
3207  * RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
3208  *
3209  * Request to query the location where the CDMA subscription shall
3210  * be retrieved
3211  *
3212  * "data" is NULL
3213  *
3214  * "response" is int *
3215  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
3216  *
3217  * Valid errors:
3218  *  SUCCESS
3219  *  RADIO_NOT_AVAILABLE
3220  *  GENERIC_FAILURE
3221  *  SUBSCRIPTION_NOT_AVAILABLE
3222  *
3223  * See also: RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
3224  */
3225 #define RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 104
3226 
3227 /**
3228  * RIL_REQUEST_ISIM_AUTHENTICATION
3229  *
3230  * Request the ISIM application on the UICC to perform AKA
3231  * challenge/response algorithm for IMS authentication
3232  *
3233  * "data" is a const char * containing the challenge string in Base64 format
3234  * "response" is a const char * containing the response in Base64 format
3235  *
3236  * Valid errors:
3237  *  SUCCESS
3238  *  RADIO_NOT_AVAILABLE
3239  *  GENERIC_FAILURE
3240  */
3241 #define RIL_REQUEST_ISIM_AUTHENTICATION 105
3242 
3243 /**
3244  * RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU
3245  *
3246  * Acknowledge successful or failed receipt of SMS previously indicated
3247  * via RIL_UNSOL_RESPONSE_NEW_SMS, including acknowledgement TPDU to send
3248  * as the RP-User-Data element of the RP-ACK or RP-ERROR PDU.
3249  *
3250  * "data" is const char **
3251  * ((const char **)data)[0] is "1" on successful receipt (send RP-ACK)
3252  *                          is "0" on failed receipt (send RP-ERROR)
3253  * ((const char **)data)[1] is the acknowledgement TPDU in hexadecimal format
3254  *
3255  * "response" is NULL
3256  *
3257  * Valid errors:
3258  *  SUCCESS
3259  *  RADIO_NOT_AVAILABLE
3260  *  GENERIC_FAILURE
3261  */
3262 #define RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 106
3263 
3264 /**
3265  * RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS
3266  *
3267  * Requests to send a SAT/USAT envelope command to SIM.
3268  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111.
3269  *
3270  * This request has one difference from RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND:
3271  * the SW1 and SW2 status bytes from the UICC response are returned along with
3272  * the response data, using the same structure as RIL_REQUEST_SIM_IO.
3273  *
3274  * The RIL implementation shall perform the normal processing of a '91XX'
3275  * response in SW1/SW2 to retrieve the pending proactive command and send it
3276  * as an unsolicited response, as RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND does.
3277  *
3278  * "data" is a const char * containing the SAT/USAT command
3279  * in hexadecimal format starting with command tag
3280  *
3281  * "response" is a const RIL_SIM_IO_Response *
3282  *
3283  * Valid errors:
3284  *  RIL_E_SUCCESS
3285  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3286  *  RIL_E_GENERIC_FAILURE
3287  */
3288 #define RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 107
3289 
3290 /**
3291  * RIL_REQUEST_VOICE_RADIO_TECH
3292  *
3293  * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only
3294  * when radio state is RADIO_STATE_ON
3295  *
3296  * "data" is NULL
3297  * "response" is int *
3298  * ((int *) response)[0] is of type const RIL_RadioTechnology
3299  *
3300  * Valid errors:
3301  *  SUCCESS
3302  *  RADIO_NOT_AVAILABLE
3303  *  GENERIC_FAILURE
3304  */
3305 #define RIL_REQUEST_VOICE_RADIO_TECH 108
3306 
3307 
3308 /***********************************************************************/
3309 
3310 
3311 #define RIL_UNSOL_RESPONSE_BASE 1000
3312 
3313 /**
3314  * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
3315  *
3316  * Indicate when value of RIL_RadioState has changed.
3317  *
3318  * Callee will invoke RIL_RadioStateRequest method on main thread
3319  *
3320  * "data" is NULL
3321  */
3322 
3323 #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
3324 
3325 
3326 /**
3327  * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
3328  *
3329  * Indicate when call state has changed
3330  *
3331  * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
3332  *
3333  * "data" is NULL
3334  *
3335  * Response should be invoked on, for example,
3336  * "RING", "BUSY", "NO CARRIER", and also call state
3337  * transitions (DIALING->ALERTING ALERTING->ACTIVE)
3338  *
3339  * Redundent or extraneous invocations are tolerated
3340  */
3341 #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
3342 
3343 
3344 /**
3345  * RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
3346  *
3347  * Called when the voice network state changed
3348  *
3349  * Callee will invoke the following requests on main thread:
3350  *
3351  * RIL_REQUEST_VOICE_REGISTRATION_STATE
3352  * RIL_REQUEST_OPERATOR
3353  *
3354  * "data" is NULL
3355  *
3356  * FIXME should this happen when SIM records are loaded? (eg, for
3357  * EONS)
3358  */
3359 #define RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 1002
3360 
3361 /**
3362  * RIL_UNSOL_RESPONSE_NEW_SMS
3363  *
3364  * Called when new SMS is received.
3365  *
3366  * "data" is const char *
3367  * This is a pointer to a string containing the PDU of an SMS-DELIVER
3368  * as an ascii string of hex digits. The PDU starts with the SMSC address
3369  * per TS 27.005 (+CMT:)
3370  *
3371  * Callee will subsequently confirm the receipt of thei SMS with a
3372  * RIL_REQUEST_SMS_ACKNOWLEDGE
3373  *
3374  * No new RIL_UNSOL_RESPONSE_NEW_SMS
3375  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
3376  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
3377  */
3378 
3379 #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
3380 
3381 /**
3382  * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
3383  *
3384  * Called when new SMS Status Report is received.
3385  *
3386  * "data" is const char *
3387  * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
3388  * as an ascii string of hex digits. The PDU starts with the SMSC address
3389  * per TS 27.005 (+CDS:).
3390  *
3391  * Callee will subsequently confirm the receipt of the SMS with a
3392  * RIL_REQUEST_SMS_ACKNOWLEDGE
3393  *
3394  * No new RIL_UNSOL_RESPONSE_NEW_SMS
3395  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
3396  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
3397  */
3398 
3399 #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
3400 
3401 /**
3402  * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
3403  *
3404  * Called when new SMS has been stored on SIM card
3405  *
3406  * "data" is const int *
3407  * ((const int *)data)[0] contains the slot index on the SIM that contains
3408  * the new message
3409  */
3410 
3411 #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
3412 
3413 /**
3414  * RIL_UNSOL_ON_USSD
3415  *
3416  * Called when a new USSD message is received.
3417  *
3418  * "data" is const char **
3419  * ((const char **)data)[0] points to a type code, which is
3420  *  one of these string values:
3421  *      "0"   USSD-Notify -- text in ((const char **)data)[1]
3422  *      "1"   USSD-Request -- text in ((const char **)data)[1]
3423  *      "2"   Session terminated by network
3424  *      "3"   other local client (eg, SIM Toolkit) has responded
3425  *      "4"   Operation not supported
3426  *      "5"   Network timeout
3427  *
3428  * The USSD session is assumed to persist if the type code is "1", otherwise
3429  * the current session (if any) is assumed to have terminated.
3430  *
3431  * ((const char **)data)[1] points to a message string if applicable, which
3432  * should always be in UTF-8.
3433  */
3434 #define RIL_UNSOL_ON_USSD 1006
3435 /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006   */
3436 
3437 /**
3438  * RIL_UNSOL_ON_USSD_REQUEST
3439  *
3440  * Obsolete. Send via RIL_UNSOL_ON_USSD
3441  */
3442 #define RIL_UNSOL_ON_USSD_REQUEST 1007
3443 
3444 
3445 /**
3446  * RIL_UNSOL_NITZ_TIME_RECEIVED
3447  *
3448  * Called when radio has received a NITZ time message
3449  *
3450  * "data" is const char * pointing to NITZ time string
3451  * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
3452  */
3453 #define RIL_UNSOL_NITZ_TIME_RECEIVED  1008
3454 
3455 /**
3456  * RIL_UNSOL_SIGNAL_STRENGTH
3457  *
3458  * Radio may report signal strength rather han have it polled.
3459  *
3460  * "data" is a const RIL_SignalStrength *
3461  */
3462 #define RIL_UNSOL_SIGNAL_STRENGTH  1009
3463 
3464 
3465 /**
3466  * RIL_UNSOL_DATA_CALL_LIST_CHANGED
3467  *
3468  * "data" is an array of RIL_Data_Call_Response_v6 identical to that
3469  * returned by RIL_REQUEST_DATA_CALL_LIST. It is the complete list
3470  * of current data contexts including new contexts that have been
3471  * activated. A data call is only removed from this list when the
3472  * framework sends a RIL_REQUEST_DEACTIVATE_DATA_CALL or the radio
3473  * is powered off/on.
3474  *
3475  * See also: RIL_REQUEST_DATA_CALL_LIST
3476  */
3477 
3478 #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010
3479 
3480 /**
3481  * RIL_UNSOL_SUPP_SVC_NOTIFICATION
3482  *
3483  * Reports supplementary service related notification from the network.
3484  *
3485  * "data" is a const RIL_SuppSvcNotification *
3486  *
3487  */
3488 
3489 #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
3490 
3491 /**
3492  * RIL_UNSOL_STK_SESSION_END
3493  *
3494  * Indicate when STK session is terminated by SIM.
3495  *
3496  * "data" is NULL
3497  */
3498 #define RIL_UNSOL_STK_SESSION_END 1012
3499 
3500 /**
3501  * RIL_UNSOL_STK_PROACTIVE_COMMAND
3502  *
3503  * Indicate when SIM issue a STK proactive command to applications
3504  *
3505  * "data" is a const char * containing SAT/USAT proactive command
3506  * in hexadecimal format string starting with command tag
3507  *
3508  */
3509 #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
3510 
3511 /**
3512  * RIL_UNSOL_STK_EVENT_NOTIFY
3513  *
3514  * Indicate when SIM notifies applcations some event happens.
3515  * Generally, application does not need to have any feedback to
3516  * SIM but shall be able to indicate appropriate messages to users.
3517  *
3518  * "data" is a const char * containing SAT/USAT commands or responses
3519  * sent by ME to SIM or commands handled by ME, in hexadecimal format string
3520  * starting with first byte of response data or command tag
3521  *
3522  */
3523 #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
3524 
3525 /**
3526  * RIL_UNSOL_STK_CALL_SETUP
3527  *
3528  * Indicate when SIM wants application to setup a voice call.
3529  *
3530  * "data" is const int *
3531  * ((const int *)data)[0] contains timeout value (in milliseconds)
3532  */
3533 #define RIL_UNSOL_STK_CALL_SETUP 1015
3534 
3535 /**
3536  * RIL_UNSOL_SIM_SMS_STORAGE_FULL
3537  *
3538  * Indicates that SMS storage on the SIM is full.  Sent when the network
3539  * attempts to deliver a new SMS message.  Messages cannot be saved on the
3540  * SIM until space is freed.  In particular, incoming Class 2 messages
3541  * cannot be stored.
3542  *
3543  * "data" is null
3544  *
3545  */
3546 #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
3547 
3548 /**
3549  * RIL_UNSOL_SIM_REFRESH
3550  *
3551  * Indicates that file(s) on the SIM have been updated, or the SIM
3552  * has been reinitialized.
3553  *
3554  * In the case where RIL is version 6 or older:
3555  * "data" is an int *
3556  * ((int *)data)[0] is a RIL_SimRefreshResult.
3557  * ((int *)data)[1] is the EFID of the updated file if the result is
3558  * SIM_FILE_UPDATE or NULL for any other result.
3559  *
3560  * In the case where RIL is version 7:
3561  * "data" is a RIL_SimRefreshResponse_v7 *
3562  *
3563  * Note: If the SIM state changes as a result of the SIM refresh (eg,
3564  * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
3565  * should be sent.
3566  */
3567 #define RIL_UNSOL_SIM_REFRESH 1017
3568 
3569 /**
3570  * RIL_UNSOL_CALL_RING
3571  *
3572  * Ring indication for an incoming call (eg, RING or CRING event).
3573  * There must be at least one RIL_UNSOL_CALL_RING at the beginning
3574  * of a call and sending multiple is optional. If the system property
3575  * ro.telephony.call_ring.multiple is false then the upper layers
3576  * will generate the multiple events internally. Otherwise the vendor
3577  * ril must generate multiple RIL_UNSOL_CALL_RING if
3578  * ro.telephony.call_ring.multiple is true or if it is absent.
3579  *
3580  * The rate of these events is controlled by ro.telephony.call_ring.delay
3581  * and has a default value of 3000 (3 seconds) if absent.
3582  *
3583  * "data" is null for GSM
3584  * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA
3585  */
3586 #define RIL_UNSOL_CALL_RING 1018
3587 
3588 /**
3589  * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
3590  *
3591  * Indicates that SIM state changes.
3592  *
3593  * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread
3594 
3595  * "data" is null
3596  */
3597 #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019
3598 
3599 /**
3600  * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
3601  *
3602  * Called when new CDMA SMS is received
3603  *
3604  * "data" is const RIL_CDMA_SMS_Message *
3605  *
3606  * Callee will subsequently confirm the receipt of the SMS with
3607  * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
3608  *
3609  * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until
3610  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received
3611  *
3612  */
3613 #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020
3614 
3615 /**
3616  * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS
3617  *
3618  * Called when new Broadcast SMS is received
3619  *
3620  * "data" can be one of the following:
3621  * If received from GSM network, "data" is const char of 88 bytes
3622  * which indicates each page of a CBS Message sent to the MS by the
3623  * BTS as coded in 3GPP 23.041 Section 9.4.1.2.
3624  * If received from UMTS network, "data" is const char of 90 up to 1252
3625  * bytes which contain between 1 and 15 CBS Message pages sent as one
3626  * packet to the MS by the BTS as coded in 3GPP 23.041 Section 9.4.2.2.
3627  *
3628  */
3629 #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021
3630 
3631 /**
3632  * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL
3633  *
3634  * Indicates that SMS storage on the RUIM is full.  Messages
3635  * cannot be saved on the RUIM until space is freed.
3636  *
3637  * "data" is null
3638  *
3639  */
3640 #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022
3641 
3642 /**
3643  * RIL_UNSOL_RESTRICTED_STATE_CHANGED
3644  *
3645  * Indicates a restricted state change (eg, for Domain Specific Access Control).
3646  *
3647  * Radio need send this msg after radio off/on cycle no matter it is changed or not.
3648  *
3649  * "data" is an int *
3650  * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values.
3651  */
3652 #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023
3653 
3654 /**
3655  * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE
3656  *
3657  * Indicates that the radio system selection module has
3658  * autonomously entered emergency callback mode.
3659  *
3660  * "data" is null
3661  *
3662  */
3663 #define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024
3664 
3665 /**
3666  * RIL_UNSOL_CDMA_CALL_WAITING
3667  *
3668  * Called when CDMA radio receives a call waiting indication.
3669  *
3670  * "data" is const RIL_CDMA_CallWaiting *
3671  *
3672  */
3673 #define RIL_UNSOL_CDMA_CALL_WAITING 1025
3674 
3675 /**
3676  * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS
3677  *
3678  * Called when CDMA radio receives an update of the progress of an
3679  * OTASP/OTAPA call.
3680  *
3681  * "data" is const int *
3682  *  For CDMA this is an integer OTASP/OTAPA status listed in
3683  *  RIL_CDMA_OTA_ProvisionStatus.
3684  *
3685  */
3686 #define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026
3687 
3688 /**
3689  * RIL_UNSOL_CDMA_INFO_REC
3690  *
3691  * Called when CDMA radio receives one or more info recs.
3692  *
3693  * "data" is const RIL_CDMA_InformationRecords *
3694  *
3695  */
3696 #define RIL_UNSOL_CDMA_INFO_REC 1027
3697 
3698 /**
3699  * RIL_UNSOL_OEM_HOOK_RAW
3700  *
3701  * This is for OEM specific use.
3702  *
3703  * "data" is a byte[]
3704  */
3705 #define RIL_UNSOL_OEM_HOOK_RAW 1028
3706 
3707 /**
3708  * RIL_UNSOL_RINGBACK_TONE
3709  *
3710  * Indicates that nework doesn't have in-band information,  need to
3711  * play out-band tone.
3712  *
3713  * "data" is an int *
3714  * ((int *)data)[0] == 0 for stop play ringback tone.
3715  * ((int *)data)[0] == 1 for start play ringback tone.
3716  */
3717 #define RIL_UNSOL_RINGBACK_TONE 1029
3718 
3719 /**
3720  * RIL_UNSOL_RESEND_INCALL_MUTE
3721  *
3722  * Indicates that framework/application need reset the uplink mute state.
3723  *
3724  * There may be situations where the mute state becomes out of sync
3725  * between the application and device in some GSM infrastructures.
3726  *
3727  * "data" is null
3728  */
3729 #define RIL_UNSOL_RESEND_INCALL_MUTE 1030
3730 
3731 /**
3732  * RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED
3733  *
3734  * Called when CDMA subscription source changed.
3735  *
3736  * "data" is int *
3737  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
3738  */
3739 #define RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 1031
3740 
3741 /**
3742  * RIL_UNSOL_CDMA_PRL_CHANGED
3743  *
3744  * Called when PRL (preferred roaming list) changes.
3745  *
3746  * "data" is int *
3747  * ((int *)data)[0] is PRL_VERSION as would be returned by RIL_REQUEST_CDMA_SUBSCRIPTION
3748  */
3749 #define RIL_UNSOL_CDMA_PRL_CHANGED 1032
3750 
3751 /**
3752  * RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE
3753  *
3754  * Called when Emergency Callback Mode Ends
3755  *
3756  * Indicates that the radio system selection module has
3757  * proactively exited emergency callback mode.
3758  *
3759  * "data" is NULL
3760  *
3761  */
3762 #define RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 1033
3763 
3764 /**
3765  * RIL_UNSOL_RIL_CONNECTED
3766  *
3767  * Called the ril connects and returns the version
3768  *
3769  * "data" is int *
3770  * ((int *)data)[0] is RIL_VERSION
3771  */
3772 #define RIL_UNSOL_RIL_CONNECTED 1034
3773 
3774 /**
3775  * RIL_UNSOL_VOICE_RADIO_TECH_CHANGED
3776  *
3777  * Indicates that voice technology has changed. Contains new radio technology
3778  * as a data in the message.
3779  *
3780  * "data" is int *
3781  * ((int *)data)[0] is of type const RIL_RadioTechnology
3782  *
3783  */
3784 #define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035
3785 
3786 
3787 /***********************************************************************/
3788 
3789 
3790 /**
3791  * RIL_Request Function pointer
3792  *
3793  * @param request is one of RIL_REQUEST_*
3794  * @param data is pointer to data defined for that RIL_REQUEST_*
3795  *        data is owned by caller, and should not be modified or freed by callee
3796  * @param t should be used in subsequent call to RIL_onResponse
3797  * @param datalen the length of data
3798  *
3799  */
3800 typedef void (*RIL_RequestFunc) (int request, void *data,
3801                                     size_t datalen, RIL_Token t);
3802 
3803 /**
3804  * This function should return the current radio state synchronously
3805  */
3806 typedef RIL_RadioState (*RIL_RadioStateRequest)();
3807 
3808 /**
3809  * This function returns "1" if the specified RIL_REQUEST code is
3810  * supported and 0 if it is not
3811  *
3812  * @param requestCode is one of RIL_REQUEST codes
3813  */
3814 
3815 typedef int (*RIL_Supports)(int requestCode);
3816 
3817 /**
3818  * This function is called from a separate thread--not the
3819  * thread that calls RIL_RequestFunc--and indicates that a pending
3820  * request should be cancelled.
3821  *
3822  * On cancel, the callee should do its best to abandon the request and
3823  * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
3824  *
3825  * Subsequent calls to  RIL_onRequestComplete for this request with
3826  * other results will be tolerated but ignored. (That is, it is valid
3827  * to ignore the cancellation request)
3828  *
3829  * RIL_Cancel calls should return immediately, and not wait for cancellation
3830  *
3831  * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007
3832  * interface
3833  *
3834  * @param t token wants to be canceled
3835  */
3836 
3837 typedef void (*RIL_Cancel)(RIL_Token t);
3838 
3839 typedef void (*RIL_TimedCallback) (void *param);
3840 
3841 /**
3842  * Return a version string for your RIL implementation
3843  */
3844 typedef const char * (*RIL_GetVersion) (void);
3845 
3846 typedef struct {
3847     int version;        /* set to RIL_VERSION */
3848     RIL_RequestFunc onRequest;
3849     RIL_RadioStateRequest onStateRequest;
3850     RIL_Supports supports;
3851     RIL_Cancel onCancel;
3852     RIL_GetVersion getVersion;
3853 } RIL_RadioFunctions;
3854 
3855 #ifdef RIL_SHLIB
3856 struct RIL_Env {
3857     /**
3858      * "t" is parameter passed in on previous call to RIL_Notification
3859      * routine.
3860      *
3861      * If "e" != SUCCESS, then response can be null/is ignored
3862      *
3863      * "response" is owned by caller, and should not be modified or
3864      * freed by callee
3865      *
3866      * RIL_onRequestComplete will return as soon as possible
3867      */
3868     void (*OnRequestComplete)(RIL_Token t, RIL_Errno e,
3869                            void *response, size_t responselen);
3870 
3871     /**
3872      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
3873      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
3874      *
3875      * "data" is owned by caller, and should not be modified or freed by callee
3876      */
3877 
3878     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data,
3879                                     size_t datalen);
3880 
3881     /**
3882      * Call user-specifed "callback" function on on the same thread that
3883      * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
3884      * a relative time value at which the callback is invoked. If relativeTime is
3885      * NULL or points to a 0-filled structure, the callback will be invoked as
3886      * soon as possible
3887      */
3888 
3889     void (*RequestTimedCallback) (RIL_TimedCallback callback,
3890                                    void *param, const struct timeval *relativeTime);
3891 };
3892 
3893 
3894 /**
3895  *  RIL implementations must defined RIL_Init
3896  *  argc and argv will be command line arguments intended for the RIL implementation
3897  *  Return NULL on error
3898  *
3899  * @param env is environment point defined as RIL_Env
3900  * @param argc number of arguments
3901  * @param argv list fo arguments
3902  *
3903  */
3904 const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
3905 
3906 #else /* RIL_SHLIB */
3907 
3908 /**
3909  * Call this once at startup to register notification routine
3910  *
3911  * @param callbacks user-specifed callback function
3912  */
3913 void RIL_register (const RIL_RadioFunctions *callbacks);
3914 
3915 
3916 /**
3917  *
3918  * RIL_onRequestComplete will return as soon as possible
3919  *
3920  * @param t is parameter passed in on previous call to RIL_Notification
3921  *          routine.
3922  * @param e error code
3923  *          if "e" != SUCCESS, then response can be null/is ignored
3924  * @param response is owned by caller, and should not be modified or
3925  *                 freed by callee
3926  * @param responselen the length of response in byte
3927  */
3928 void RIL_onRequestComplete(RIL_Token t, RIL_Errno e,
3929                            void *response, size_t responselen);
3930 
3931 /**
3932  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
3933  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
3934  *     "data" is owned by caller, and should not be modified or freed by callee
3935  * @param datalen the length of data in byte
3936  */
3937 
3938 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
3939                                 size_t datalen);
3940 
3941 
3942 /**
3943  * Call user-specifed "callback" function on on the same thread that
3944  * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
3945  * a relative time value at which the callback is invoked. If relativeTime is
3946  * NULL or points to a 0-filled structure, the callback will be invoked as
3947  * soon as possible
3948  *
3949  * @param callback user-specifed callback function
3950  * @param param parameter list
3951  * @param relativeTime a relative time value at which the callback is invoked
3952  */
3953 
3954 void RIL_requestTimedCallback (RIL_TimedCallback callback,
3955                                void *param, const struct timeval *relativeTime);
3956 
3957 
3958 #endif /* RIL_SHLIB */
3959 
3960 #ifdef __cplusplus
3961 }
3962 #endif
3963 
3964 #endif /*ANDROID_RIL_H*/
3965