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