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 import android.os.Handler;
20 import android.os.Message;
21 import android.os.WorkSource;
22 import android.service.carrier.CarrierIdentifier;
23 import android.telephony.ClientRequestStats;
24 
25 import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
26 import com.android.internal.telephony.dataconnection.DataProfile;
27 import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
28 import com.android.internal.telephony.uicc.IccCardStatus;
29 
30 import java.util.List;
31 
32 /**
33  * {@hide}
34  */
35 public interface CommandsInterface {
36     enum RadioState {
37         RADIO_OFF,         /* Radio explicitly powered off (eg CFUN=0) */
38         RADIO_UNAVAILABLE, /* Radio unavailable (eg, resetting or not booted) */
39         RADIO_ON;          /* Radio is on */
40 
isOn()41         public boolean isOn() /* and available...*/ {
42             return this == RADIO_ON;
43         }
44 
isAvailable()45         public boolean isAvailable() {
46             return this != RADIO_UNAVAILABLE;
47         }
48     }
49 
50     //***** Constants
51 
52     // Used as parameter to dial() and setCLIR() below
53     static final int CLIR_DEFAULT = 0;      // "use subscription default value"
54     static final int CLIR_INVOCATION = 1;   // (restrict CLI presentation)
55     static final int CLIR_SUPPRESSION = 2;  // (allow CLI presentation)
56 
57 
58     // Used as parameters for call forward methods below
59     static final int CF_ACTION_DISABLE          = 0;
60     static final int CF_ACTION_ENABLE           = 1;
61 //  static final int CF_ACTION_UNUSED           = 2;
62     static final int CF_ACTION_REGISTRATION     = 3;
63     static final int CF_ACTION_ERASURE          = 4;
64 
65     static final int CF_REASON_UNCONDITIONAL    = 0;
66     static final int CF_REASON_BUSY             = 1;
67     static final int CF_REASON_NO_REPLY         = 2;
68     static final int CF_REASON_NOT_REACHABLE    = 3;
69     static final int CF_REASON_ALL              = 4;
70     static final int CF_REASON_ALL_CONDITIONAL  = 5;
71 
72     // Used for call barring methods below
73     static final String CB_FACILITY_BAOC         = "AO";
74     static final String CB_FACILITY_BAOIC        = "OI";
75     static final String CB_FACILITY_BAOICxH      = "OX";
76     static final String CB_FACILITY_BAIC         = "AI";
77     static final String CB_FACILITY_BAICr        = "IR";
78     static final String CB_FACILITY_BA_ALL       = "AB";
79     static final String CB_FACILITY_BA_MO        = "AG";
80     static final String CB_FACILITY_BA_MT        = "AC";
81     static final String CB_FACILITY_BA_SIM       = "SC";
82     static final String CB_FACILITY_BA_FD        = "FD";
83 
84 
85     // Used for various supp services apis
86     // See 27.007 +CCFC or +CLCK
87     static final int SERVICE_CLASS_NONE     = 0; // no user input
88     static final int SERVICE_CLASS_VOICE    = (1 << 0);
89     static final int SERVICE_CLASS_DATA     = (1 << 1); //synonym for 16+32+64+128
90     static final int SERVICE_CLASS_FAX      = (1 << 2);
91     static final int SERVICE_CLASS_SMS      = (1 << 3);
92     static final int SERVICE_CLASS_DATA_SYNC = (1 << 4);
93     static final int SERVICE_CLASS_DATA_ASYNC = (1 << 5);
94     static final int SERVICE_CLASS_PACKET   = (1 << 6);
95     static final int SERVICE_CLASS_PAD      = (1 << 7);
96     static final int SERVICE_CLASS_MAX      = (1 << 7); // Max SERVICE_CLASS value
97 
98     // Numeric representation of string values returned
99     // by messages sent to setOnUSSD handler
100     static final int USSD_MODE_NOTIFY        = 0;
101     static final int USSD_MODE_REQUEST       = 1;
102     static final int USSD_MODE_NW_RELEASE    = 2;
103     static final int USSD_MODE_LOCAL_CLIENT  = 3;
104     static final int USSD_MODE_NOT_SUPPORTED = 4;
105     static final int USSD_MODE_NW_TIMEOUT    = 5;
106 
107     // GSM SMS fail cause for acknowledgeLastIncomingSMS. From TS 23.040, 9.2.3.22.
108     static final int GSM_SMS_FAIL_CAUSE_MEMORY_CAPACITY_EXCEEDED    = 0xD3;
109     static final int GSM_SMS_FAIL_CAUSE_USIM_APP_TOOLKIT_BUSY       = 0xD4;
110     static final int GSM_SMS_FAIL_CAUSE_USIM_DATA_DOWNLOAD_ERROR    = 0xD5;
111     static final int GSM_SMS_FAIL_CAUSE_UNSPECIFIED_ERROR           = 0xFF;
112 
113     // CDMA SMS fail cause for acknowledgeLastIncomingCdmaSms.  From TS N.S0005, 6.5.2.125.
114     static final int CDMA_SMS_FAIL_CAUSE_INVALID_TELESERVICE_ID     = 4;
115     static final int CDMA_SMS_FAIL_CAUSE_RESOURCE_SHORTAGE          = 35;
116     static final int CDMA_SMS_FAIL_CAUSE_OTHER_TERMINAL_PROBLEM     = 39;
117     static final int CDMA_SMS_FAIL_CAUSE_ENCODING_PROBLEM           = 96;
118 
119     //***** Methods
getRadioState()120     RadioState getRadioState();
121 
122     /**
123      * response.obj.result is an int[2]
124      *
125      * response.obj.result[0] is IMS registration state
126      *                        0 - Not registered
127      *                        1 - Registered
128      * response.obj.result[1] is of type RILConstants.GSM_PHONE or
129      *                                    RILConstants.CDMA_PHONE
130      */
getImsRegistrationState(Message result)131     void getImsRegistrationState(Message result);
132 
133     /**
134      * Fires on any RadioState transition
135      * Always fires immediately as well
136      *
137      * do not attempt to calculate transitions by storing getRadioState() values
138      * on previous invocations of this notification. Instead, use the other
139      * registration methods
140      */
registerForRadioStateChanged(Handler h, int what, Object obj)141     void registerForRadioStateChanged(Handler h, int what, Object obj);
unregisterForRadioStateChanged(Handler h)142     void unregisterForRadioStateChanged(Handler h);
143 
registerForVoiceRadioTechChanged(Handler h, int what, Object obj)144     void registerForVoiceRadioTechChanged(Handler h, int what, Object obj);
unregisterForVoiceRadioTechChanged(Handler h)145     void unregisterForVoiceRadioTechChanged(Handler h);
registerForImsNetworkStateChanged(Handler h, int what, Object obj)146     void registerForImsNetworkStateChanged(Handler h, int what, Object obj);
unregisterForImsNetworkStateChanged(Handler h)147     void unregisterForImsNetworkStateChanged(Handler h);
148 
149     /**
150      * Fires on any transition into RadioState.isOn()
151      * Fires immediately if currently in that state
152      * In general, actions should be idempotent. State may change
153      * before event is received.
154      */
registerForOn(Handler h, int what, Object obj)155     void registerForOn(Handler h, int what, Object obj);
unregisterForOn(Handler h)156     void unregisterForOn(Handler h);
157 
158     /**
159      * Fires on any transition out of RadioState.isAvailable()
160      * Fires immediately if currently in that state
161      * In general, actions should be idempotent. State may change
162      * before event is received.
163      */
registerForAvailable(Handler h, int what, Object obj)164     void registerForAvailable(Handler h, int what, Object obj);
unregisterForAvailable(Handler h)165     void unregisterForAvailable(Handler h);
166 
167     /**
168      * Fires on any transition into !RadioState.isAvailable()
169      * Fires immediately if currently in that state
170      * In general, actions should be idempotent. State may change
171      * before event is received.
172      */
registerForNotAvailable(Handler h, int what, Object obj)173     void registerForNotAvailable(Handler h, int what, Object obj);
unregisterForNotAvailable(Handler h)174     void unregisterForNotAvailable(Handler h);
175 
176     /**
177      * Fires on any transition into RADIO_OFF or !RadioState.isAvailable()
178      * Fires immediately if currently in that state
179      * In general, actions should be idempotent. State may change
180      * before event is received.
181      */
registerForOffOrNotAvailable(Handler h, int what, Object obj)182     void registerForOffOrNotAvailable(Handler h, int what, Object obj);
unregisterForOffOrNotAvailable(Handler h)183     void unregisterForOffOrNotAvailable(Handler h);
184 
185     /**
186      * Fires on any change in ICC status
187      */
registerForIccStatusChanged(Handler h, int what, Object obj)188     void registerForIccStatusChanged(Handler h, int what, Object obj);
unregisterForIccStatusChanged(Handler h)189     void unregisterForIccStatusChanged(Handler h);
190 
registerForCallStateChanged(Handler h, int what, Object obj)191     void registerForCallStateChanged(Handler h, int what, Object obj);
unregisterForCallStateChanged(Handler h)192     void unregisterForCallStateChanged(Handler h);
193     /** Register for network state changed event */
registerForNetworkStateChanged(Handler h, int what, Object obj)194     void registerForNetworkStateChanged(Handler h, int what, Object obj);
195     /** Unregister from network state changed event */
unregisterForNetworkStateChanged(Handler h)196     void unregisterForNetworkStateChanged(Handler h);
197     /** Register for data call list changed event */
registerForDataCallListChanged(Handler h, int what, Object obj)198     void registerForDataCallListChanged(Handler h, int what, Object obj);
199     /** Unregister from data call list changed event */
unregisterForDataCallListChanged(Handler h)200     void unregisterForDataCallListChanged(Handler h);
201 
202     /** InCall voice privacy notifications */
registerForInCallVoicePrivacyOn(Handler h, int what, Object obj)203     void registerForInCallVoicePrivacyOn(Handler h, int what, Object obj);
unregisterForInCallVoicePrivacyOn(Handler h)204     void unregisterForInCallVoicePrivacyOn(Handler h);
registerForInCallVoicePrivacyOff(Handler h, int what, Object obj)205     void registerForInCallVoicePrivacyOff(Handler h, int what, Object obj);
unregisterForInCallVoicePrivacyOff(Handler h)206     void unregisterForInCallVoicePrivacyOff(Handler h);
207 
208     /** Single Radio Voice Call State progress notifications */
registerForSrvccStateChanged(Handler h, int what, Object obj)209     void registerForSrvccStateChanged(Handler h, int what, Object obj);
unregisterForSrvccStateChanged(Handler h)210     void unregisterForSrvccStateChanged(Handler h);
211 
212     /**
213      * Handlers for subscription status change indications.
214      *
215      * @param h Handler for subscription status change messages.
216      * @param what User-defined message code.
217      * @param obj User object.
218      */
registerForSubscriptionStatusChanged(Handler h, int what, Object obj)219     void registerForSubscriptionStatusChanged(Handler h, int what, Object obj);
unregisterForSubscriptionStatusChanged(Handler h)220     void unregisterForSubscriptionStatusChanged(Handler h);
221 
222     /**
223      * fires on any change in hardware configuration.
224      */
registerForHardwareConfigChanged(Handler h, int what, Object obj)225     void registerForHardwareConfigChanged(Handler h, int what, Object obj);
unregisterForHardwareConfigChanged(Handler h)226     void unregisterForHardwareConfigChanged(Handler h);
227 
228     /**
229      * unlike the register* methods, there's only one new 3GPP format SMS handler.
230      * if you need to unregister, you should also tell the radio to stop
231      * sending SMS's to you (via AT+CNMI)
232      *
233      * AsyncResult.result is a String containing the SMS PDU
234      */
setOnNewGsmSms(Handler h, int what, Object obj)235     void setOnNewGsmSms(Handler h, int what, Object obj);
unSetOnNewGsmSms(Handler h)236     void unSetOnNewGsmSms(Handler h);
237 
238     /**
239      * unlike the register* methods, there's only one new 3GPP2 format SMS handler.
240      * if you need to unregister, you should also tell the radio to stop
241      * sending SMS's to you (via AT+CNMI)
242      *
243      * AsyncResult.result is a String containing the SMS PDU
244      */
setOnNewCdmaSms(Handler h, int what, Object obj)245     void setOnNewCdmaSms(Handler h, int what, Object obj);
unSetOnNewCdmaSms(Handler h)246     void unSetOnNewCdmaSms(Handler h);
247 
248     /**
249      * Set the handler for SMS Cell Broadcast messages.
250      *
251      * AsyncResult.result is a byte array containing the SMS-CB PDU
252      */
setOnNewGsmBroadcastSms(Handler h, int what, Object obj)253     void setOnNewGsmBroadcastSms(Handler h, int what, Object obj);
unSetOnNewGsmBroadcastSms(Handler h)254     void unSetOnNewGsmBroadcastSms(Handler h);
255 
256     /**
257      * Register for NEW_SMS_ON_SIM unsolicited message
258      *
259      * AsyncResult.result is an int array containing the index of new SMS
260      */
setOnSmsOnSim(Handler h, int what, Object obj)261     void setOnSmsOnSim(Handler h, int what, Object obj);
unSetOnSmsOnSim(Handler h)262     void unSetOnSmsOnSim(Handler h);
263 
264     /**
265      * Register for NEW_SMS_STATUS_REPORT unsolicited message
266      *
267      * AsyncResult.result is a String containing the status report PDU
268      */
setOnSmsStatus(Handler h, int what, Object obj)269     void setOnSmsStatus(Handler h, int what, Object obj);
unSetOnSmsStatus(Handler h)270     void unSetOnSmsStatus(Handler h);
271 
272     /**
273      * unlike the register* methods, there's only one NITZ time handler
274      *
275      * AsyncResult.result is an Object[]
276      * ((Object[])AsyncResult.result)[0] is a String containing the NITZ time string
277      * ((Object[])AsyncResult.result)[1] is a Long containing the milliseconds since boot as
278      *                                   returned by elapsedRealtime() when this NITZ time
279      *                                   was posted.
280      *
281      * Please note that the delivery of this message may be delayed several
282      * seconds on system startup
283      */
setOnNITZTime(Handler h, int what, Object obj)284     void setOnNITZTime(Handler h, int what, Object obj);
unSetOnNITZTime(Handler h)285     void unSetOnNITZTime(Handler h);
286 
287     /**
288      * unlike the register* methods, there's only one USSD notify handler
289      *
290      * Represents the arrival of a USSD "notify" message, which may
291      * or may not have been triggered by a previous USSD send
292      *
293      * AsyncResult.result is a String[]
294      * ((String[])(AsyncResult.result))[0] contains status code
295      *      "0"   USSD-Notify -- text in ((const char **)data)[1]
296      *      "1"   USSD-Request -- text in ((const char **)data)[1]
297      *      "2"   Session terminated by network
298      *      "3"   other local client (eg, SIM Toolkit) has responded
299      *      "4"   Operation not supported
300      *      "5"   Network timeout
301      *
302      * ((String[])(AsyncResult.result))[1] contains the USSD message
303      * The numeric representations of these are in USSD_MODE_*
304      */
305 
setOnUSSD(Handler h, int what, Object obj)306     void setOnUSSD(Handler h, int what, Object obj);
unSetOnUSSD(Handler h)307     void unSetOnUSSD(Handler h);
308 
309     /**
310      * unlike the register* methods, there's only one signal strength handler
311      * AsyncResult.result is an int[2]
312      * response.obj.result[0] is received signal strength (0-31, 99)
313      * response.obj.result[1] is  bit error rate (0-7, 99)
314      * as defined in TS 27.007 8.5
315      */
316 
setOnSignalStrengthUpdate(Handler h, int what, Object obj)317     void setOnSignalStrengthUpdate(Handler h, int what, Object obj);
unSetOnSignalStrengthUpdate(Handler h)318     void unSetOnSignalStrengthUpdate(Handler h);
319 
320     /**
321      * Sets the handler for SIM/RUIM SMS storage full unsolicited message.
322      * Unlike the register* methods, there's only one notification handler
323      *
324      * @param h Handler for notification message.
325      * @param what User-defined message code.
326      * @param obj User object.
327      */
setOnIccSmsFull(Handler h, int what, Object obj)328     void setOnIccSmsFull(Handler h, int what, Object obj);
unSetOnIccSmsFull(Handler h)329     void unSetOnIccSmsFull(Handler h);
330 
331     /**
332      * Sets the handler for SIM Refresh notifications.
333      *
334      * @param h Handler for notification message.
335      * @param what User-defined message code.
336      * @param obj User object.
337      */
registerForIccRefresh(Handler h, int what, Object obj)338     void registerForIccRefresh(Handler h, int what, Object obj);
unregisterForIccRefresh(Handler h)339     void unregisterForIccRefresh(Handler h);
340 
setOnIccRefresh(Handler h, int what, Object obj)341     void setOnIccRefresh(Handler h, int what, Object obj);
unsetOnIccRefresh(Handler h)342     void unsetOnIccRefresh(Handler h);
343 
344     /**
345      * Sets the handler for RING notifications.
346      * Unlike the register* methods, there's only one notification handler
347      *
348      * @param h Handler for notification message.
349      * @param what User-defined message code.
350      * @param obj User object.
351      */
setOnCallRing(Handler h, int what, Object obj)352     void setOnCallRing(Handler h, int what, Object obj);
unSetOnCallRing(Handler h)353     void unSetOnCallRing(Handler h);
354 
355     /**
356      * Sets the handler for RESTRICTED_STATE changed notification,
357      * eg, for Domain Specific Access Control
358      * unlike the register* methods, there's only one signal strength handler
359      *
360      * AsyncResult.result is an int[1]
361      * response.obj.result[0] is a bitmask of RIL_RESTRICTED_STATE_* values
362      */
363 
setOnRestrictedStateChanged(Handler h, int what, Object obj)364     void setOnRestrictedStateChanged(Handler h, int what, Object obj);
unSetOnRestrictedStateChanged(Handler h)365     void unSetOnRestrictedStateChanged(Handler h);
366 
367     /**
368      * Sets the handler for Supplementary Service Notifications.
369      * Unlike the register* methods, there's only one notification handler
370      *
371      * @param h Handler for notification message.
372      * @param what User-defined message code.
373      * @param obj User object.
374      */
setOnSuppServiceNotification(Handler h, int what, Object obj)375     void setOnSuppServiceNotification(Handler h, int what, Object obj);
unSetOnSuppServiceNotification(Handler h)376     void unSetOnSuppServiceNotification(Handler h);
377 
378     /**
379      * Sets the handler for Session End Notifications for CAT.
380      * Unlike the register* methods, there's only one notification handler
381      *
382      * @param h Handler for notification message.
383      * @param what User-defined message code.
384      * @param obj User object.
385      */
setOnCatSessionEnd(Handler h, int what, Object obj)386     void setOnCatSessionEnd(Handler h, int what, Object obj);
unSetOnCatSessionEnd(Handler h)387     void unSetOnCatSessionEnd(Handler h);
388 
389     /**
390      * Sets the handler for Proactive Commands for CAT.
391      * Unlike the register* methods, there's only one notification handler
392      *
393      * @param h Handler for notification message.
394      * @param what User-defined message code.
395      * @param obj User object.
396      */
setOnCatProactiveCmd(Handler h, int what, Object obj)397     void setOnCatProactiveCmd(Handler h, int what, Object obj);
unSetOnCatProactiveCmd(Handler h)398     void unSetOnCatProactiveCmd(Handler h);
399 
400     /**
401      * Sets the handler for Event Notifications for CAT.
402      * Unlike the register* methods, there's only one notification handler
403      *
404      * @param h Handler for notification message.
405      * @param what User-defined message code.
406      * @param obj User object.
407      */
setOnCatEvent(Handler h, int what, Object obj)408     void setOnCatEvent(Handler h, int what, Object obj);
unSetOnCatEvent(Handler h)409     void unSetOnCatEvent(Handler h);
410 
411     /**
412      * Sets the handler for Call Set Up Notifications for CAT.
413      * Unlike the register* methods, there's only one notification handler
414      *
415      * @param h Handler for notification message.
416      * @param what User-defined message code.
417      * @param obj User object.
418      */
setOnCatCallSetUp(Handler h, int what, Object obj)419     void setOnCatCallSetUp(Handler h, int what, Object obj);
unSetOnCatCallSetUp(Handler h)420     void unSetOnCatCallSetUp(Handler h);
421 
422     /**
423      * Enables/disbables supplementary service related notifications from
424      * the network.
425      *
426      * @param enable true to enable notifications, false to disable.
427      * @param result Message to be posted when command completes.
428      */
setSuppServiceNotifications(boolean enable, Message result)429     void setSuppServiceNotifications(boolean enable, Message result);
430     //void unSetSuppServiceNotifications(Handler h);
431 
432     /**
433      * Sets the handler for Alpha Notification during STK Call Control.
434      * Unlike the register* methods, there's only one notification handler
435      *
436      * @param h Handler for notification message.
437      * @param what User-defined message code.
438      * @param obj User object.
439      */
setOnCatCcAlphaNotify(Handler h, int what, Object obj)440     void setOnCatCcAlphaNotify(Handler h, int what, Object obj);
unSetOnCatCcAlphaNotify(Handler h)441     void unSetOnCatCcAlphaNotify(Handler h);
442 
443     /**
444      * Sets the handler for notifying Suplementary Services (SS)
445      * Data during STK Call Control.
446      * Unlike the register* methods, there's only one notification handler
447      *
448      * @param h Handler for notification message.
449      * @param what User-defined message code.
450      * @param obj User object.
451      */
setOnSs(Handler h, int what, Object obj)452     void setOnSs(Handler h, int what, Object obj);
unSetOnSs(Handler h)453     void unSetOnSs(Handler h);
454 
455     /**
456      * Sets the handler for Event Notifications for CDMA Display Info.
457      * Unlike the register* methods, there's only one notification handler
458      *
459      * @param h Handler for notification message.
460      * @param what User-defined message code.
461      * @param obj User object.
462      */
registerForDisplayInfo(Handler h, int what, Object obj)463     void registerForDisplayInfo(Handler h, int what, Object obj);
unregisterForDisplayInfo(Handler h)464     void unregisterForDisplayInfo(Handler h);
465 
466     /**
467      * Sets the handler for Event Notifications for CallWaiting Info.
468      * Unlike the register* methods, there's only one notification handler
469      *
470      * @param h Handler for notification message.
471      * @param what User-defined message code.
472      * @param obj User object.
473      */
registerForCallWaitingInfo(Handler h, int what, Object obj)474     void registerForCallWaitingInfo(Handler h, int what, Object obj);
unregisterForCallWaitingInfo(Handler h)475     void unregisterForCallWaitingInfo(Handler h);
476 
477     /**
478      * Sets the handler for Event Notifications for Signal Info.
479      * Unlike the register* methods, there's only one notification handler
480      *
481      * @param h Handler for notification message.
482      * @param what User-defined message code.
483      * @param obj User object.
484      */
registerForSignalInfo(Handler h, int what, Object obj)485     void registerForSignalInfo(Handler h, int what, Object obj);
unregisterForSignalInfo(Handler h)486     void unregisterForSignalInfo(Handler h);
487 
488     /**
489      * Registers the handler for CDMA number information record
490      * Unlike the register* methods, there's only one notification handler
491      *
492      * @param h Handler for notification message.
493      * @param what User-defined message code.
494      * @param obj User object.
495      */
registerForNumberInfo(Handler h, int what, Object obj)496     void registerForNumberInfo(Handler h, int what, Object obj);
unregisterForNumberInfo(Handler h)497     void unregisterForNumberInfo(Handler h);
498 
499     /**
500      * Registers the handler for CDMA redirected number Information record
501      * Unlike the register* methods, there's only one notification handler
502      *
503      * @param h Handler for notification message.
504      * @param what User-defined message code.
505      * @param obj User object.
506      */
registerForRedirectedNumberInfo(Handler h, int what, Object obj)507     void registerForRedirectedNumberInfo(Handler h, int what, Object obj);
unregisterForRedirectedNumberInfo(Handler h)508     void unregisterForRedirectedNumberInfo(Handler h);
509 
510     /**
511      * Registers the handler for CDMA line control information record
512      * Unlike the register* methods, there's only one notification handler
513      *
514      * @param h Handler for notification message.
515      * @param what User-defined message code.
516      * @param obj User object.
517      */
registerForLineControlInfo(Handler h, int what, Object obj)518     void registerForLineControlInfo(Handler h, int what, Object obj);
unregisterForLineControlInfo(Handler h)519     void unregisterForLineControlInfo(Handler h);
520 
521     /**
522      * Registers the handler for CDMA T53 CLIR information record
523      * Unlike the register* methods, there's only one notification handler
524      *
525      * @param h Handler for notification message.
526      * @param what User-defined message code.
527      * @param obj User object.
528      */
registerFoT53ClirlInfo(Handler h, int what, Object obj)529     void registerFoT53ClirlInfo(Handler h, int what, Object obj);
unregisterForT53ClirInfo(Handler h)530     void unregisterForT53ClirInfo(Handler h);
531 
532     /**
533      * Registers the handler for CDMA T53 audio control information record
534      * Unlike the register* methods, there's only one notification handler
535      *
536      * @param h Handler for notification message.
537      * @param what User-defined message code.
538      * @param obj User object.
539      */
registerForT53AudioControlInfo(Handler h, int what, Object obj)540     void registerForT53AudioControlInfo(Handler h, int what, Object obj);
unregisterForT53AudioControlInfo(Handler h)541     void unregisterForT53AudioControlInfo(Handler h);
542 
543     /**
544      * Fires on if Modem enters Emergency Callback mode
545      */
setEmergencyCallbackMode(Handler h, int what, Object obj)546     void setEmergencyCallbackMode(Handler h, int what, Object obj);
547 
548      /**
549       * Fires on any CDMA OTA provision status change
550       */
registerForCdmaOtaProvision(Handler h,int what, Object obj)551      void registerForCdmaOtaProvision(Handler h,int what, Object obj);
unregisterForCdmaOtaProvision(Handler h)552      void unregisterForCdmaOtaProvision(Handler h);
553 
554      /**
555       * Registers the handler when out-band ringback tone is needed.<p>
556       *
557       *  Messages received from this:
558       *  Message.obj will be an AsyncResult
559       *  AsyncResult.userObj = obj
560       *  AsyncResult.result = boolean. <p>
561       */
registerForRingbackTone(Handler h, int what, Object obj)562      void registerForRingbackTone(Handler h, int what, Object obj);
unregisterForRingbackTone(Handler h)563      void unregisterForRingbackTone(Handler h);
564 
565      /**
566       * Registers the handler when mute/unmute need to be resent to get
567       * uplink audio during a call.<p>
568       *
569       * @param h Handler for notification message.
570       * @param what User-defined message code.
571       * @param obj User object.
572       *
573       */
registerForResendIncallMute(Handler h, int what, Object obj)574      void registerForResendIncallMute(Handler h, int what, Object obj);
unregisterForResendIncallMute(Handler h)575      void unregisterForResendIncallMute(Handler h);
576 
577      /**
578       * Registers the handler for when Cdma subscription changed events
579       *
580       * @param h Handler for notification message.
581       * @param what User-defined message code.
582       * @param obj User object.
583       *
584       */
registerForCdmaSubscriptionChanged(Handler h, int what, Object obj)585      void registerForCdmaSubscriptionChanged(Handler h, int what, Object obj);
unregisterForCdmaSubscriptionChanged(Handler h)586      void unregisterForCdmaSubscriptionChanged(Handler h);
587 
588      /**
589       * Registers the handler for when Cdma prl changed events
590       *
591       * @param h Handler for notification message.
592       * @param what User-defined message code.
593       * @param obj User object.
594       *
595       */
registerForCdmaPrlChanged(Handler h, int what, Object obj)596      void registerForCdmaPrlChanged(Handler h, int what, Object obj);
unregisterForCdmaPrlChanged(Handler h)597      void unregisterForCdmaPrlChanged(Handler h);
598 
599      /**
600       * Registers the handler for when Cdma prl changed events
601       *
602       * @param h Handler for notification message.
603       * @param what User-defined message code.
604       * @param obj User object.
605       *
606       */
registerForExitEmergencyCallbackMode(Handler h, int what, Object obj)607      void registerForExitEmergencyCallbackMode(Handler h, int what, Object obj);
unregisterForExitEmergencyCallbackMode(Handler h)608      void unregisterForExitEmergencyCallbackMode(Handler h);
609 
610      /**
611       * Registers the handler for RIL_UNSOL_RIL_CONNECT events.
612       *
613       * When ril connects or disconnects a message is sent to the registrant
614       * which contains an AsyncResult, ar, in msg.obj. The ar.result is an
615       * Integer which is the version of the ril or -1 if the ril disconnected.
616       *
617       * @param h Handler for notification message.
618       * @param what User-defined message code.
619       * @param obj User object.
620       */
registerForRilConnected(Handler h, int what, Object obj)621      void registerForRilConnected(Handler h, int what, Object obj);
unregisterForRilConnected(Handler h)622      void unregisterForRilConnected(Handler h);
623 
624     /**
625      * Supply the ICC PIN to the ICC card
626      *
627      *  returned message
628      *  retMsg.obj = AsyncResult ar
629      *  ar.exception carries exception on failure
630      *  This exception is CommandException with an error of PASSWORD_INCORRECT
631      *  if the password is incorrect
632      *
633      *  ar.result is an optional array of integers where the first entry
634      *  is the number of attempts remaining before the ICC will be PUK locked.
635      *
636      * ar.exception and ar.result are null on success
637      */
638 
supplyIccPin(String pin, Message result)639     void supplyIccPin(String pin, Message result);
640 
641     /**
642      * Supply the PIN for the app with this AID on the ICC card
643      *
644      *  AID (Application ID), See ETSI 102.221 8.1 and 101.220 4
645      *
646      *  returned message
647      *  retMsg.obj = AsyncResult ar
648      *  ar.exception carries exception on failure
649      *  This exception is CommandException with an error of PASSWORD_INCORRECT
650      *  if the password is incorrect
651      *
652      *  ar.result is an optional array of integers where the first entry
653      *  is the number of attempts remaining before the ICC will be PUK locked.
654      *
655      * ar.exception and ar.result are null on success
656      */
657 
supplyIccPinForApp(String pin, String aid, Message result)658     void supplyIccPinForApp(String pin, String aid, Message result);
659 
660     /**
661      * Supply the ICC PUK and newPin to the ICC card
662      *
663      *  returned message
664      *  retMsg.obj = AsyncResult ar
665      *  ar.exception carries exception on failure
666      *  This exception is CommandException with an error of PASSWORD_INCORRECT
667      *  if the password is incorrect
668      *
669      *  ar.result is an optional array of integers where the first entry
670      *  is the number of attempts remaining before the ICC is permanently disabled.
671      *
672      * ar.exception and ar.result are null on success
673      */
674 
supplyIccPuk(String puk, String newPin, Message result)675     void supplyIccPuk(String puk, String newPin, Message result);
676 
677     /**
678      * Supply the PUK, new pin for the app with this AID on the ICC card
679      *
680      *  AID (Application ID), See ETSI 102.221 8.1 and 101.220 4
681      *
682      *  retMsg.obj = AsyncResult ar
683      *  ar.exception carries exception on failure
684      *  This exception is CommandException with an error of PASSWORD_INCORRECT
685      *  if the password is incorrect
686      *
687      *  ar.result is an optional array of integers where the first entry
688      *  is the number of attempts remaining before the ICC is permanently disabled.
689      *
690      * ar.exception and ar.result are null on success
691      */
692 
supplyIccPukForApp(String puk, String newPin, String aid, Message result)693     void supplyIccPukForApp(String puk, String newPin, String aid, Message result);
694 
695     /**
696      * Supply the ICC PIN2 to the ICC card
697      * Only called following operation where ICC_PIN2 was
698      * returned as a a failure from a previous operation
699      *
700      *  returned message
701      *  retMsg.obj = AsyncResult ar
702      *  ar.exception carries exception on failure
703      *  This exception is CommandException with an error of PASSWORD_INCORRECT
704      *  if the password is incorrect
705      *
706      *  ar.result is an optional array of integers where the first entry
707      *  is the number of attempts remaining before the ICC will be PUK locked.
708      *
709      * ar.exception and ar.result are null on success
710      */
711 
supplyIccPin2(String pin2, Message result)712     void supplyIccPin2(String pin2, Message result);
713 
714     /**
715      * Supply the PIN2 for the app with this AID on the ICC card
716      * Only called following operation where ICC_PIN2 was
717      * returned as a a failure from a previous operation
718      *
719      *  AID (Application ID), See ETSI 102.221 8.1 and 101.220 4
720      *
721      *  returned message
722      *  retMsg.obj = AsyncResult ar
723      *  ar.exception carries exception on failure
724      *  This exception is CommandException with an error of PASSWORD_INCORRECT
725      *  if the password is incorrect
726      *
727      *  ar.result is an optional array of integers where the first entry
728      *  is the number of attempts remaining before the ICC will be PUK locked.
729      *
730      * ar.exception and ar.result are null on success
731      */
732 
supplyIccPin2ForApp(String pin2, String aid, Message result)733     void supplyIccPin2ForApp(String pin2, String aid, Message result);
734 
735     /**
736      * Supply the SIM PUK2 to the SIM card
737      * Only called following operation where SIM_PUK2 was
738      * returned as a a failure from a previous operation
739      *
740      *  returned message
741      *  retMsg.obj = AsyncResult ar
742      *  ar.exception carries exception on failure
743      *  This exception is CommandException with an error of PASSWORD_INCORRECT
744      *  if the password is incorrect
745      *
746      *  ar.result is an optional array of integers where the first entry
747      *  is the number of attempts remaining before the ICC is permanently disabled.
748      *
749      * ar.exception and ar.result are null on success
750      */
751 
supplyIccPuk2(String puk2, String newPin2, Message result)752     void supplyIccPuk2(String puk2, String newPin2, Message result);
753 
754     /**
755      * Supply the PUK2, newPin2 for the app with this AID on the ICC card
756      * Only called following operation where SIM_PUK2 was
757      * returned as a a failure from a previous operation
758      *
759      *  AID (Application ID), See ETSI 102.221 8.1 and 101.220 4
760      *
761      *  returned message
762      *  retMsg.obj = AsyncResult ar
763      *  ar.exception carries exception on failure
764      *  This exception is CommandException with an error of PASSWORD_INCORRECT
765      *  if the password is incorrect
766      *
767      *  ar.result is an optional array of integers where the first entry
768      *  is the number of attempts remaining before the ICC is permanently disabled.
769      *
770      * ar.exception and ar.result are null on success
771      */
772 
supplyIccPuk2ForApp(String puk2, String newPin2, String aid, Message result)773     void supplyIccPuk2ForApp(String puk2, String newPin2, String aid, Message result);
774 
775     // TODO: Add java doc and indicate that msg.arg1 contains the number of attempts remaining.
changeIccPin(String oldPin, String newPin, Message result)776     void changeIccPin(String oldPin, String newPin, Message result);
changeIccPinForApp(String oldPin, String newPin, String aidPtr, Message result)777     void changeIccPinForApp(String oldPin, String newPin, String aidPtr, Message result);
changeIccPin2(String oldPin2, String newPin2, Message result)778     void changeIccPin2(String oldPin2, String newPin2, Message result);
changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr, Message result)779     void changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr, Message result);
780 
changeBarringPassword(String facility, String oldPwd, String newPwd, Message result)781     void changeBarringPassword(String facility, String oldPwd, String newPwd, Message result);
782 
supplyNetworkDepersonalization(String netpin, Message result)783     void supplyNetworkDepersonalization(String netpin, Message result);
784 
785     /**
786      *  returned message
787      *  retMsg.obj = AsyncResult ar
788      *  ar.exception carries exception on failure
789      *  ar.userObject contains the orignal value of result.obj
790      *  ar.result contains a List of DriverCall
791      *      The ar.result List is sorted by DriverCall.index
792      */
getCurrentCalls(Message result)793     void getCurrentCalls (Message result);
794 
795     /**
796      *  returned message
797      *  retMsg.obj = AsyncResult ar
798      *  ar.exception carries exception on failure
799      *  ar.userObject contains the orignal value of result.obj
800      *  ar.result contains a List of DataCallResponse
801      *  @deprecated Do not use.
802      */
803     @Deprecated
getPDPContextList(Message result)804     void getPDPContextList(Message result);
805 
806     /**
807      *  returned message
808      *  retMsg.obj = AsyncResult ar
809      *  ar.exception carries exception on failure
810      *  ar.userObject contains the orignal value of result.obj
811      *  ar.result contains a List of DataCallResponse
812      */
getDataCallList(Message result)813     void getDataCallList(Message result);
814 
815     /**
816      *  returned message
817      *  retMsg.obj = AsyncResult ar
818      *  ar.exception carries exception on failure
819      *  ar.userObject contains the orignal value of result.obj
820      *  ar.result is null on success and failure
821      *
822      * CLIR_DEFAULT     == on "use subscription default value"
823      * CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation)
824      * CLIR_INVOCATION  == on "CLIR invocation" (restrict CLI presentation)
825      */
dial(String address, int clirMode, Message result)826     void dial (String address, int clirMode, Message result);
827 
828     /**
829      *  returned message
830      *  retMsg.obj = AsyncResult ar
831      *  ar.exception carries exception on failure
832      *  ar.userObject contains the orignal value of result.obj
833      *  ar.result is null on success and failure
834      *
835      * CLIR_DEFAULT     == on "use subscription default value"
836      * CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation)
837      * CLIR_INVOCATION  == on "CLIR invocation" (restrict CLI presentation)
838      */
dial(String address, int clirMode, UUSInfo uusInfo, Message result)839     void dial(String address, int clirMode, UUSInfo uusInfo, Message result);
840 
841     /**
842      *  returned message
843      *  retMsg.obj = AsyncResult ar
844      *  ar.exception carries exception on failure
845      *  ar.userObject contains the orignal value of result.obj
846      *  ar.result is String containing IMSI on success
847      */
getIMSI(Message result)848     void getIMSI(Message result);
849 
850     /**
851      *  returned message
852      *  retMsg.obj = AsyncResult ar
853      *  ar.exception carries exception on failure
854      *  ar.userObject contains the orignal value of result.obj
855      *  ar.result is String containing IMSI on success
856      */
getIMSIForApp(String aid, Message result)857     void getIMSIForApp(String aid, Message result);
858 
859     /**
860      *  returned message
861      *  retMsg.obj = AsyncResult ar
862      *  ar.exception carries exception on failure
863      *  ar.userObject contains the orignal value of result.obj
864      *  ar.result is String containing IMEI on success
865      */
getIMEI(Message result)866     void getIMEI(Message result);
867 
868     /**
869      *  returned message
870      *  retMsg.obj = AsyncResult ar
871      *  ar.exception carries exception on failure
872      *  ar.userObject contains the orignal value of result.obj
873      *  ar.result is String containing IMEISV on success
874      */
getIMEISV(Message result)875     void getIMEISV(Message result);
876 
877     /**
878      * Hang up one individual connection.
879      *  returned message
880      *  retMsg.obj = AsyncResult ar
881      *  ar.exception carries exception on failure
882      *  ar.userObject contains the orignal value of result.obj
883      *  ar.result is null on success and failure
884      *
885      *  3GPP 22.030 6.5.5
886      *  "Releases a specific active call X"
887      */
hangupConnection(int gsmIndex, Message result)888     void hangupConnection (int gsmIndex, Message result);
889 
890     /**
891      * 3GPP 22.030 6.5.5
892      *  "Releases all held calls or sets User Determined User Busy (UDUB)
893      *   for a waiting call."
894      *  ar.exception carries exception on failure
895      *  ar.userObject contains the orignal value of result.obj
896      *  ar.result is null on success and failure
897      */
hangupWaitingOrBackground(Message result)898     void hangupWaitingOrBackground (Message result);
899 
900     /**
901      * 3GPP 22.030 6.5.5
902      * "Releases all active calls (if any exist) and accepts
903      *  the other (held or waiting) call."
904      *
905      *  ar.exception carries exception on failure
906      *  ar.userObject contains the orignal value of result.obj
907      *  ar.result is null on success and failure
908      */
hangupForegroundResumeBackground(Message result)909     void hangupForegroundResumeBackground (Message result);
910 
911     /**
912      * 3GPP 22.030 6.5.5
913      * "Places all active calls (if any exist) on hold and accepts
914      *  the other (held or waiting) call."
915      *
916      *  ar.exception carries exception on failure
917      *  ar.userObject contains the orignal value of result.obj
918      *  ar.result is null on success and failure
919      */
switchWaitingOrHoldingAndActive(Message result)920     void switchWaitingOrHoldingAndActive (Message result);
921 
922     /**
923      * 3GPP 22.030 6.5.5
924      * "Adds a held call to the conversation"
925      *
926      *  ar.exception carries exception on failure
927      *  ar.userObject contains the orignal value of result.obj
928      *  ar.result is null on success and failure
929      */
conference(Message result)930     void conference (Message result);
931 
932     /**
933      * Set preferred Voice Privacy (VP).
934      *
935      * @param enable true is enhanced and false is normal VP
936      * @param result is a callback message
937      */
setPreferredVoicePrivacy(boolean enable, Message result)938     void setPreferredVoicePrivacy(boolean enable, Message result);
939 
940     /**
941      * Get currently set preferred Voice Privacy (VP) mode.
942      *
943      * @param result is a callback message
944      */
getPreferredVoicePrivacy(Message result)945     void getPreferredVoicePrivacy(Message result);
946 
947     /**
948      * 3GPP 22.030 6.5.5
949      * "Places all active calls on hold except call X with which
950      *  communication shall be supported."
951      */
separateConnection(int gsmIndex, Message result)952     void separateConnection (int gsmIndex, Message result);
953 
954     /**
955      *
956      *  ar.exception carries exception on failure
957      *  ar.userObject contains the orignal value of result.obj
958      *  ar.result is null on success and failure
959      */
acceptCall(Message result)960     void acceptCall (Message result);
961 
962     /**
963      *  also known as UDUB
964      *  ar.exception carries exception on failure
965      *  ar.userObject contains the orignal value of result.obj
966      *  ar.result is null on success and failure
967      */
rejectCall(Message result)968     void rejectCall (Message result);
969 
970     /**
971      * 3GPP 22.030 6.5.5
972      * "Connects the two calls and disconnects the subscriber from both calls"
973      *
974      *  ar.exception carries exception on failure
975      *  ar.userObject contains the orignal value of result.obj
976      *  ar.result is null on success and failure
977      */
explicitCallTransfer(Message result)978     void explicitCallTransfer (Message result);
979 
980     /**
981      * cause code returned as int[0] in Message.obj.response
982      * Returns integer cause code defined in TS 24.008
983      * Annex H or closest approximation.
984      * Most significant codes:
985      * - Any defined in 22.001 F.4 (for generating busy/congestion)
986      * - Cause 68: ACM >= ACMMax
987      */
getLastCallFailCause(Message result)988     void getLastCallFailCause (Message result);
989 
990 
991     /**
992      * Reason for last PDP context deactivate or failure to activate
993      * cause code returned as int[0] in Message.obj.response
994      * returns an integer cause code defined in TS 24.008
995      * section 6.1.3.1.3 or close approximation
996      * @deprecated Do not use.
997      */
998     @Deprecated
getLastPdpFailCause(Message result)999     void getLastPdpFailCause (Message result);
1000 
1001     /**
1002      * The preferred new alternative to getLastPdpFailCause
1003      * that is also CDMA-compatible.
1004      */
getLastDataCallFailCause(Message result)1005     void getLastDataCallFailCause (Message result);
1006 
setMute(boolean enableMute, Message response)1007     void setMute (boolean enableMute, Message response);
1008 
getMute(Message response)1009     void getMute (Message response);
1010 
1011     /**
1012      * response.obj is an AsyncResult
1013      * response.obj.result is an int[2]
1014      * response.obj.result[0] is received signal strength (0-31, 99)
1015      * response.obj.result[1] is  bit error rate (0-7, 99)
1016      * as defined in TS 27.007 8.5
1017      */
getSignalStrength(Message response)1018     void getSignalStrength (Message response);
1019 
1020 
1021     /**
1022      * response.obj.result is an int[3]
1023      * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2
1024      * response.obj.result[1] is LAC if registered or -1 if not
1025      * response.obj.result[2] is CID if registered or -1 if not
1026      * valid LAC and CIDs are 0x0000 - 0xffff
1027      *
1028      * Please note that registration state 4 ("unknown") is treated
1029      * as "out of service" above
1030      */
getVoiceRegistrationState(Message response)1031     void getVoiceRegistrationState (Message response);
1032 
1033     /**
1034      * response.obj.result is an int[3]
1035      * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2
1036      * response.obj.result[1] is LAC if registered or -1 if not
1037      * response.obj.result[2] is CID if registered or -1 if not
1038      * valid LAC and CIDs are 0x0000 - 0xffff
1039      *
1040      * Please note that registration state 4 ("unknown") is treated
1041      * as "out of service" above
1042      */
getDataRegistrationState(Message response)1043     void getDataRegistrationState (Message response);
1044 
1045     /**
1046      * response.obj.result is a String[3]
1047      * response.obj.result[0] is long alpha or null if unregistered
1048      * response.obj.result[1] is short alpha or null if unregistered
1049      * response.obj.result[2] is numeric or null if unregistered
1050      */
getOperator(Message response)1051     void getOperator(Message response);
1052 
1053     /**
1054      *  ar.exception carries exception on failure
1055      *  ar.userObject contains the orignal value of result.obj
1056      *  ar.result is null on success and failure
1057      */
sendDtmf(char c, Message result)1058     void sendDtmf(char c, Message result);
1059 
1060 
1061     /**
1062      *  ar.exception carries exception on failure
1063      *  ar.userObject contains the orignal value of result.obj
1064      *  ar.result is null on success and failure
1065      */
startDtmf(char c, Message result)1066     void startDtmf(char c, Message result);
1067 
1068     /**
1069      *  ar.exception carries exception on failure
1070      *  ar.userObject contains the orignal value of result.obj
1071      *  ar.result is null on success and failure
1072      */
stopDtmf(Message result)1073     void stopDtmf(Message result);
1074 
1075     /**
1076      *  ar.exception carries exception on failure
1077      *  ar.userObject contains the orignal value of result.obj
1078      *  ar.result is null on success and failure
1079      */
sendBurstDtmf(String dtmfString, int on, int off, Message result)1080     void sendBurstDtmf(String dtmfString, int on, int off, Message result);
1081 
1082     /**
1083      * smscPDU is smsc address in PDU form GSM BCD format prefixed
1084      *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
1085      * pdu is SMS in PDU format as an ASCII hex string
1086      *      less the SMSC address
1087      */
sendSMS(String smscPDU, String pdu, Message response)1088     void sendSMS (String smscPDU, String pdu, Message response);
1089 
1090     /**
1091      * Send an SMS message, Identical to sendSMS,
1092      * except that more messages are expected to be sent soon
1093      * smscPDU is smsc address in PDU form GSM BCD format prefixed
1094      *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
1095      * pdu is SMS in PDU format as an ASCII hex string
1096      *      less the SMSC address
1097      */
sendSMSExpectMore(String smscPDU, String pdu, Message response)1098     void sendSMSExpectMore (String smscPDU, String pdu, Message response);
1099 
1100     /**
1101      * @param pdu is CDMA-SMS in internal pseudo-PDU format
1102      * @param response sent when operation completes
1103      */
sendCdmaSms(byte[] pdu, Message response)1104     void sendCdmaSms(byte[] pdu, Message response);
1105 
1106     /**
1107      * send SMS over IMS with 3GPP/GSM SMS format
1108      * @param smscPDU is smsc address in PDU form GSM BCD format prefixed
1109      *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
1110      * @param pdu is SMS in PDU format as an ASCII hex string
1111      *      less the SMSC address
1112      * @param retry indicates if this is a retry; 0 == not retry, nonzero = retry
1113      * @param messageRef valid field if retry is set to nonzero.
1114      *        Contains messageRef from RIL_SMS_Response corresponding to failed MO SMS
1115      * @param response sent when operation completes
1116      */
sendImsGsmSms(String smscPDU, String pdu, int retry, int messageRef, Message response)1117     void sendImsGsmSms (String smscPDU, String pdu, int retry, int messageRef,
1118             Message response);
1119 
1120     /**
1121      * send SMS over IMS with 3GPP2/CDMA SMS format
1122      * @param pdu is CDMA-SMS in internal pseudo-PDU format
1123      * @param response sent when operation completes
1124      * @param retry indicates if this is a retry; 0 == not retry, nonzero = retry
1125      * @param messageRef valid field if retry is set to nonzero.
1126      *        Contains messageRef from RIL_SMS_Response corresponding to failed MO SMS
1127      * @param response sent when operation completes
1128      */
sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message response)1129     void sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message response);
1130 
1131     /**
1132      * Deletes the specified SMS record from SIM memory (EF_SMS).
1133      *
1134      * @param index index of the SMS record to delete
1135      * @param response sent when operation completes
1136      */
deleteSmsOnSim(int index, Message response)1137     void deleteSmsOnSim(int index, Message response);
1138 
1139     /**
1140      * Deletes the specified SMS record from RUIM memory (EF_SMS in DF_CDMA).
1141      *
1142      * @param index index of the SMS record to delete
1143      * @param response sent when operation completes
1144      */
deleteSmsOnRuim(int index, Message response)1145     void deleteSmsOnRuim(int index, Message response);
1146 
1147     /**
1148      * Writes an SMS message to SIM memory (EF_SMS).
1149      *
1150      * @param status status of message on SIM.  One of:
1151      *                  SmsManger.STATUS_ON_ICC_READ
1152      *                  SmsManger.STATUS_ON_ICC_UNREAD
1153      *                  SmsManger.STATUS_ON_ICC_SENT
1154      *                  SmsManger.STATUS_ON_ICC_UNSENT
1155      * @param pdu message PDU, as hex string
1156      * @param response sent when operation completes.
1157      *                  response.obj will be an AsyncResult, and will indicate
1158      *                  any error that may have occurred (eg, out of memory).
1159      */
writeSmsToSim(int status, String smsc, String pdu, Message response)1160     void writeSmsToSim(int status, String smsc, String pdu, Message response);
1161 
writeSmsToRuim(int status, String pdu, Message response)1162     void writeSmsToRuim(int status, String pdu, Message response);
1163 
setRadioPower(boolean on, Message response)1164     void setRadioPower(boolean on, Message response);
1165 
acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response)1166     void acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response);
1167 
acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response)1168     void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response);
1169 
1170     /**
1171      * Acknowledge successful or failed receipt of last incoming SMS,
1172      * including acknowledgement TPDU to send as the RP-User-Data element
1173      * of the RP-ACK or RP-ERROR PDU.
1174      *
1175      * @param success true to send RP-ACK, false to send RP-ERROR
1176      * @param ackPdu the acknowledgement TPDU in hexadecimal format
1177      * @param response sent when operation completes.
1178      */
acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response)1179     void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response);
1180 
1181     /**
1182      * parameters equivalent to 27.007 AT+CRSM command
1183      * response.obj will be an AsyncResult
1184      * response.obj.result will be an IccIoResult on success
1185      */
iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, Message response)1186     void iccIO (int command, int fileid, String path, int p1, int p2, int p3,
1187             String data, String pin2, Message response);
1188 
1189     /**
1190      * parameters equivalent to 27.007 AT+CRSM command
1191      * response.obj will be an AsyncResult
1192      * response.obj.userObj will be a IccIoResult on success
1193      */
iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid, Message response)1194     void iccIOForApp (int command, int fileid, String path, int p1, int p2, int p3,
1195             String data, String pin2, String aid, Message response);
1196 
1197     /**
1198      * (AsyncResult)response.obj).result is an int[] with element [0] set to
1199      * 1 for "CLIP is provisioned", and 0 for "CLIP is not provisioned".
1200      *
1201      * @param response is callback message
1202      */
1203 
queryCLIP(Message response)1204     void queryCLIP(Message response);
1205 
1206     /**
1207      * response.obj will be a an int[2]
1208      *
1209      * response.obj[0] will be TS 27.007 +CLIR parameter 'n'
1210      *  0 presentation indicator is used according to the subscription of the CLIR service
1211      *  1 CLIR invocation
1212      *  2 CLIR suppression
1213      *
1214      * response.obj[1] will be TS 27.007 +CLIR parameter 'm'
1215      *  0 CLIR not provisioned
1216      *  1 CLIR provisioned in permanent mode
1217      *  2 unknown (e.g. no network, etc.)
1218      *  3 CLIR temporary mode presentation restricted
1219      *  4 CLIR temporary mode presentation allowed
1220      */
1221 
getCLIR(Message response)1222     void getCLIR(Message response);
1223 
1224     /**
1225      * clirMode is one of the CLIR_* constants above
1226      *
1227      * response.obj is null
1228      */
1229 
setCLIR(int clirMode, Message response)1230     void setCLIR(int clirMode, Message response);
1231 
1232     /**
1233      * (AsyncResult)response.obj).result is an int[] with element [0] set to
1234      * 0 for disabled, 1 for enabled.
1235      *
1236      * @param serviceClass is a sum of SERVICE_CLASS_*
1237      * @param response is callback message
1238      */
1239 
queryCallWaiting(int serviceClass, Message response)1240     void queryCallWaiting(int serviceClass, Message response);
1241 
1242     /**
1243      * @param enable is true to enable, false to disable
1244      * @param serviceClass is a sum of SERVICE_CLASS_*
1245      * @param response is callback message
1246      */
1247 
setCallWaiting(boolean enable, int serviceClass, Message response)1248     void setCallWaiting(boolean enable, int serviceClass, Message response);
1249 
1250     /**
1251      * @param action is one of CF_ACTION_*
1252      * @param cfReason is one of CF_REASON_*
1253      * @param serviceClass is a sum of SERVICE_CLASSS_*
1254      */
setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds, Message response)1255     void setCallForward(int action, int cfReason, int serviceClass,
1256                 String number, int timeSeconds, Message response);
1257 
1258     /**
1259      * cfReason is one of CF_REASON_*
1260      *
1261      * ((AsyncResult)response.obj).result will be an array of
1262      * CallForwardInfo's
1263      *
1264      * An array of length 0 means "disabled for all codes"
1265      */
queryCallForwardStatus(int cfReason, int serviceClass, String number, Message response)1266     void queryCallForwardStatus(int cfReason, int serviceClass,
1267             String number, Message response);
1268 
setNetworkSelectionModeAutomatic(Message response)1269     void setNetworkSelectionModeAutomatic(Message response);
1270 
setNetworkSelectionModeManual(String operatorNumeric, Message response)1271     void setNetworkSelectionModeManual(String operatorNumeric, Message response);
1272 
1273     /**
1274      * Queries whether the current network selection mode is automatic
1275      * or manual
1276      *
1277      * ((AsyncResult)response.obj).result  is an int[] with element [0] being
1278      * a 0 for automatic selection and a 1 for manual selection
1279      */
1280 
getNetworkSelectionMode(Message response)1281     void getNetworkSelectionMode(Message response);
1282 
1283     /**
1284      * Queries the currently available networks
1285      *
1286      * ((AsyncResult)response.obj).result  is a List of NetworkInfo objects
1287      */
getAvailableNetworks(Message response)1288     void getAvailableNetworks(Message response);
1289 
getBasebandVersion(Message response)1290     void getBasebandVersion (Message response);
1291 
1292 
1293     /**
1294      * (AsyncResult)response.obj).result will be an Integer representing
1295      * the sum of enabled service classes (sum of SERVICE_CLASS_*)
1296      *
1297      * @param facility one of CB_FACILTY_*
1298      * @param password password or "" if not required
1299      * @param serviceClass is a sum of SERVICE_CLASS_*
1300      * @param response is callback message
1301      */
1302 
queryFacilityLock(String facility, String password, int serviceClass, Message response)1303     void queryFacilityLock (String facility, String password, int serviceClass,
1304         Message response);
1305 
1306     /**
1307      * (AsyncResult)response.obj).result will be an Integer representing
1308      * the sum of enabled service classes (sum of SERVICE_CLASS_*) for the
1309      * application with appId.
1310      *
1311      * @param facility one of CB_FACILTY_*
1312      * @param password password or "" if not required
1313      * @param serviceClass is a sum of SERVICE_CLASS_*
1314      * @param appId is application Id or null if none
1315      * @param response is callback message
1316      */
1317 
queryFacilityLockForApp(String facility, String password, int serviceClass, String appId, Message response)1318     void queryFacilityLockForApp(String facility, String password, int serviceClass, String appId,
1319         Message response);
1320 
1321     /**
1322      * @param facility one of CB_FACILTY_*
1323      * @param lockState true means lock, false means unlock
1324      * @param password password or "" if not required
1325      * @param serviceClass is a sum of SERVICE_CLASS_*
1326      * @param response is callback message
1327      */
setFacilityLock(String facility, boolean lockState, String password, int serviceClass, Message response)1328     void setFacilityLock (String facility, boolean lockState, String password,
1329         int serviceClass, Message response);
1330 
1331     /**
1332      * Set the facility lock for the app with this AID on the ICC card.
1333      *
1334      * @param facility one of CB_FACILTY_*
1335      * @param lockState true means lock, false means unlock
1336      * @param password password or "" if not required
1337      * @param serviceClass is a sum of SERVICE_CLASS_*
1338      * @param appId is application Id or null if none
1339      * @param response is callback message
1340      */
setFacilityLockForApp(String facility, boolean lockState, String password, int serviceClass, String appId, Message response)1341     void setFacilityLockForApp(String facility, boolean lockState, String password,
1342         int serviceClass, String appId, Message response);
1343 
sendUSSD(String ussdString, Message response)1344     void sendUSSD (String ussdString, Message response);
1345 
1346     /**
1347      * Cancels a pending USSD session if one exists.
1348      * @param response callback message
1349      */
cancelPendingUssd(Message response)1350     void cancelPendingUssd (Message response);
1351 
resetRadio(Message result)1352     void resetRadio(Message result);
1353 
1354     /**
1355      * Assign a specified band for RF configuration.
1356      *
1357      * @param bandMode one of BM_*_BAND
1358      * @param response is callback message
1359      */
setBandMode(int bandMode, Message response)1360     void setBandMode (int bandMode, Message response);
1361 
1362     /**
1363      * Query the list of band mode supported by RF.
1364      *
1365      * @param response is callback message
1366      *        ((AsyncResult)response.obj).result  is an int[] where int[0] is
1367      *        the size of the array and the rest of each element representing
1368      *        one available BM_*_BAND
1369      */
queryAvailableBandMode(Message response)1370     void queryAvailableBandMode (Message response);
1371 
1372     /**
1373      *  Requests to set the preferred network type for searching and registering
1374      * (CS/PS domain, RAT, and operation mode)
1375      * @param networkType one of  NT_*_TYPE
1376      * @param response is callback message
1377      */
setPreferredNetworkType(int networkType , Message response)1378     void setPreferredNetworkType(int networkType , Message response);
1379 
1380      /**
1381      *  Query the preferred network type setting
1382      *
1383      * @param response is callback message to report one of  NT_*_TYPE
1384      */
getPreferredNetworkType(Message response)1385     void getPreferredNetworkType(Message response);
1386 
1387     /**
1388      * Query neighboring cell ids
1389      *
1390      * @param response s callback message to cell ids
1391      * @param workSource calling WorkSource
1392      */
getNeighboringCids(Message response, WorkSource workSource)1393     default void getNeighboringCids(Message response, WorkSource workSource){}
1394 
1395     /**
1396      * Request to enable/disable network state change notifications when
1397      * location information (lac and/or cid) has changed.
1398      *
1399      * @param enable true to enable, false to disable
1400      * @param response callback message
1401      */
setLocationUpdates(boolean enable, Message response)1402     void setLocationUpdates(boolean enable, Message response);
1403 
1404     /**
1405      * Gets the default SMSC address.
1406      *
1407      * @param result Callback message contains the SMSC address.
1408      */
getSmscAddress(Message result)1409     void getSmscAddress(Message result);
1410 
1411     /**
1412      * Sets the default SMSC address.
1413      *
1414      * @param address new SMSC address
1415      * @param result Callback message is empty on completion
1416      */
setSmscAddress(String address, Message result)1417     void setSmscAddress(String address, Message result);
1418 
1419     /**
1420      * Indicates whether there is storage available for new SMS messages.
1421      * @param available true if storage is available
1422      * @param result callback message
1423      */
reportSmsMemoryStatus(boolean available, Message result)1424     void reportSmsMemoryStatus(boolean available, Message result);
1425 
1426     /**
1427      * Indicates to the vendor ril that StkService is running
1428      * and is ready to receive RIL_UNSOL_STK_XXXX commands.
1429      *
1430      * @param result callback message
1431      */
reportStkServiceIsRunning(Message result)1432     void reportStkServiceIsRunning(Message result);
1433 
invokeOemRilRequestRaw(byte[] data, Message response)1434     void invokeOemRilRequestRaw(byte[] data, Message response);
1435 
invokeOemRilRequestStrings(String[] strings, Message response)1436     void invokeOemRilRequestStrings(String[] strings, Message response);
1437 
1438     /**
1439      * Fires when RIL_UNSOL_OEM_HOOK_RAW is received from the RIL.
1440      */
setOnUnsolOemHookRaw(Handler h, int what, Object obj)1441     void setOnUnsolOemHookRaw(Handler h, int what, Object obj);
unSetOnUnsolOemHookRaw(Handler h)1442     void unSetOnUnsolOemHookRaw(Handler h);
1443 
1444     /**
1445      * Send TERMINAL RESPONSE to the SIM, after processing a proactive command
1446      * sent by the SIM.
1447      *
1448      * @param contents  String containing SAT/USAT response in hexadecimal
1449      *                  format starting with first byte of response data. See
1450      *                  TS 102 223 for details.
1451      * @param response  Callback message
1452      */
sendTerminalResponse(String contents, Message response)1453     public void sendTerminalResponse(String contents, Message response);
1454 
1455     /**
1456      * Send ENVELOPE to the SIM, after processing a proactive command sent by
1457      * the SIM.
1458      *
1459      * @param contents  String containing SAT/USAT response in hexadecimal
1460      *                  format starting with command tag. See TS 102 223 for
1461      *                  details.
1462      * @param response  Callback message
1463      */
sendEnvelope(String contents, Message response)1464     public void sendEnvelope(String contents, Message response);
1465 
1466     /**
1467      * Send ENVELOPE to the SIM, such as an SMS-PP data download envelope
1468      * for a SIM data download message. This method has one difference
1469      * from {@link #sendEnvelope}: The SW1 and SW2 status bytes from the UICC response
1470      * are returned along with the response data.
1471      *
1472      * response.obj will be an AsyncResult
1473      * response.obj.result will be an IccIoResult on success
1474      *
1475      * @param contents  String containing SAT/USAT response in hexadecimal
1476      *                  format starting with command tag. See TS 102 223 for
1477      *                  details.
1478      * @param response  Callback message
1479      */
sendEnvelopeWithStatus(String contents, Message response)1480     public void sendEnvelopeWithStatus(String contents, Message response);
1481 
1482     /**
1483      * Accept or reject the call setup request from SIM.
1484      *
1485      * @param accept   true if the call is to be accepted, false otherwise.
1486      * @param response Callback message
1487      */
handleCallSetupRequestFromSim(boolean accept, Message response)1488     public void handleCallSetupRequestFromSim(boolean accept, Message response);
1489 
1490     /**
1491      * Activate or deactivate cell broadcast SMS for GSM.
1492      *
1493      * @param activate
1494      *            true = activate, false = deactivate
1495      * @param result Callback message is empty on completion
1496      */
setGsmBroadcastActivation(boolean activate, Message result)1497     public void setGsmBroadcastActivation(boolean activate, Message result);
1498 
1499     /**
1500      * Configure cell broadcast SMS for GSM.
1501      *
1502      * @param response Callback message is empty on completion
1503      */
setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response)1504     public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response);
1505 
1506     /**
1507      * Query the current configuration of cell broadcast SMS of GSM.
1508      *
1509      * @param response
1510      *        Callback message contains the configuration from the modem
1511      *        on completion
1512      */
getGsmBroadcastConfig(Message response)1513     public void getGsmBroadcastConfig(Message response);
1514 
1515     //***** new Methods for CDMA support
1516 
1517     /**
1518      * Request the device ESN / MEID / IMEI / IMEISV.
1519      * "response" is const char **
1520      *   [0] is IMEI if GSM subscription is available
1521      *   [1] is IMEISV if GSM subscription is available
1522      *   [2] is ESN if CDMA subscription is available
1523      *   [3] is MEID if CDMA subscription is available
1524      */
getDeviceIdentity(Message response)1525     public void getDeviceIdentity(Message response);
1526 
1527     /**
1528      * Request the device MDN / H_SID / H_NID / MIN.
1529      * "response" is const char **
1530      *   [0] is MDN if CDMA subscription is available
1531      *   [1] is a comma separated list of H_SID (Home SID) in decimal format
1532      *       if CDMA subscription is available
1533      *   [2] is a comma separated list of H_NID (Home NID) in decimal format
1534      *       if CDMA subscription is available
1535      *   [3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
1536      */
getCDMASubscription(Message response)1537     public void getCDMASubscription(Message response);
1538 
1539     /**
1540      * Send Flash Code.
1541      * "response" is is NULL
1542      *   [0] is a FLASH string
1543      */
sendCDMAFeatureCode(String FeatureCode, Message response)1544     public void sendCDMAFeatureCode(String FeatureCode, Message response);
1545 
1546     /** Set the Phone type created */
setPhoneType(int phoneType)1547     void setPhoneType(int phoneType);
1548 
1549     /**
1550      *  Query the CDMA roaming preference setting
1551      *
1552      * @param response is callback message to report one of  CDMA_RM_*
1553      */
queryCdmaRoamingPreference(Message response)1554     void queryCdmaRoamingPreference(Message response);
1555 
1556     /**
1557      *  Requests to set the CDMA roaming preference
1558      * @param cdmaRoamingType one of  CDMA_RM_*
1559      * @param response is callback message
1560      */
setCdmaRoamingPreference(int cdmaRoamingType, Message response)1561     void setCdmaRoamingPreference(int cdmaRoamingType, Message response);
1562 
1563     /**
1564      *  Requests to set the CDMA subscription mode
1565      * @param cdmaSubscriptionType one of  CDMA_SUBSCRIPTION_*
1566      * @param response is callback message
1567      */
setCdmaSubscriptionSource(int cdmaSubscriptionType, Message response)1568     void setCdmaSubscriptionSource(int cdmaSubscriptionType, Message response);
1569 
1570     /**
1571      *  Requests to get the CDMA subscription srouce
1572      * @param response is callback message
1573      */
getCdmaSubscriptionSource(Message response)1574     void getCdmaSubscriptionSource(Message response);
1575 
1576     /**
1577      *  Set the TTY mode
1578      *
1579      * @param ttyMode one of the following:
1580      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1581      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1582      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1583      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
1584      * @param response is callback message
1585      */
setTTYMode(int ttyMode, Message response)1586     void setTTYMode(int ttyMode, Message response);
1587 
1588     /**
1589      *  Query the TTY mode
1590      * (AsyncResult)response.obj).result is an int[] with element [0] set to
1591      * tty mode:
1592      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1593      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1594      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1595      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
1596      * @param response is callback message
1597      */
queryTTYMode(Message response)1598     void queryTTYMode(Message response);
1599 
1600     /**
1601      * Setup a packet data connection On successful completion, the result
1602      * message will return a {@link com.android.internal.telephony.dataconnection.DataCallResponse}
1603      * object containing the connection information.
1604      *
1605      * @param radioTechnology
1606      *            Radio technology to use. Values is one of RIL_RADIO_TECHNOLOGY_*
1607      * @param dataProfile
1608      *            Data profile for data call setup
1609      * @param isRoaming
1610      *            Device is roaming or not
1611      * @param allowRoaming
1612      *            Flag indicating data roaming is enabled or not
1613      * @param result
1614      *            Callback message
1615      */
setupDataCall(int radioTechnology, DataProfile dataProfile, boolean isRoaming, boolean allowRoaming, Message result)1616     void setupDataCall(int radioTechnology, DataProfile dataProfile, boolean isRoaming,
1617                        boolean allowRoaming, Message result);
1618 
1619     /**
1620      * Deactivate packet data connection
1621      *
1622      * @param cid
1623      *            The connection ID
1624      * @param reason
1625      *            Data disconnect reason.
1626      * @param result
1627      *            Callback message is empty on completion
1628      */
deactivateDataCall(int cid, int reason, Message result)1629     public void deactivateDataCall(int cid, int reason, Message result);
1630 
1631     /**
1632      * Activate or deactivate cell broadcast SMS for CDMA.
1633      *
1634      * @param activate
1635      *            true = activate, false = deactivate
1636      * @param result
1637      *            Callback message is empty on completion
1638      */
setCdmaBroadcastActivation(boolean activate, Message result)1639     public void setCdmaBroadcastActivation(boolean activate, Message result);
1640 
1641     /**
1642      * Configure cdma cell broadcast SMS.
1643      *
1644      * @param response
1645      *            Callback message is empty on completion
1646      */
setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response)1647     public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response);
1648 
1649     /**
1650      * Query the current configuration of cdma cell broadcast SMS.
1651      *
1652      * @param result
1653      *            Callback message contains the configuration from the modem on completion
1654      */
getCdmaBroadcastConfig(Message result)1655     public void getCdmaBroadcastConfig(Message result);
1656 
1657     /**
1658      *  Requests the radio's system selection module to exit emergency callback mode.
1659      *  This function should only be called from for CDMA.
1660      *
1661      * @param response callback message
1662      */
exitEmergencyCallbackMode(Message response)1663     public void exitEmergencyCallbackMode(Message response);
1664 
1665     /**
1666      * Request the status of the ICC and UICC cards.
1667      *
1668      * @param result
1669      *          Callback message containing {@link IccCardStatus} structure for the card.
1670      */
getIccCardStatus(Message result)1671     public void getIccCardStatus(Message result);
1672 
1673     /**
1674      * Return if the current radio is LTE on CDMA. This
1675      * is a tri-state return value as for a period of time
1676      * the mode may be unknown.
1677      *
1678      * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE}
1679      * or {@link PhoneConstants#LTE_ON_CDMA_TRUE}
1680      */
getLteOnCdmaMode()1681     public int getLteOnCdmaMode();
1682 
1683     /**
1684      * Request the ISIM application on the UICC to perform the AKA
1685      * challenge/response algorithm for IMS authentication. The nonce string
1686      * and challenge response are Base64 encoded Strings.
1687      *
1688      * @param nonce the nonce string to pass with the ISIM authentication request
1689      * @param response a callback message with the String response in the obj field
1690      * @deprecated
1691      * @see requestIccSimAuthentication
1692      */
requestIsimAuthentication(String nonce, Message response)1693     public void requestIsimAuthentication(String nonce, Message response);
1694 
1695     /**
1696      * Request the SIM application on the UICC to perform authentication
1697      * challenge/response algorithm. The data string and challenge response are
1698      * Base64 encoded Strings.
1699      * Can support EAP-SIM, EAP-AKA with results encoded per 3GPP TS 31.102.
1700      *
1701      * @param authContext is the P2 parameter that specifies the authentication context per 3GPP TS
1702      *                    31.102 (Section 7.1.2)
1703      * @param data authentication challenge data
1704      * @param aid used to determine which application/slot to send the auth command to. See ETSI
1705      *            102.221 8.1 and 101.220 4
1706      * @param response a callback message with the String response in the obj field
1707      */
requestIccSimAuthentication(int authContext, String data, String aid, Message response)1708     public void requestIccSimAuthentication(int authContext, String data, String aid, Message response);
1709 
1710     /**
1711      * Get the current Voice Radio Technology.
1712      *
1713      * AsyncResult.result is an int array with the first value
1714      * being one of the ServiceState.RIL_RADIO_TECHNOLOGY_xxx values.
1715      *
1716      * @param result is sent back to handler and result.obj is a AsyncResult
1717      */
getVoiceRadioTechnology(Message result)1718     void getVoiceRadioTechnology(Message result);
1719 
1720     /**
1721      * Return the current set of CellInfo records
1722      *
1723      * AsyncResult.result is a of Collection<CellInfo>
1724      *
1725      * @param result is sent back to handler and result.obj is a AsyncResult
1726      * @param workSource calling WorkSource
1727      */
getCellInfoList(Message result, WorkSource workSource)1728     default void getCellInfoList(Message result, WorkSource workSource) {}
1729 
1730     /**
1731      * Sets the minimum time in milli-seconds between when RIL_UNSOL_CELL_INFO_LIST
1732      * should be invoked.
1733      *
1734      * The default, 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported
1735      * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
1736      * A RIL_UNSOL_CELL_INFO_LIST.
1737      *
1738      *
1739 
1740      * @param rateInMillis is sent back to handler and result.obj is a AsyncResult
1741      * @param response.obj is AsyncResult ar when sent to associated handler
1742      *                        ar.exception carries exception on failure or null on success
1743      *                        otherwise the error.
1744      * @param workSource calling WorkSource
1745      */
setCellInfoListRate(int rateInMillis, Message response, WorkSource workSource)1746     default void setCellInfoListRate(int rateInMillis, Message response, WorkSource workSource){}
1747 
1748     /**
1749      * Fires when RIL_UNSOL_CELL_INFO_LIST is received from the RIL.
1750      */
registerForCellInfoList(Handler h, int what, Object obj)1751     void registerForCellInfoList(Handler h, int what, Object obj);
unregisterForCellInfoList(Handler h)1752     void unregisterForCellInfoList(Handler h);
1753 
1754     /**
1755      * Set Initial Attach Apn
1756      *
1757      * @param dataProfile
1758      *            data profile for initial APN attach
1759      * @param isRoaming
1760      *            indicating the device is roaming or not
1761      * @param result
1762      *            callback message contains the information of SUCCESS/FAILURE
1763      */
setInitialAttachApn(DataProfile dataProfile, boolean isRoaming, Message result)1764     void setInitialAttachApn(DataProfile dataProfile, boolean isRoaming, Message result);
1765 
1766     /**
1767      * Set data profiles in modem
1768      *
1769      * @param dps
1770      *            Array of the data profiles set to modem
1771      * @param isRoaming
1772      *            Indicating if the device is roaming or not
1773      * @param result
1774      *            callback message contains the information of SUCCESS/FAILURE
1775      */
setDataProfile(DataProfile[] dps, boolean isRoaming, Message result)1776     void setDataProfile(DataProfile[] dps, boolean isRoaming, Message result);
1777 
1778     /**
1779      * Notifiy that we are testing an emergency call
1780      */
testingEmergencyCall()1781     public void testingEmergencyCall();
1782 
1783     /**
1784      * Open a logical channel to the SIM.
1785      *
1786      * Input parameters equivalent to TS 27.007 AT+CCHO command.
1787      *
1788      * @param AID Application id. See ETSI 102.221 and 101.220.
1789      * @param p2 P2 parameter (described in ISO 7816-4).
1790      * @param response Callback message. response.obj will be an int [1] with
1791      *            element [0] set to the id of the logical channel.
1792      */
iccOpenLogicalChannel(String AID, int p2, Message response)1793     public void iccOpenLogicalChannel(String AID, int p2, Message response);
1794 
1795     /**
1796      * Close a previously opened logical channel to the SIM.
1797      *
1798      * Input parameters equivalent to TS 27.007 AT+CCHC command.
1799      *
1800      * @param channel Channel id. Id of the channel to be closed.
1801      * @param response Callback message.
1802      */
iccCloseLogicalChannel(int channel, Message response)1803     public void iccCloseLogicalChannel(int channel, Message response);
1804 
1805     /**
1806      * Exchange APDUs with the SIM on a logical channel.
1807      *
1808      * Input parameters equivalent to TS 27.007 AT+CGLA command.
1809      *
1810      * @param channel Channel id of the channel to use for communication. Has to
1811      *            be greater than zero.
1812      * @param cla Class of the APDU command.
1813      * @param instruction Instruction of the APDU command.
1814      * @param p1 P1 value of the APDU command.
1815      * @param p2 P2 value of the APDU command.
1816      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
1817      *            is sent to the SIM.
1818      * @param data Data to be sent with the APDU.
1819      * @param response Callback message. response.obj.userObj will be
1820      *            an IccIoResult on success.
1821      */
iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message response)1822     public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction,
1823             int p1, int p2, int p3, String data, Message response);
1824 
1825     /**
1826      * Exchange APDUs with the SIM on a basic channel.
1827      *
1828      * Input parameters equivalent to TS 27.007 AT+CSIM command.
1829      *
1830      * @param cla Class of the APDU command.
1831      * @param instruction Instruction of the APDU command.
1832      * @param p1 P1 value of the APDU command.
1833      * @param p2 P2 value of the APDU command.
1834      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
1835      *            is sent to the SIM.
1836      * @param data Data to be sent with the APDU.
1837      * @param response Callback message. response.obj.userObj will be
1838      *            an IccIoResult on success.
1839      */
iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data, Message response)1840     public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2,
1841             int p3, String data, Message response);
1842 
1843     /**
1844      * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
1845      * Used for device configuration by some CDMA operators.
1846      *
1847      * @param itemID the ID of the item to read
1848      * @param response callback message with the String response in the obj field
1849      */
nvReadItem(int itemID, Message response)1850     void nvReadItem(int itemID, Message response);
1851 
1852     /**
1853      * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
1854      * Used for device configuration by some CDMA operators.
1855      *
1856      * @param itemID the ID of the item to read
1857      * @param itemValue the value to write, as a String
1858      * @param response Callback message.
1859      */
nvWriteItem(int itemID, String itemValue, Message response)1860     void nvWriteItem(int itemID, String itemValue, Message response);
1861 
1862     /**
1863      * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
1864      * Used for device configuration by some CDMA operators.
1865      *
1866      * @param preferredRoamingList byte array containing the new PRL
1867      * @param response Callback message.
1868      */
nvWriteCdmaPrl(byte[] preferredRoamingList, Message response)1869     void nvWriteCdmaPrl(byte[] preferredRoamingList, Message response);
1870 
1871     /**
1872      * Perform the specified type of NV config reset. The radio will be taken offline
1873      * and the device must be rebooted after erasing the NV. Used for device
1874      * configuration by some CDMA operators.
1875      *
1876      * @param resetType reset type: 1: reload NV reset, 2: erase NV reset, 3: factory NV reset
1877      * @param response Callback message.
1878      */
nvResetConfig(int resetType, Message response)1879     void nvResetConfig(int resetType, Message response);
1880 
1881     /**
1882      *  returned message
1883      *  retMsg.obj = AsyncResult ar
1884      *  ar.exception carries exception on failure
1885      *  ar.userObject contains the orignal value of result.obj
1886      *  ar.result contains a List of HardwareConfig
1887      */
getHardwareConfig(Message result)1888     void getHardwareConfig (Message result);
1889 
1890     /**
1891      * @return version of the ril.
1892      */
getRilVersion()1893     int getRilVersion();
1894 
1895    /**
1896      * Sets user selected subscription at Modem.
1897      *
1898      * @param slotId
1899      *          Slot.
1900      * @param appIndex
1901      *          Application index in the card.
1902      * @param subId
1903      *          Indicates subscription 0 or subscription 1.
1904      * @param subStatus
1905      *          Activation status, 1 = activate and 0 = deactivate.
1906      * @param result
1907      *          Callback message contains the information of SUCCESS/FAILURE.
1908      */
1909     // FIXME Update the doc and consider modifying the request to make more generic.
setUiccSubscription(int slotId, int appIndex, int subId, int subStatus, Message result)1910     public void setUiccSubscription(int slotId, int appIndex, int subId, int subStatus,
1911             Message result);
1912 
1913     /**
1914      * Tells the modem if data is allowed or not.
1915      *
1916      * @param allowed
1917      *          true = allowed, false = not alowed
1918      * @param result
1919      *          Callback message contains the information of SUCCESS/FAILURE.
1920      */
1921     // FIXME We may need to pass AID and slotid also
setDataAllowed(boolean allowed, Message result)1922     public void setDataAllowed(boolean allowed, Message result);
1923 
1924     /**
1925      * Inform RIL that the device is shutting down
1926      *
1927      * @param result Callback message contains the information of SUCCESS/FAILURE
1928      */
requestShutdown(Message result)1929     public void requestShutdown(Message result);
1930 
1931     /**
1932      *  Set phone radio type and access technology.
1933      *
1934      *  @param rc the phone radio capability defined in
1935      *         RadioCapability. It's a input object used to transfer parameter to logic modem
1936      *
1937      *  @param result Callback message.
1938      */
setRadioCapability(RadioCapability rc, Message result)1939     public void setRadioCapability(RadioCapability rc, Message result);
1940 
1941     /**
1942      *  Get phone radio capability
1943      *
1944      *  @param result Callback message.
1945      */
getRadioCapability(Message result)1946     public void getRadioCapability(Message result);
1947 
1948     /**
1949      * Registers the handler when phone radio capability is changed.
1950      *
1951      * @param h Handler for notification message.
1952      * @param what User-defined message code.
1953      * @param obj User object.
1954      */
registerForRadioCapabilityChanged(Handler h, int what, Object obj)1955     public void registerForRadioCapabilityChanged(Handler h, int what, Object obj);
1956 
1957     /**
1958      * Unregister for notifications when phone radio capability is changed.
1959      *
1960      * @param h Handler to be removed from the registrant list.
1961      */
unregisterForRadioCapabilityChanged(Handler h)1962     public void unregisterForRadioCapabilityChanged(Handler h);
1963 
1964     /**
1965      * Start LCE (Link Capacity Estimation) service with a desired reporting interval.
1966      *
1967      * @param reportIntervalMs
1968      *        LCE info reporting interval (ms).
1969      *
1970      * @param result Callback message contains the current LCE status.
1971      * {byte status, int actualIntervalMs}
1972      */
startLceService(int reportIntervalMs, boolean pullMode, Message result)1973     public void startLceService(int reportIntervalMs, boolean pullMode, Message result);
1974 
1975     /**
1976      * Stop LCE service.
1977      *
1978      * @param result Callback message contains the current LCE status:
1979      * {byte status, int actualIntervalMs}
1980      *
1981      */
stopLceService(Message result)1982     public void stopLceService(Message result);
1983 
1984     /**
1985      * Pull LCE service for capacity data.
1986      *
1987      * @param result Callback message contains the capacity info:
1988      * {int capacityKbps, byte confidenceLevel, byte lceSuspendedTemporarily}
1989      */
pullLceData(Message result)1990     public void pullLceData(Message result);
1991 
1992     /**
1993      * Register a LCE info listener.
1994      *
1995      * @param h Handler for notification message.
1996      * @param what User-defined message code.
1997      * @param obj User object.
1998      */
registerForLceInfo(Handler h, int what, Object obj)1999     void registerForLceInfo(Handler h, int what, Object obj);
2000 
2001     /**
2002      * Unregister the LCE Info listener.
2003      *
2004      * @param h handle to be removed.
2005      */
unregisterForLceInfo(Handler h)2006     void unregisterForLceInfo(Handler h);
2007 
2008     /**
2009      *
2010      * Get modem activity info and stats
2011      *
2012      * @param result Callback message contains the modem activity information
2013      */
getModemActivityInfo(Message result)2014     public void getModemActivityInfo(Message result);
2015 
2016     /**
2017      * Set allowed carriers
2018      *
2019      * @param carriers Allowed carriers
2020      * @param result Callback message contains the number of carriers set successfully
2021      */
setAllowedCarriers(List<CarrierIdentifier> carriers, Message result)2022     public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message result);
2023 
2024     /**
2025      * Get allowed carriers
2026      *
2027      * @param result Callback message contains the allowed carriers
2028      */
getAllowedCarriers(Message result)2029     public void getAllowedCarriers(Message result);
2030 
2031     /**
2032      * Register for unsolicited PCO data.  This information is carrier-specific,
2033      * opaque binary blobs destined for carrier apps for interpretation.
2034      *
2035      * @param h Handler for notificaiton message.
2036      * @param what User-defined message code.
2037      * @param obj User object.
2038      */
registerForPcoData(Handler h, int what, Object obj)2039     public void registerForPcoData(Handler h, int what, Object obj);
2040 
2041     /**
2042      * Unregister for PCO data.
2043      *
2044      * @param h handler to be removed
2045      */
unregisterForPcoData(Handler h)2046     public void unregisterForPcoData(Handler h);
2047 
2048     /**
2049      * Send the updated device state
2050      *
2051      * @param stateType Device state type
2052      * @param state True if enabled, otherwise disabled
2053      * @param result callback message contains the information of SUCCESS/FAILURE
2054      */
sendDeviceState(int stateType, boolean state, Message result)2055     void sendDeviceState(int stateType, boolean state, Message result);
2056 
2057     /**
2058      * Send the device state to the modem
2059      *
2060      * @param filter unsolicited response filter. See DeviceStateMonitor.UnsolicitedResponseFilter
2061      * @param result callback message contains the information of SUCCESS/FAILURE
2062      */
setUnsolResponseFilter(int filter, Message result)2063     void setUnsolResponseFilter(int filter, Message result);
2064 
2065     /**
2066      * Set SIM card power up or down
2067      *
2068      * @param powerUp True if powering up the sim card
2069      * @param result callback message contains the information of SUCCESS/FAILURE
2070      */
setSimCardPower(boolean powerUp, Message result)2071     void setSimCardPower(boolean powerUp, Message result);
2072 
getClientRequestStats()2073     default public List<ClientRequestStats> getClientRequestStats() {
2074         return null;
2075     }
2076 }
2077