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