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