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