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