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 package com.android.internal.telephony;
18 
19 /**
20  * TODO: This should probably not be an interface see
21  * http://www.javaworld.com/javaworld/javaqa/2001-06/01-qa-0608-constants.html and google with
22  * http://www.google.com/search?q=interface+constants&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a
23  *
24  * Also they should all probably be static final.
25  */
26 
27 import android.os.SystemProperties;
28 
29 /**
30  * {@hide}
31  */
32 public interface RILConstants {
33     // From the top of ril.cpp
34     int RIL_ERRNO_INVALID_RESPONSE = -1;
35 
36     int MAX_INT = 0x7FFFFFFF;
37 
38     // from RIL_Errno
39     int SUCCESS = 0;
40     int RADIO_NOT_AVAILABLE = 1;              /* If radio did not start or is resetting */
41     int GENERIC_FAILURE = 2;
42     int PASSWORD_INCORRECT = 3;               /* for PIN/PIN2 methods only! */
43     int SIM_PIN2 = 4;                         /* Operation requires SIM PIN2 to be entered */
44     int SIM_PUK2 = 5;                         /* Operation requires SIM PIN2 to be entered */
45     int REQUEST_NOT_SUPPORTED = 6;
46     int REQUEST_CANCELLED = 7;
47     int OP_NOT_ALLOWED_DURING_VOICE_CALL = 8; /* data operation is not allowed during voice call in
48                                                  class C */
49     int OP_NOT_ALLOWED_BEFORE_REG_NW = 9;     /* request is not allowed before device registers to
50                                                  network */
51     int SMS_SEND_FAIL_RETRY = 10;             /* send sms fail and need retry */
52     int SIM_ABSENT = 11;                      /* ICC card is absent */
53     int SUBSCRIPTION_NOT_AVAILABLE = 12;      /* fail to find CDMA subscription from specified
54                                                  location */
55     int MODE_NOT_SUPPORTED = 13;              /* HW does not support preferred network type */
56     int FDN_CHECK_FAILURE = 14;               /* send operation barred error when FDN is enabled */
57     int ILLEGAL_SIM_OR_ME = 15;               /* network selection failure due
58                                                  to wrong SIM/ME and no
59                                                  retries needed */
60     int MISSING_RESOURCE = 16;                /* no logical channel available */
61     int NO_SUCH_ELEMENT = 17;                 /* application not found on SIM */
62     int DIAL_MODIFIED_TO_USSD = 18;           /* DIAL request modified to USSD */
63     int DIAL_MODIFIED_TO_SS = 19;             /* DIAL request modified to SS */
64     int DIAL_MODIFIED_TO_DIAL = 20;           /* DIAL request modified to DIAL with different data*/
65     int USSD_MODIFIED_TO_DIAL = 21;           /* USSD request modified to DIAL */
66     int USSD_MODIFIED_TO_SS = 22;             /* USSD request modified to SS */
67     int USSD_MODIFIED_TO_USSD = 23;           /* USSD request modified to different USSD request */
68     int SS_MODIFIED_TO_DIAL = 24;             /* SS request modified to DIAL */
69     int SS_MODIFIED_TO_USSD = 25;             /* SS request modified to USSD */
70     int SUBSCRIPTION_NOT_SUPPORTED = 26;      /* Subscription not supported */
71     int SS_MODIFIED_TO_SS = 27;               /* SS request modified to different SS request */
72 
73 
74     /* NETWORK_MODE_* See ril.h RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE */
75     int NETWORK_MODE_WCDMA_PREF     = 0; /* GSM/WCDMA (WCDMA preferred) */
76     int NETWORK_MODE_GSM_ONLY       = 1; /* GSM only */
77     int NETWORK_MODE_WCDMA_ONLY     = 2; /* WCDMA only */
78     int NETWORK_MODE_GSM_UMTS       = 3; /* GSM/WCDMA (auto mode, according to PRL)
79                                             AVAILABLE Application Settings menu*/
80     int NETWORK_MODE_CDMA           = 4; /* CDMA and EvDo (auto mode, according to PRL)
81                                             AVAILABLE Application Settings menu*/
82     int NETWORK_MODE_CDMA_NO_EVDO   = 5; /* CDMA only */
83     int NETWORK_MODE_EVDO_NO_CDMA   = 6; /* EvDo only */
84     int NETWORK_MODE_GLOBAL         = 7; /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL)
85                                             AVAILABLE Application Settings menu*/
86     int NETWORK_MODE_LTE_CDMA_EVDO  = 8; /* LTE, CDMA and EvDo */
87     int NETWORK_MODE_LTE_GSM_WCDMA  = 9; /* LTE, GSM/WCDMA */
88     int NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = 10; /* LTE, CDMA, EvDo, GSM/WCDMA */
89     int NETWORK_MODE_LTE_ONLY       = 11; /* LTE Only mode. */
90     int NETWORK_MODE_LTE_WCDMA      = 12; /* LTE/WCDMA */
91     int PREFERRED_NETWORK_MODE      = SystemProperties.getInt("ro.telephony.default_network",
92             NETWORK_MODE_WCDMA_PREF);
93 
94     int CDMA_CELL_BROADCAST_SMS_DISABLED = 1;
95     int CDMA_CELL_BROADCAST_SMS_ENABLED  = 0;
96 
97     int NO_PHONE = 0;
98     int GSM_PHONE = 1;
99     int CDMA_PHONE = 2;
100     int SIP_PHONE  = 3;
101     int THIRD_PARTY_PHONE = 4;
102     int IMS_PHONE = 5;
103 
104     int LTE_ON_CDMA_UNKNOWN = -1;
105     int LTE_ON_CDMA_FALSE = 0;
106     int LTE_ON_CDMA_TRUE = 1;
107 
108     int CDM_TTY_MODE_DISABLED = 0;
109     int CDM_TTY_MODE_ENABLED = 1;
110 
111     int CDM_TTY_FULL_MODE = 1;
112     int CDM_TTY_HCO_MODE = 2;
113     int CDM_TTY_VCO_MODE = 3;
114 
115     /* Setup a packet data connection. See ril.h RIL_REQUEST_SETUP_DATA_CALL */
116     int SETUP_DATA_TECH_CDMA      = 0;
117     int SETUP_DATA_TECH_GSM       = 1;
118 
119     int SETUP_DATA_AUTH_NONE      = 0;
120     int SETUP_DATA_AUTH_PAP       = 1;
121     int SETUP_DATA_AUTH_CHAP      = 2;
122     int SETUP_DATA_AUTH_PAP_CHAP  = 3;
123 
124     String SETUP_DATA_PROTOCOL_IP     = "IP";
125     String SETUP_DATA_PROTOCOL_IPV6   = "IPV6";
126     String SETUP_DATA_PROTOCOL_IPV4V6 = "IPV4V6";
127 
128     /* Deactivate data call reasons */
129     int DEACTIVATE_REASON_NONE = 0;
130     int DEACTIVATE_REASON_RADIO_OFF = 1;
131     int DEACTIVATE_REASON_PDP_RESET = 2;
132 
133     /* NV config radio reset types. */
134     int NV_CONFIG_RELOAD_RESET = 1;
135     int NV_CONFIG_ERASE_RESET = 2;
136     int NV_CONFIG_FACTORY_RESET = 3;
137 
138 /*
139 cat include/telephony/ril.h | \
140    egrep '^#define' | \
141    sed -re 's/^#define +([^ ]+)* +([^ ]+)/    int \1 = \2;/' \
142    >>java/android/com.android.internal.telephony/gsm/RILConstants.java
143 */
144 
145     /**
146      * No restriction at all including voice/SMS/USSD/SS/AV64
147      * and packet data.
148      */
149     int RIL_RESTRICTED_STATE_NONE = 0x00;
150     /**
151      * Block emergency call due to restriction.
152      * But allow all normal voice/SMS/USSD/SS/AV64.
153      */
154     int RIL_RESTRICTED_STATE_CS_EMERGENCY = 0x01;
155     /**
156      * Block all normal voice/SMS/USSD/SS/AV64 due to restriction.
157      * Only Emergency call allowed.
158      */
159     int RIL_RESTRICTED_STATE_CS_NORMAL = 0x02;
160     /**
161      * Block all voice/SMS/USSD/SS/AV64
162      * including emergency call due to restriction.
163      */
164     int RIL_RESTRICTED_STATE_CS_ALL = 0x04;
165     /**
166      * Block packet data access due to restriction.
167      */
168     int RIL_RESTRICTED_STATE_PS_ALL = 0x10;
169 
170     /** Data profile for RIL_REQUEST_SETUP_DATA_CALL */
171     public static final int DATA_PROFILE_DEFAULT   = 0;
172     public static final int DATA_PROFILE_TETHERED  = 1;
173     public static final int DATA_PROFILE_IMS       = 2;
174     public static final int DATA_PROFILE_FOTA      = 3;
175     public static final int DATA_PROFILE_CBS       = 4;
176     public static final int DATA_PROFILE_OEM_BASE  = 1000;
177     public static final int DATA_PROFILE_INVALID   = 0xFFFFFFFF;
178 
179     int RIL_REQUEST_GET_SIM_STATUS = 1;
180     int RIL_REQUEST_ENTER_SIM_PIN = 2;
181     int RIL_REQUEST_ENTER_SIM_PUK = 3;
182     int RIL_REQUEST_ENTER_SIM_PIN2 = 4;
183     int RIL_REQUEST_ENTER_SIM_PUK2 = 5;
184     int RIL_REQUEST_CHANGE_SIM_PIN = 6;
185     int RIL_REQUEST_CHANGE_SIM_PIN2 = 7;
186     int RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION = 8;
187     int RIL_REQUEST_GET_CURRENT_CALLS = 9;
188     int RIL_REQUEST_DIAL = 10;
189     int RIL_REQUEST_GET_IMSI = 11;
190     int RIL_REQUEST_HANGUP = 12;
191     int RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND = 13;
192     int RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND = 14;
193     int RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE = 15;
194     int RIL_REQUEST_CONFERENCE = 16;
195     int RIL_REQUEST_UDUB = 17;
196     int RIL_REQUEST_LAST_CALL_FAIL_CAUSE = 18;
197     int RIL_REQUEST_SIGNAL_STRENGTH = 19;
198     int RIL_REQUEST_VOICE_REGISTRATION_STATE = 20;
199     int RIL_REQUEST_DATA_REGISTRATION_STATE = 21;
200     int RIL_REQUEST_OPERATOR = 22;
201     int RIL_REQUEST_RADIO_POWER = 23;
202     int RIL_REQUEST_DTMF = 24;
203     int RIL_REQUEST_SEND_SMS = 25;
204     int RIL_REQUEST_SEND_SMS_EXPECT_MORE = 26;
205     int RIL_REQUEST_SETUP_DATA_CALL = 27;
206     int RIL_REQUEST_SIM_IO = 28;
207     int RIL_REQUEST_SEND_USSD = 29;
208     int RIL_REQUEST_CANCEL_USSD = 30;
209     int RIL_REQUEST_GET_CLIR = 31;
210     int RIL_REQUEST_SET_CLIR = 32;
211     int RIL_REQUEST_QUERY_CALL_FORWARD_STATUS = 33;
212     int RIL_REQUEST_SET_CALL_FORWARD = 34;
213     int RIL_REQUEST_QUERY_CALL_WAITING = 35;
214     int RIL_REQUEST_SET_CALL_WAITING = 36;
215     int RIL_REQUEST_SMS_ACKNOWLEDGE = 37;
216     int RIL_REQUEST_GET_IMEI = 38;
217     int RIL_REQUEST_GET_IMEISV = 39;
218     int RIL_REQUEST_ANSWER = 40;
219     int RIL_REQUEST_DEACTIVATE_DATA_CALL = 41;
220     int RIL_REQUEST_QUERY_FACILITY_LOCK = 42;
221     int RIL_REQUEST_SET_FACILITY_LOCK = 43;
222     int RIL_REQUEST_CHANGE_BARRING_PASSWORD = 44;
223     int RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE = 45;
224     int RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC = 46;
225     int RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL = 47;
226     int RIL_REQUEST_QUERY_AVAILABLE_NETWORKS = 48;
227     int RIL_REQUEST_DTMF_START = 49;
228     int RIL_REQUEST_DTMF_STOP = 50;
229     int RIL_REQUEST_BASEBAND_VERSION = 51;
230     int RIL_REQUEST_SEPARATE_CONNECTION = 52;
231     int RIL_REQUEST_SET_MUTE = 53;
232     int RIL_REQUEST_GET_MUTE = 54;
233     int RIL_REQUEST_QUERY_CLIP = 55;
234     int RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE = 56;
235     int RIL_REQUEST_DATA_CALL_LIST = 57;
236     int RIL_REQUEST_RESET_RADIO = 58;
237     int RIL_REQUEST_OEM_HOOK_RAW = 59;
238     int RIL_REQUEST_OEM_HOOK_STRINGS = 60;
239     int RIL_REQUEST_SCREEN_STATE = 61;
240     int RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION = 62;
241     int RIL_REQUEST_WRITE_SMS_TO_SIM = 63;
242     int RIL_REQUEST_DELETE_SMS_ON_SIM = 64;
243     int RIL_REQUEST_SET_BAND_MODE = 65;
244     int RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE = 66;
245     int RIL_REQUEST_STK_GET_PROFILE = 67;
246     int RIL_REQUEST_STK_SET_PROFILE = 68;
247     int RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND = 69;
248     int RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE = 70;
249     int RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM = 71;
250     int RIL_REQUEST_EXPLICIT_CALL_TRANSFER = 72;
251     int RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE = 73;
252     int RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE = 74;
253     int RIL_REQUEST_GET_NEIGHBORING_CELL_IDS = 75;
254     int RIL_REQUEST_SET_LOCATION_UPDATES = 76;
255     int RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE = 77;
256     int RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE = 78;
257     int RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE = 79;
258     int RIL_REQUEST_SET_TTY_MODE = 80;
259     int RIL_REQUEST_QUERY_TTY_MODE = 81;
260     int RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE = 82;
261     int RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE = 83;
262     int RIL_REQUEST_CDMA_FLASH = 84;
263     int RIL_REQUEST_CDMA_BURST_DTMF = 85;
264     int RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY = 86;
265     int RIL_REQUEST_CDMA_SEND_SMS = 87;
266     int RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE = 88;
267     int RIL_REQUEST_GSM_GET_BROADCAST_CONFIG = 89;
268     int RIL_REQUEST_GSM_SET_BROADCAST_CONFIG = 90;
269     int RIL_REQUEST_GSM_BROADCAST_ACTIVATION = 91;
270     int RIL_REQUEST_CDMA_GET_BROADCAST_CONFIG = 92;
271     int RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG = 93;
272     int RIL_REQUEST_CDMA_BROADCAST_ACTIVATION = 94;
273     int RIL_REQUEST_CDMA_SUBSCRIPTION = 95;
274     int RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM = 96;
275     int RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM = 97;
276     int RIL_REQUEST_DEVICE_IDENTITY = 98;
277     int RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE = 99;
278     int RIL_REQUEST_GET_SMSC_ADDRESS = 100;
279     int RIL_REQUEST_SET_SMSC_ADDRESS = 101;
280     int RIL_REQUEST_REPORT_SMS_MEMORY_STATUS = 102;
281     int RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING = 103;
282     int RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE = 104;
283     int RIL_REQUEST_ISIM_AUTHENTICATION = 105;
284     int RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU = 106;
285     int RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS = 107;
286     int RIL_REQUEST_VOICE_RADIO_TECH = 108;
287     int RIL_REQUEST_GET_CELL_INFO_LIST = 109;
288     int RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE = 110;
289     int RIL_REQUEST_SET_INITIAL_ATTACH_APN = 111;
290     int RIL_REQUEST_IMS_REGISTRATION_STATE = 112;
291     int RIL_REQUEST_IMS_SEND_SMS = 113;
292     int RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC = 114;
293     int RIL_REQUEST_SIM_OPEN_CHANNEL = 115;
294     int RIL_REQUEST_SIM_CLOSE_CHANNEL = 116;
295     int RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL = 117;
296     int RIL_REQUEST_NV_READ_ITEM = 118;
297     int RIL_REQUEST_NV_WRITE_ITEM = 119;
298     int RIL_REQUEST_NV_WRITE_CDMA_PRL = 120;
299     int RIL_REQUEST_NV_RESET_CONFIG = 121;
300     int RIL_REQUEST_SET_UICC_SUBSCRIPTION = 122;
301     int RIL_REQUEST_ALLOW_DATA = 123;
302     int RIL_REQUEST_GET_HARDWARE_CONFIG = 124;
303     int RIL_REQUEST_SIM_AUTHENTICATION = 125;
304     int RIL_REQUEST_GET_DC_RT_INFO = 126;
305     int RIL_REQUEST_SET_DC_RT_INFO_RATE = 127;
306     int RIL_REQUEST_SET_DATA_PROFILE = 128;
307     int RIL_REQUEST_SHUTDOWN = 129;
308     int RIL_REQUEST_GET_RADIO_CAPABILITY = 130;
309     int RIL_REQUEST_SET_RADIO_CAPABILITY = 131;
310 
311     int RIL_UNSOL_RESPONSE_BASE = 1000;
312     int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000;
313     int RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED = 1001;
314     int RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED = 1002;
315     int RIL_UNSOL_RESPONSE_NEW_SMS = 1003;
316     int RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT = 1004;
317     int RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM = 1005;
318     int RIL_UNSOL_ON_USSD = 1006;
319     int RIL_UNSOL_ON_USSD_REQUEST = 1007;
320     int RIL_UNSOL_NITZ_TIME_RECEIVED = 1008;
321     int RIL_UNSOL_SIGNAL_STRENGTH = 1009;
322     int RIL_UNSOL_DATA_CALL_LIST_CHANGED = 1010;
323     int RIL_UNSOL_SUPP_SVC_NOTIFICATION = 1011;
324     int RIL_UNSOL_STK_SESSION_END = 1012;
325     int RIL_UNSOL_STK_PROACTIVE_COMMAND = 1013;
326     int RIL_UNSOL_STK_EVENT_NOTIFY = 1014;
327     int RIL_UNSOL_STK_CALL_SETUP = 1015;
328     int RIL_UNSOL_SIM_SMS_STORAGE_FULL = 1016;
329     int RIL_UNSOL_SIM_REFRESH = 1017;
330     int RIL_UNSOL_CALL_RING = 1018;
331     int RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED = 1019;
332     int RIL_UNSOL_RESPONSE_CDMA_NEW_SMS = 1020;
333     int RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS = 1021;
334     int RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL = 1022;
335     int RIL_UNSOL_RESTRICTED_STATE_CHANGED = 1023;
336     int RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE = 1024;
337     int RIL_UNSOL_CDMA_CALL_WAITING = 1025;
338     int RIL_UNSOL_CDMA_OTA_PROVISION_STATUS = 1026;
339     int RIL_UNSOL_CDMA_INFO_REC = 1027;
340     int RIL_UNSOL_OEM_HOOK_RAW = 1028;
341     int RIL_UNSOL_RINGBACK_TONE = 1029;
342     int RIL_UNSOL_RESEND_INCALL_MUTE = 1030;
343     int RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED = 1031;
344     int RIL_UNSOl_CDMA_PRL_CHANGED = 1032;
345     int RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE = 1033;
346     int RIL_UNSOL_RIL_CONNECTED = 1034;
347     int RIL_UNSOL_VOICE_RADIO_TECH_CHANGED = 1035;
348     int RIL_UNSOL_CELL_INFO_LIST = 1036;
349     int RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED = 1037;
350     int RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED = 1038;
351     int RIL_UNSOL_SRVCC_STATE_NOTIFY = 1039;
352     int RIL_UNSOL_HARDWARE_CONFIG_CHANGED = 1040;
353     int RIL_UNSOL_DC_RT_INFO_CHANGED = 1041;
354     int RIL_UNSOL_RADIO_CAPABILITY = 1042;
355     int RIL_UNSOL_ON_SS = 1043;
356     int RIL_UNSOL_STK_CC_ALPHA_NOTIFY = 1044;
357 }
358