1 /*
2  * Copyright (C) 2007 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.app.PendingIntent;
20 import android.content.Intent;
21 import android.content.IntentSender;
22 import android.os.Bundle;
23 import android.os.IBinder;
24 import android.os.Messenger;
25 import android.os.ParcelFileDescriptor;
26 import android.os.ResultReceiver;
27 import android.os.WorkSource;
28 import android.net.NetworkStats;
29 import android.net.Uri;
30 import android.service.carrier.CarrierIdentifier;
31 import android.telecom.PhoneAccount;
32 import android.telecom.PhoneAccountHandle;
33 import android.telephony.CallForwardingInfo;
34 import android.telephony.CarrierRestrictionRules;
35 import android.telephony.CellIdentity;
36 import android.telephony.CellInfo;
37 import android.telephony.ClientRequestStats;
38 import android.telephony.IccOpenLogicalChannelResponse;
39 import android.telephony.ICellInfoCallback;
40 import android.telephony.ModemActivityInfo;
41 import android.telephony.NeighboringCellInfo;
42 import android.telephony.NetworkScanRequest;
43 import android.telephony.PhoneNumberRange;
44 import android.telephony.RadioAccessFamily;
45 import android.telephony.RadioAccessSpecifier;
46 import android.telephony.ServiceState;
47 import android.telephony.SignalStrength;
48 import android.telephony.TelephonyHistogram;
49 import android.telephony.VisualVoicemailSmsFilterSettings;
50 import android.telephony.emergency.EmergencyNumber;
51 import android.telephony.ims.aidl.IImsCapabilityCallback;
52 import android.telephony.ims.aidl.IImsConfig;
53 import android.telephony.ims.aidl.IImsConfigCallback;
54 import android.telephony.ims.aidl.IImsMmTelFeature;
55 import android.telephony.ims.aidl.IImsRcsFeature;
56 import android.telephony.ims.aidl.IImsRegistration;
57 import android.telephony.ims.aidl.IImsRegistrationCallback;
58 import com.android.ims.internal.IImsServiceFeatureCallback;
59 import com.android.internal.telephony.CellNetworkScanResult;
60 import com.android.internal.telephony.IBooleanConsumer;
61 import com.android.internal.telephony.IIntegerConsumer;
62 import com.android.internal.telephony.INumberVerificationCallback;
63 import com.android.internal.telephony.OperatorInfo;
64 
65 import java.util.List;
66 import java.util.Map;
67 
68 import android.telephony.UiccCardInfo;
69 import android.telephony.UiccSlotInfo;
70 
71 /**
72  * Interface used to interact with the phone.  Mostly this is used by the
73  * TelephonyManager class.  A few places are still using this directly.
74  * Please clean them up if possible and use TelephonyManager instead.
75  *
76  * {@hide}
77  */
78 interface ITelephony {
79 
80     /**
81      * Dial a number. This doesn't place the call. It displays
82      * the Dialer screen.
83      * @param number the number to be dialed. If null, this
84      * would display the Dialer screen with no number pre-filled.
85      */
86     @UnsupportedAppUsage
dial(String number)87     void dial(String number);
88 
89     /**
90      * Place a call to the specified number.
91      * @param callingPackage The package making the call.
92      * @param number the number to be called.
93      */
94     @UnsupportedAppUsage
call(String callingPackage, String number)95     void call(String callingPackage, String number);
96 
97     /** @deprecated Use {@link #isRadioOnWithFeature(String, String) instead */
98     @UnsupportedAppUsage
isRadioOn(String callingPackage)99     boolean isRadioOn(String callingPackage);
100 
101     /**
102      * Check to see if the radio is on or not.
103      * @param callingPackage the name of the package making the call.
104      * @param callingFeatureId The feature in the package.
105      * @return returns true if the radio is on.
106      */
isRadioOnWithFeature(String callingPackage, String callingFeatureId)107     boolean isRadioOnWithFeature(String callingPackage, String callingFeatureId);
108 
109     /**
110      * @deprecated Use {@link #isRadioOnForSubscriberWithFeature(int, String, String) instead
111      */
112     @UnsupportedAppUsage
isRadioOnForSubscriber(int subId, String callingPackage)113     boolean isRadioOnForSubscriber(int subId, String callingPackage);
114 
115     /**
116      * Check to see if the radio is on or not on particular subId.
117      * @param subId user preferred subId.
118      * @param callingPackage the name of the package making the call.
119      * @param callingFeatureId The feature in the package.
120      * @return returns true if the radio is on.
121      */
isRadioOnForSubscriberWithFeature(int subId, String callingPackage, String callingFeatureId)122     boolean isRadioOnForSubscriberWithFeature(int subId, String callingPackage, String callingFeatureId);
123 
124 
125     /**
126      * Supply a pin to unlock the SIM for particular subId.
127      * Blocks until a result is determined.
128      * @param pin The pin to check.
129      * @param subId user preferred subId.
130      * @return whether the operation was a success.
131      */
supplyPinForSubscriber(int subId, String pin)132     boolean supplyPinForSubscriber(int subId, String pin);
133 
134     /**
135      * Supply puk to unlock the SIM and set SIM pin to new pin.
136      *  Blocks until a result is determined.
137      * @param puk The puk to check.
138      *        pin The new pin to be set in SIM
139      * @param subId user preferred subId.
140      * @return whether the operation was a success.
141      */
supplyPukForSubscriber(int subId, String puk, String pin)142     boolean supplyPukForSubscriber(int subId, String puk, String pin);
143 
144     /**
145      * Supply a pin to unlock the SIM.  Blocks until a result is determined.
146      * Returns a specific success/error code.
147      * @param pin The pin to check.
148      * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
149      *         retValue[1] = number of attempts remaining if known otherwise -1
150      */
supplyPinReportResultForSubscriber(int subId, String pin)151     int[] supplyPinReportResultForSubscriber(int subId, String pin);
152 
153     /**
154      * Supply puk to unlock the SIM and set SIM pin to new pin.
155      * Blocks until a result is determined.
156      * Returns a specific success/error code
157      * @param puk The puk to check
158      *        pin The pin to check.
159      * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
160      *         retValue[1] = number of attempts remaining if known otherwise -1
161      */
supplyPukReportResultForSubscriber(int subId, String puk, String pin)162     int[] supplyPukReportResultForSubscriber(int subId, String puk, String pin);
163 
164     /**
165      * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
166      * without SEND (so <code>dial</code> is not appropriate).
167      *
168      * @param dialString the MMI command to be executed.
169      * @return true if MMI command is executed.
170      */
171     @UnsupportedAppUsage
handlePinMmi(String dialString)172     boolean handlePinMmi(String dialString);
173 
174 
175     /**
176      * Handles USSD commands.
177      *
178      * @param subId The subscription to use.
179      * @param ussdRequest the USSD command to be executed.
180      * @param wrappedCallback receives a callback result.
181      */
handleUssdRequest(int subId, String ussdRequest, in ResultReceiver wrappedCallback)182     void handleUssdRequest(int subId, String ussdRequest, in ResultReceiver wrappedCallback);
183 
184     /**
185      * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
186      * without SEND (so <code>dial</code> is not appropriate) for
187      * a particular subId.
188      * @param dialString the MMI command to be executed.
189      * @param subId user preferred subId.
190      * @return true if MMI command is executed.
191      */
192     @UnsupportedAppUsage
handlePinMmiForSubscriber(int subId, String dialString)193     boolean handlePinMmiForSubscriber(int subId, String dialString);
194 
195     /**
196      * Toggles the radio on or off.
197      */
198     @UnsupportedAppUsage
toggleRadioOnOff()199     void toggleRadioOnOff();
200 
201     /**
202      * Toggles the radio on or off on particular subId.
203      * @param subId user preferred subId.
204      */
toggleRadioOnOffForSubscriber(int subId)205     void toggleRadioOnOffForSubscriber(int subId);
206 
207     /**
208      * Set the radio to on or off
209      */
210     @UnsupportedAppUsage
setRadio(boolean turnOn)211     boolean setRadio(boolean turnOn);
212 
213     /**
214      * Set the radio to on or off on particular subId.
215      * @param subId user preferred subId.
216      */
setRadioForSubscriber(int subId, boolean turnOn)217     boolean setRadioForSubscriber(int subId, boolean turnOn);
218 
219     /**
220      * Set the radio to on or off unconditionally
221      */
setRadioPower(boolean turnOn)222     boolean setRadioPower(boolean turnOn);
223 
224     /**
225      * This method has been removed due to security and stability issues.
226      */
227     @UnsupportedAppUsage
updateServiceLocation()228     void updateServiceLocation();
229 
230     /**
231      * Version of updateServiceLocation that records the caller and validates permissions.
232      */
updateServiceLocationWithPackageName(String callingPkg)233     void updateServiceLocationWithPackageName(String callingPkg);
234 
235     /**
236      * This method has been removed due to security and stability issues.
237      */
238     @UnsupportedAppUsage
enableLocationUpdates()239     void enableLocationUpdates();
240 
241     /**
242      * This method has been removed due to security and stability issues.
243      */
244     @UnsupportedAppUsage
disableLocationUpdates()245     void disableLocationUpdates();
246 
247     /**
248      * Allow mobile data connections.
249      */
250     @UnsupportedAppUsage
enableDataConnectivity()251     boolean enableDataConnectivity();
252 
253     /**
254      * Disallow mobile data connections.
255      */
256     @UnsupportedAppUsage
disableDataConnectivity()257     boolean disableDataConnectivity();
258 
259     /**
260      * Report whether data connectivity is possible.
261      */
isDataConnectivityPossible(int subId)262     boolean isDataConnectivityPossible(int subId);
263 
264     // Uses CellIdentity which is Parcelable here; will convert to CellLocation in client.
getCellLocation(String callingPkg, String callingFeatureId)265     CellIdentity getCellLocation(String callingPkg, String callingFeatureId);
266 
267     /**
268      * Returns the ISO country code equivalent of the current registered
269      * operator's MCC (Mobile Country Code).
270      * @see android.telephony.TelephonyManager#getNetworkCountryIso
271      */
getNetworkCountryIsoForPhone(int phoneId)272     String getNetworkCountryIsoForPhone(int phoneId);
273 
274     /**
275      * Returns the neighboring cell information of the device.
276      */
getNeighboringCellInfo(String callingPkg, String callingFeatureId)277     List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg, String callingFeatureId);
278 
279     @UnsupportedAppUsage
getCallState()280     int getCallState();
281 
282     /**
283      * Returns the call state for a slot.
284      */
getCallStateForSlot(int slotIndex)285     int getCallStateForSlot(int slotIndex);
286 
287     /**
288      * Replaced by getDataActivityForSubId.
289      */
290     @UnsupportedAppUsage(maxTargetSdk = 28)
getDataActivity()291     int getDataActivity();
292 
293     /**
294      * Returns a constant indicating the type of activity on a data connection
295      * (cellular).
296      *
297      * @see #DATA_ACTIVITY_NONE
298      * @see #DATA_ACTIVITY_IN
299      * @see #DATA_ACTIVITY_OUT
300      * @see #DATA_ACTIVITY_INOUT
301      * @see #DATA_ACTIVITY_DORMANT
302      */
getDataActivityForSubId(int subId)303     int getDataActivityForSubId(int subId);
304 
305     /**
306      * Replaced by getDataStateForSubId.
307      */
308     @UnsupportedAppUsage(maxTargetSdk = 28)
getDataState()309     int getDataState();
310 
311     /**
312      * Returns a constant indicating the current data connection state
313      * (cellular).
314      *
315      * @see #DATA_DISCONNECTED
316      * @see #DATA_CONNECTING
317      * @see #DATA_CONNECTED
318      * @see #DATA_SUSPENDED
319      */
getDataStateForSubId(int subId)320     int getDataStateForSubId(int subId);
321 
322     /**
323      * Returns the current active phone type as integer.
324      * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
325      * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
326      */
327     @UnsupportedAppUsage
getActivePhoneType()328     int getActivePhoneType();
329 
330     /**
331      * Returns the current active phone type as integer for particular slot.
332      * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
333      * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
334      * @param slotIndex - slot to query.
335      */
getActivePhoneTypeForSlot(int slotIndex)336     int getActivePhoneTypeForSlot(int slotIndex);
337 
338     /**
339      * Returns the CDMA ERI icon index to display
340      * @param callingPackage package making the call.
341      * @param callingFeatureId The feature in the package.
342      */
getCdmaEriIconIndex(String callingPackage, String callingFeatureId)343     int getCdmaEriIconIndex(String callingPackage, String callingFeatureId);
344 
345     /**
346      * Returns the CDMA ERI icon index to display on particular subId.
347      * @param subId user preferred subId.
348      * @param callingPackage package making the call.
349      * @param callingFeatureId The feature in the package.
350      */
getCdmaEriIconIndexForSubscriber(int subId, String callingPackage, String callingFeatureId)351     int getCdmaEriIconIndexForSubscriber(int subId, String callingPackage,
352             String callingFeatureId);
353 
354     /**
355      * Returns the CDMA ERI icon mode,
356      * 0 - ON
357      * 1 - FLASHING
358      * @param callingPackage package making the call.
359      * @param callingFeatureId The feature in the package.
360      */
getCdmaEriIconMode(String callingPackage, String callingFeatureId)361     int getCdmaEriIconMode(String callingPackage, String callingFeatureId);
362 
363     /**
364      * Returns the CDMA ERI icon mode on particular subId,
365      * 0 - ON
366      * 1 - FLASHING
367      * @param subId user preferred subId.
368      * @param callingPackage package making the call.
369      * @param callingFeatureId The feature in the package.
370      */
getCdmaEriIconModeForSubscriber(int subId, String callingPackage, String callingFeatureId)371     int getCdmaEriIconModeForSubscriber(int subId, String callingPackage,
372             String callingFeatureId);
373 
374     /**
375      * Returns the CDMA ERI text,
376      * @param callingPackage package making the call.
377      * @param callingFeatureId The feature in the package.
378      */
getCdmaEriText(String callingPackage, String callingFeatureId)379     String getCdmaEriText(String callingPackage, String callingFeatureId);
380 
381     /**
382      * Returns the CDMA ERI text for particular subId,
383      * @param subId user preferred subId.
384      * @param callingPackage package making the call.
385      * @param callingFeatureId The feature in the package.
386      */
getCdmaEriTextForSubscriber(int subId, String callingPackage, String callingFeatureId)387     String getCdmaEriTextForSubscriber(int subId, String callingPackage, String callingFeatureId);
388 
389     /**
390      * Returns true if OTA service provisioning needs to run.
391      * Only relevant on some technologies, others will always
392      * return false.
393      */
needsOtaServiceProvisioning()394     boolean needsOtaServiceProvisioning();
395 
396     /**
397      * Sets the voicemail number for a particular subscriber.
398      */
setVoiceMailNumber(int subId, String alphaTag, String number)399     boolean setVoiceMailNumber(int subId, String alphaTag, String number);
400 
401      /**
402       * Sets the voice activation state for a particular subscriber.
403       */
setVoiceActivationState(int subId, int activationState)404     void setVoiceActivationState(int subId, int activationState);
405 
406      /**
407       * Sets the data activation state for a particular subscriber.
408       */
setDataActivationState(int subId, int activationState)409     void setDataActivationState(int subId, int activationState);
410 
411      /**
412       * Returns the voice activation state for a particular subscriber.
413       * @param subId user preferred sub
414       * @param callingPackage package queries voice activation state
415       */
getVoiceActivationState(int subId, String callingPackage)416     int getVoiceActivationState(int subId, String callingPackage);
417 
418      /**
419       * Returns the data activation state for a particular subscriber.
420       * @param subId user preferred sub
421       * @param callingPackage package queris data activation state
422       */
getDataActivationState(int subId, String callingPackage)423     int getDataActivationState(int subId, String callingPackage);
424 
425     /**
426      * Returns the unread count of voicemails for a subId.
427      * @param subId user preferred subId.
428      * Returns the unread count of voicemails
429      */
getVoiceMessageCountForSubscriber(int subId, String callingPackage, String callingFeatureId)430     int getVoiceMessageCountForSubscriber(int subId, String callingPackage,
431             String callingFeatureId);
432 
433     /**
434       * Returns true if current state supports both voice and data
435       * simultaneously. This can change based on location or network condition.
436       */
isConcurrentVoiceAndDataAllowed(int subId)437     boolean isConcurrentVoiceAndDataAllowed(int subId);
438 
getVisualVoicemailSettings(String callingPackage, int subId)439     Bundle getVisualVoicemailSettings(String callingPackage, int subId);
440 
getVisualVoicemailPackageName(String callingPackage, String callingFeatureId, int subId)441     String getVisualVoicemailPackageName(String callingPackage, String callingFeatureId, int subId);
442 
443     // Not oneway, caller needs to make sure the vaule is set before receiving a SMS
enableVisualVoicemailSmsFilter(String callingPackage, int subId, in VisualVoicemailSmsFilterSettings settings)444     void enableVisualVoicemailSmsFilter(String callingPackage, int subId,
445             in VisualVoicemailSmsFilterSettings settings);
446 
disableVisualVoicemailSmsFilter(String callingPackage, int subId)447     oneway void disableVisualVoicemailSmsFilter(String callingPackage, int subId);
448 
449     // Get settings set by the calling package
getVisualVoicemailSmsFilterSettings(String callingPackage, int subId)450     VisualVoicemailSmsFilterSettings getVisualVoicemailSmsFilterSettings(String callingPackage,
451             int subId);
452 
453     /**
454      *  Get settings set by the current default dialer, Internal use only.
455      *  Requires READ_PRIVILEGED_PHONE_STATE permission.
456      */
getActiveVisualVoicemailSmsFilterSettings(int subId)457     VisualVoicemailSmsFilterSettings getActiveVisualVoicemailSmsFilterSettings(int subId);
458 
459     /**
460      * Send a visual voicemail SMS. Internal use only.
461      * Requires caller to be the default dialer and have SEND_SMS permission
462      */
sendVisualVoicemailSmsForSubscriber(in String callingPackage, String callingAttributeTag, in int subId, in String number, in int port, in String text, in PendingIntent sentIntent)463     void sendVisualVoicemailSmsForSubscriber(in String callingPackage, String callingAttributeTag,
464             in int subId, in String number, in int port, in String text, in PendingIntent sentIntent);
465 
466     // Send the special dialer code. The IPC caller must be the current default dialer.
sendDialerSpecialCode(String callingPackageName, String inputCode)467     void sendDialerSpecialCode(String callingPackageName, String inputCode);
468 
469     /**
470      * Returns the network type of a subId.
471      * @param subId user preferred subId.
472      * @param callingPackage package making the call.
473      * @param callingFeatureId The feature in the package.
474      */
getNetworkTypeForSubscriber(int subId, String callingPackage, String callingFeatureId)475     int getNetworkTypeForSubscriber(int subId, String callingPackage, String callingFeatureId);
476 
477     /**
478      * Returns the network type for data transmission
479      * @param callingPackage package making the call.
480      * @param callingFeatureId The feature in the package.
481      */
getDataNetworkType(String callingPackage, String callingFeatureId)482     int getDataNetworkType(String callingPackage, String callingFeatureId);
483 
484     /**
485      * Returns the data network type of a subId
486      * @param subId user preferred subId.
487      * @param callingPackage package making the call.
488      * @param callingFeatureId The feature in the package.
489      */
getDataNetworkTypeForSubscriber(int subId, String callingPackage, String callingFeatureId)490     int getDataNetworkTypeForSubscriber(int subId, String callingPackage,
491             String callingFeatureId);
492 
493     /**
494       * Returns the voice network type of a subId
495       * @param subId user preferred subId.
496       * @param callingPackage package making the call.getLteOnCdmaMode
497       * @param callingFeatureId The feature in the package.
498       * Returns the network type
499       */
getVoiceNetworkTypeForSubscriber(int subId, String callingPackage, String callingFeatureId)500     int getVoiceNetworkTypeForSubscriber(int subId, String callingPackage,
501             String callingFeatureId);
502 
503     /**
504      * Return true if an ICC card is present
505      */
506     @UnsupportedAppUsage
hasIccCard()507     boolean hasIccCard();
508 
509     /**
510      * Return true if an ICC card is present for a subId.
511      * @param slotIndex user preferred slotIndex.
512      * Return true if an ICC card is present
513      */
hasIccCardUsingSlotIndex(int slotIndex)514     boolean hasIccCardUsingSlotIndex(int slotIndex);
515 
516     /**
517      * Return if the current radio is LTE on CDMA. This
518      * is a tri-state return value as for a period of time
519      * the mode may be unknown.
520      *
521      * @param callingPackage the name of the calling package
522      * @param callingFeatureId The feature in the package.
523      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
524      * or {@link PHone#LTE_ON_CDMA_TRUE}
525      */
getLteOnCdmaMode(String callingPackage, String callingFeatureId)526     int getLteOnCdmaMode(String callingPackage, String callingFeatureId);
527 
528     /**
529      * Return if the current radio is LTE on CDMA. This
530      * is a tri-state return value as for a period of time
531      * the mode may be unknown.
532      *
533      * @param callingPackage the name of the calling package
534      * @param callingFeatureId The feature in the package.
535      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
536      * or {@link PHone#LTE_ON_CDMA_TRUE}
537      */
getLteOnCdmaModeForSubscriber(int subId, String callingPackage, String callingFeatureId)538     int getLteOnCdmaModeForSubscriber(int subId, String callingPackage, String callingFeatureId);
539 
540     /**
541      * Returns all observed cell information of the device.
542      */
getAllCellInfo(String callingPkg, String callingFeatureId)543     List<CellInfo> getAllCellInfo(String callingPkg, String callingFeatureId);
544 
545     /**
546      * Request a cell information update for the specified subscription,
547      * reported via the CellInfoCallback.
548      */
requestCellInfoUpdate(int subId, in ICellInfoCallback cb, String callingPkg, String callingFeatureId)549     void requestCellInfoUpdate(int subId, in ICellInfoCallback cb, String callingPkg,
550             String callingFeatureId);
551 
552     /**
553      * Request a cell information update for the specified subscription,
554      * reported via the CellInfoCallback.
555      *
556      * @param workSource the requestor to whom the power consumption for this should be attributed.
557      */
requestCellInfoUpdateWithWorkSource(int subId, in ICellInfoCallback cb, in String callingPkg, String callingFeatureId, in WorkSource ws)558     void requestCellInfoUpdateWithWorkSource(int subId, in ICellInfoCallback cb,
559             in String callingPkg, String callingFeatureId, in WorkSource ws);
560 
561     /**
562      * Sets minimum time in milli-seconds between onCellInfoChanged
563      */
setCellInfoListRate(int rateInMillis)564     void setCellInfoListRate(int rateInMillis);
565 
566     /**
567      * Opens a logical channel to the ICC card using the physical slot index.
568      *
569      * Input parameters equivalent to TS 27.007 AT+CCHO command.
570      *
571      * @param slotIndex The physical slot index of the target ICC card
572      * @param callingPackage the name of the package making the call.
573      * @param AID Application id. See ETSI 102.221 and 101.220.
574      * @param p2 P2 parameter (described in ISO 7816-4).
575      * @return an IccOpenLogicalChannelResponse object.
576      */
iccOpenLogicalChannelBySlot( int slotIndex, String callingPackage, String AID, int p2)577     IccOpenLogicalChannelResponse iccOpenLogicalChannelBySlot(
578             int slotIndex, String callingPackage, String AID, int p2);
579 
580     /**
581      * Opens a logical channel to the ICC card.
582      *
583      * Input parameters equivalent to TS 27.007 AT+CCHO command.
584      *
585      * @param subId The subscription to use.
586      * @param callingPackage the name of the package making the call.
587      * @param AID Application id. See ETSI 102.221 and 101.220.
588      * @param p2 P2 parameter (described in ISO 7816-4).
589      * @return an IccOpenLogicalChannelResponse object.
590      */
iccOpenLogicalChannel( int subId, String callingPackage, String AID, int p2)591     IccOpenLogicalChannelResponse iccOpenLogicalChannel(
592             int subId, String callingPackage, String AID, int p2);
593 
594     /**
595      * Closes a previously opened logical channel to the ICC card using the physical slot index.
596      *
597      * Input parameters equivalent to TS 27.007 AT+CCHC command.
598      *
599      * @param slotIndex The physical slot index of the target ICC card
600      * @param channel is the channel id to be closed as returned by a
601      *            successful iccOpenLogicalChannel.
602      * @return true if the channel was closed successfully.
603      */
iccCloseLogicalChannelBySlot(int slotIndex, int channel)604     boolean iccCloseLogicalChannelBySlot(int slotIndex, int channel);
605 
606     /**
607      * Closes a previously opened logical channel to the ICC card.
608      *
609      * Input parameters equivalent to TS 27.007 AT+CCHC command.
610      *
611      * @param subId The subscription to use.
612      * @param channel is the channel id to be closed as returned by a
613      *            successful iccOpenLogicalChannel.
614      * @return true if the channel was closed successfully.
615      */
616     @UnsupportedAppUsage
iccCloseLogicalChannel(int subId, int channel)617     boolean iccCloseLogicalChannel(int subId, int channel);
618 
619     /**
620      * Transmit an APDU to the ICC card over a logical channel using the physical slot index.
621      *
622      * Input parameters equivalent to TS 27.007 AT+CGLA command.
623      *
624      * @param slotIndex The physical slot index of the target ICC card
625      * @param channel is the channel id to be closed as returned by a
626      *            successful iccOpenLogicalChannel.
627      * @param cla Class of the APDU command.
628      * @param instruction Instruction of the APDU command.
629      * @param p1 P1 value of the APDU command.
630      * @param p2 P2 value of the APDU command.
631      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
632      *            is sent to the SIM.
633      * @param data Data to be sent with the APDU.
634      * @return The APDU response from the ICC card with the status appended at
635      *            the end.
636      */
iccTransmitApduLogicalChannelBySlot(int slotIndex, int channel, int cla, int instruction, int p1, int p2, int p3, String data)637     String iccTransmitApduLogicalChannelBySlot(int slotIndex, int channel, int cla, int instruction,
638             int p1, int p2, int p3, String data);
639 
640     /**
641      * Transmit an APDU to the ICC card over a logical channel.
642      *
643      * Input parameters equivalent to TS 27.007 AT+CGLA command.
644      *
645      * @param subId The subscription to use.
646      * @param channel is the channel id to be closed as returned by a
647      *            successful iccOpenLogicalChannel.
648      * @param cla Class of the APDU command.
649      * @param instruction Instruction of the APDU command.
650      * @param p1 P1 value of the APDU command.
651      * @param p2 P2 value of the APDU command.
652      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
653      *            is sent to the SIM.
654      * @param data Data to be sent with the APDU.
655      * @return The APDU response from the ICC card with the status appended at
656      *            the end.
657      */
658     @UnsupportedAppUsage
iccTransmitApduLogicalChannel(int subId, int channel, int cla, int instruction, int p1, int p2, int p3, String data)659     String iccTransmitApduLogicalChannel(int subId, int channel, int cla, int instruction,
660             int p1, int p2, int p3, String data);
661 
662     /**
663      * Transmit an APDU to the ICC card over the basic channel using the physical slot index.
664      *
665      * Input parameters equivalent to TS 27.007 AT+CSIM command.
666      *
667      * @param slotIndex The physical slot index of the target ICC card
668      * @param callingPackage the name of the package making the call.
669      * @param cla Class of the APDU command.
670      * @param instruction Instruction of the APDU command.
671      * @param p1 P1 value of the APDU command.
672      * @param p2 P2 value of the APDU command.
673      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
674      *            is sent to the SIM.
675      * @param data Data to be sent with the APDU.
676      * @return The APDU response from the ICC card with the status appended at
677      *            the end.
678      */
iccTransmitApduBasicChannelBySlot(int slotIndex, String callingPackage, int cla, int instruction, int p1, int p2, int p3, String data)679     String iccTransmitApduBasicChannelBySlot(int slotIndex, String callingPackage, int cla,
680             int instruction, int p1, int p2, int p3, String data);
681 
682     /**
683      * Transmit an APDU to the ICC card over the basic channel.
684      *
685      * Input parameters equivalent to TS 27.007 AT+CSIM command.
686      *
687      * @param subId The subscription to use.
688      * @param callingPackage the name of the package making the call.
689      * @param cla Class of the APDU command.
690      * @param instruction Instruction of the APDU command.
691      * @param p1 P1 value of the APDU command.
692      * @param p2 P2 value of the APDU command.
693      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
694      *            is sent to the SIM.
695      * @param data Data to be sent with the APDU.
696      * @return The APDU response from the ICC card with the status appended at
697      *            the end.
698      */
iccTransmitApduBasicChannel(int subId, String callingPackage, int cla, int instruction, int p1, int p2, int p3, String data)699     String iccTransmitApduBasicChannel(int subId, String callingPackage, int cla, int instruction,
700             int p1, int p2, int p3, String data);
701 
702     /**
703      * Returns the response APDU for a command APDU sent through SIM_IO.
704      *
705      * @param subId The subscription to use.
706      * @param fileID
707      * @param command
708      * @param p1 P1 value of the APDU command.
709      * @param p2 P2 value of the APDU command.
710      * @param p3 P3 value of the APDU command.
711      * @param filePath
712      * @return The APDU response.
713      */
iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2, int p3, String filePath)714     byte[] iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2, int p3,
715             String filePath);
716 
717     /**
718      * Send ENVELOPE to the SIM and returns the response.
719      *
720      * @param subId The subscription to use.
721      * @param contents  String containing SAT/USAT response in hexadecimal
722      *                  format starting with command tag. See TS 102 223 for
723      *                  details.
724      * @return The APDU response from the ICC card, with the last 4 bytes
725      *         being the status word. If the command fails, returns an empty
726      *         string.
727      */
sendEnvelopeWithStatus(int subId, String content)728     String sendEnvelopeWithStatus(int subId, String content);
729 
730     /**
731      * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
732      * Used for device configuration by some CDMA operators.
733      *
734      * @param itemID the ID of the item to read.
735      * @return the NV item as a String, or null on any failure.
736      */
nvReadItem(int itemID)737     String nvReadItem(int itemID);
738 
739     /**
740      * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
741      * Used for device configuration by some CDMA operators.
742      *
743      * @param itemID the ID of the item to read.
744      * @param itemValue the value to write, as a String.
745      * @return true on success; false on any failure.
746      */
nvWriteItem(int itemID, String itemValue)747     boolean nvWriteItem(int itemID, String itemValue);
748 
749     /**
750      * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
751      * Used for device configuration by some CDMA operators.
752      *
753      * @param preferredRoamingList byte array containing the new PRL.
754      * @return true on success; false on any failure.
755      */
nvWriteCdmaPrl(in byte[] preferredRoamingList)756     boolean nvWriteCdmaPrl(in byte[] preferredRoamingList);
757 
758     /**
759      * Rollback modem configurations to factory default except some config which are in whitelist.
760      * Used for device configuration by some CDMA operators.
761      *
762      * <p>Requires Permission:
763      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
764      * app has carrier privileges (see {@link #hasCarrierPrivileges}).
765      *
766      * @param slotIndex - device slot.
767      * @return {@code true} on success; {@code false} on any failure.
768      */
resetModemConfig(int slotIndex)769     boolean resetModemConfig(int slotIndex);
770 
771     /**
772      * Generate a radio modem reset. Used for device configuration by some CDMA operators.
773      * Different than {@link #setRadioPower(boolean)}, modem reboot will power down sim card.
774      *
775      * <p>Requires Permission:
776      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
777      * app has carrier privileges (see {@link #hasCarrierPrivileges}).
778      *
779      * @param slotIndex - device slot.
780      * @return {@code true} on success; {@code false} on any failure.
781      */
rebootModem(int slotIndex)782     boolean rebootModem(int slotIndex);
783     /*
784      * Get the calculated preferred network type.
785      * Used for device configuration by some CDMA operators.
786      * @param callingPackage The package making the call.
787      * @param callingFeatureId The feature in the package.
788      *
789      * @return the calculated preferred network type, defined in RILConstants.java.
790      */
getCalculatedPreferredNetworkType(String callingPackage, String callingFeatureId)791     int getCalculatedPreferredNetworkType(String callingPackage, String callingFeatureId);
792 
793     /*
794      * Get the preferred network type.
795      * Used for device configuration by some CDMA operators.
796      *
797      * @param subId the id of the subscription to query.
798      * @return the preferred network type, defined in RILConstants.java.
799      */
getPreferredNetworkType(int subId)800     int getPreferredNetworkType(int subId);
801 
802     /**
803      * Check whether DUN APN is required for tethering with subId.
804      *
805      * @param subId the id of the subscription to require tethering.
806      * @return {@code true} if DUN APN is required for tethering.
807      * @hide
808      */
isTetheringApnRequiredForSubscriber(int subId)809     boolean isTetheringApnRequiredForSubscriber(int subId);
810 
811     /**
812     * Enables framework IMS and triggers IMS Registration.
813     */
enableIms(int slotId)814     void enableIms(int slotId);
815 
816     /**
817     * Disables framework IMS and triggers IMS deregistration.
818     */
disableIms(int slotId)819     void disableIms(int slotId);
820 
821     /**
822     * Toggle framework IMS disables and enables.
823     */
resetIms(int slotIndex)824     void resetIms(int slotIndex);
825 
826     /**
827      *  Get IImsMmTelFeature binder from ImsResolver that corresponds to the subId and MMTel feature
828      *  as well as registering the MmTelFeature for callbacks using the IImsServiceFeatureCallback
829      *  interface.
830      */
getMmTelFeatureAndListen(int slotId, in IImsServiceFeatureCallback callback)831     IImsMmTelFeature getMmTelFeatureAndListen(int slotId, in IImsServiceFeatureCallback callback);
832 
833     /**
834      *  Get IImsRcsFeature binder from ImsResolver that corresponds to the subId and RCS feature
835      *  as well as registering the RcsFeature for callbacks using the IImsServiceFeatureCallback
836      *  interface.
837      */
getRcsFeatureAndListen(int slotId, in IImsServiceFeatureCallback callback)838     IImsRcsFeature getRcsFeatureAndListen(int slotId, in IImsServiceFeatureCallback callback);
839 
840     /**
841      * Unregister a callback that was previously registered through
842      * {@link #getMmTelFeatureAndListen} or {@link #getRcsFeatureAndListen}. This should always be
843      * called when the callback is no longer being used.
844      */
unregisterImsFeatureCallback(int slotId, int featureType, in IImsServiceFeatureCallback callback)845     void unregisterImsFeatureCallback(int slotId, int featureType,
846             in IImsServiceFeatureCallback callback);
847 
848     /**
849     * Returns the IImsRegistration associated with the slot and feature specified.
850     */
getImsRegistration(int slotId, int feature)851     IImsRegistration getImsRegistration(int slotId, int feature);
852 
853     /**
854     * Returns the IImsConfig associated with the slot and feature specified.
855     */
getImsConfig(int slotId, int feature)856     IImsConfig getImsConfig(int slotId, int feature);
857 
858     /**
859     *  @return true if the ImsService to bind to for the slot id specified was set, false otherwise.
860     */
setBoundImsServiceOverride(int slotIndex, boolean isCarrierService, in int[] featureTypes, in String packageName)861     boolean setBoundImsServiceOverride(int slotIndex, boolean isCarrierService,
862             in int[] featureTypes, in String packageName);
863 
864     /**
865     * @return the package name of the carrier/device ImsService associated with this slot.
866     */
getBoundImsServicePackage(int slotIndex, boolean isCarrierImsService, int featureType)867     String getBoundImsServicePackage(int slotIndex, boolean isCarrierImsService, int featureType);
868 
869     /**
870      * Get the MmTelFeature state attached to this subscription id.
871      */
getImsMmTelFeatureState(int subId, IIntegerConsumer callback)872     void getImsMmTelFeatureState(int subId, IIntegerConsumer callback);
873 
874     /**
875      * Set the network selection mode to automatic.
876      *
877      * @param subId the id of the subscription to update.
878      */
setNetworkSelectionModeAutomatic(int subId)879     void setNetworkSelectionModeAutomatic(int subId);
880 
881     /**
882      * Perform a radio scan and return the list of avialble networks.
883      *
884      * @param subId the id of the subscription.
885      * @param callingPackage the calling package
886      * @param callingFeatureId The feature in the package
887      * @return CellNetworkScanResult containing status of scan and networks.
888      */
getCellNetworkScanResults(int subId, String callingPackage, String callingFeatureId)889     CellNetworkScanResult getCellNetworkScanResults(int subId, String callingPackage,
890             String callingFeatureId);
891 
892     /**
893      * Perform a radio network scan and return the id of this scan.
894      *
895      * @param subId the id of the subscription.
896      * @param request Defines all the configs for network scan.
897      * @param messenger Callback messages will be sent using this messenger.
898      * @param binder the binder object instantiated in TelephonyManager.
899      * @param callingPackage the calling package
900      * @param callingFeatureId The feature in the package
901      * @return An id for this scan.
902      */
requestNetworkScan(int subId, in NetworkScanRequest request, in Messenger messenger, in IBinder binder, in String callingPackage, String callingFeatureId)903     int requestNetworkScan(int subId, in NetworkScanRequest request, in Messenger messenger,
904             in IBinder binder, in String callingPackage, String callingFeatureId);
905 
906     /**
907      * Stop an existing radio network scan.
908      *
909      * @param subId the id of the subscription.
910      * @param scanId The id of the scan that is going to be stopped.
911      */
stopNetworkScan(int subId, int scanId)912     void stopNetworkScan(int subId, int scanId);
913 
914     /**
915      * Ask the radio to connect to the input network and change selection mode to manual.
916      *
917      * @param subId the id of the subscription.
918      * @param operatorInfo the operator inforamtion, included the PLMN, long name and short name of
919      * the operator to attach to.
920      * @param persistSelection whether the selection will persist until reboot. If true, only allows
921      * attaching to the selected PLMN until reboot; otherwise, attach to the chosen PLMN and resume
922      * normal network selection next time.
923      * @return {@code true} on success; {@code true} on any failure.
924      */
setNetworkSelectionModeManual( int subId, in OperatorInfo operatorInfo, boolean persisSelection)925     boolean setNetworkSelectionModeManual(
926             int subId, in OperatorInfo operatorInfo, boolean persisSelection);
927 
928     /**
929      * Get the allowed network types that store in the telephony provider.
930      *
931      * @param subId the id of the subscription.
932      * @return allowedNetworkTypes the allowed network types.
933      */
getAllowedNetworkTypes(int subId)934     long getAllowedNetworkTypes(int subId);
935 
936     /**
937      * Set the allowed network types.
938      *
939      * @param subId the id of the subscription.
940      * @param allowedNetworkTypes the allowed network types.
941      * @return true on success; false on any failure.
942      */
setAllowedNetworkTypes(int subId, long allowedNetworkTypes)943     boolean setAllowedNetworkTypes(int subId, long allowedNetworkTypes);
944 
945     /**
946      * Get the allowed network types for certain reason.
947      *
948      * @param subId the id of the subscription.
949      * @param reason the reason the allowed network type change is taking place
950      * @return allowedNetworkTypes the allowed network types.
951      */
getAllowedNetworkTypesForReason(int subId, int reason)952     long getAllowedNetworkTypesForReason(int subId, int reason);
953 
954     /**
955      * Get the effective allowed network types on the device. This API will
956      * return an intersection of allowed network types for all reasons,
957      * including the configuration done through setAllowedNetworkTypes
958      *
959      * @param subId the id of the subscription.
960      * @return allowedNetworkTypes the allowed network types.
961      */
getEffectiveAllowedNetworkTypes(int subId)962      long getEffectiveAllowedNetworkTypes(int subId);
963 
964     /**
965      * Set the allowed network types and provide the reason triggering the allowed network change.
966      *
967      * @param subId the id of the subscription.
968      * @param reason the reason the allowed network type change is taking place
969      * @param allowedNetworkTypes the allowed network types.
970      * @return true on success; false on any failure.
971      */
setAllowedNetworkTypesForReason(int subId, int reason, long allowedNetworkTypes)972     boolean setAllowedNetworkTypesForReason(int subId, int reason, long allowedNetworkTypes);
973 
974     /**
975      * Set the preferred network type.
976      * Used for device configuration by some CDMA operators.
977      *
978      * @param subId the id of the subscription to update.
979      * @param networkType the preferred network type, defined in RILConstants.java.
980      * @return true on success; false on any failure.
981      */
setPreferredNetworkType(int subId, int networkType)982     boolean setPreferredNetworkType(int subId, int networkType);
983 
984     /**
985      * User enable/disable Mobile Data.
986      *
987      * @param enable true to turn on, else false
988      */
setUserDataEnabled(int subId, boolean enable)989     void setUserDataEnabled(int subId, boolean enable);
990 
991     /**
992      * Get the user enabled state of Mobile Data.
993      *
994      * TODO: remove and use isUserDataEnabled.
995      * This can't be removed now because some vendor codes
996      * calls through ITelephony directly while they should
997      * use TelephonyManager.
998      *
999      * @return true on enabled
1000      */
1001     @UnsupportedAppUsage
getDataEnabled(int subId)1002     boolean getDataEnabled(int subId);
1003 
1004     /**
1005      * Get the user enabled state of Mobile Data.
1006      *
1007      * @return true on enabled
1008      */
isUserDataEnabled(int subId)1009     boolean isUserDataEnabled(int subId);
1010 
1011     /**
1012      * Get the overall enabled state of Mobile Data.
1013      *
1014      * @return true on enabled
1015      */
isDataEnabled(int subId)1016     boolean isDataEnabled(int subId);
1017 
1018      /**
1019      * Checks if manual network selection is allowed.
1020      *
1021      * @return {@code true} if manual network selection is allowed, otherwise return {@code false}.
1022      */
isManualNetworkSelectionAllowed(int subId)1023      boolean isManualNetworkSelectionAllowed(int subId);
1024 
1025     /**
1026      * Enable or disable always reporting signal strength changes from radio.
1027      */
setAlwaysReportSignalStrength(int subId, boolean isEnable)1028      void setAlwaysReportSignalStrength(int subId, boolean isEnable);
1029 
1030     /**
1031      * Get P-CSCF address from PCO after data connection is established or modified.
1032      * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN
1033      * @param callingPackage The package making the call.
1034      * @param callingFeatureId The feature in the package.
1035      */
getPcscfAddress(String apnType, String callingPackage, String callingFeatureId)1036     String[] getPcscfAddress(String apnType, String callingPackage, String callingFeatureId);
1037 
1038     /**
1039      * Set IMS registration state
1040      */
setImsRegistrationState(boolean registered)1041     void setImsRegistrationState(boolean registered);
1042 
1043     /**
1044      * Return MDN string for CDMA phone.
1045      * @param subId user preferred subId.
1046      */
getCdmaMdn(int subId)1047     String getCdmaMdn(int subId);
1048 
1049     /**
1050      * Return MIN string for CDMA phone.
1051      * @param subId user preferred subId.
1052      */
getCdmaMin(int subId)1053     String getCdmaMin(int subId);
1054 
1055     /**
1056      * Request that the next incoming call from a number matching {@code range} be intercepted.
1057      * @param range The range of phone numbers the caller expects a phone call from.
1058      * @param timeoutMillis The amount of time to wait for such a call, or
1059      *                      {@link #MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS}, whichever is lesser.
1060      * @param callback the callback aidl
1061      * @param callingPackage the calling package name.
1062      */
requestNumberVerification(in PhoneNumberRange range, long timeoutMillis, in INumberVerificationCallback callback, String callingPackage)1063     void requestNumberVerification(in PhoneNumberRange range, long timeoutMillis,
1064             in INumberVerificationCallback callback, String callingPackage);
1065 
1066     /**
1067      * Has the calling application been granted special privileges by the carrier.
1068      *
1069      * If any of the packages in the calling UID has carrier privileges, the
1070      * call will return true. This access is granted by the owner of the UICC
1071      * card and does not depend on the registered carrier.
1072      *
1073      * TODO: Add a link to documentation.
1074      *
1075      * @param subId The subscription to use.
1076      * @return carrier privilege status defined in TelephonyManager.
1077      */
getCarrierPrivilegeStatus(int subId)1078     int getCarrierPrivilegeStatus(int subId);
1079 
1080     /**
1081      * Similar to above, but check for the given uid.
1082      */
getCarrierPrivilegeStatusForUid(int subId, int uid)1083     int getCarrierPrivilegeStatusForUid(int subId, int uid);
1084 
1085     /**
1086      * Similar to above, but check for the package whose name is pkgName.
1087      */
checkCarrierPrivilegesForPackage(int subId, String pkgName)1088     int checkCarrierPrivilegesForPackage(int subId, String pkgName);
1089 
1090     /**
1091      * Similar to above, but check across all phones.
1092      */
checkCarrierPrivilegesForPackageAnyPhone(String pkgName)1093     int checkCarrierPrivilegesForPackageAnyPhone(String pkgName);
1094 
1095     /**
1096      * Returns list of the package names of the carrier apps that should handle the input intent
1097      * and have carrier privileges for the given phoneId.
1098      *
1099      * @param intent Intent that will be sent.
1100      * @param phoneId The phoneId on which the carrier app has carrier privileges.
1101      * @return list of carrier app package names that can handle the intent on phoneId.
1102      *         Returns null if there is an error and an empty list if there
1103      *         are no matching packages.
1104      */
getCarrierPackageNamesForIntentAndPhone(in Intent intent, int phoneId)1105     List<String> getCarrierPackageNamesForIntentAndPhone(in Intent intent, int phoneId);
1106 
1107     /**
1108      * Set the line 1 phone number string and its alphatag for the current ICCID
1109      * for display purpose only, for example, displayed in Phone Status. It won't
1110      * change the actual MSISDN/MDN. To unset alphatag or number, pass in a null
1111      * value.
1112      *
1113      * @param subId the subscriber that the alphatag and dialing number belongs to.
1114      * @param alphaTag alpha-tagging of the dailing nubmer
1115      * @param number The dialing number
1116      * @return true if the operation was executed correctly.
1117      */
setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number)1118     boolean setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number);
1119 
1120     /**
1121      * Returns the displayed dialing number string if it was set previously via
1122      * {@link #setLine1NumberForDisplay}. Otherwise returns null.
1123      *
1124      * @param subId whose dialing number for line 1 is returned.
1125      * @param callingPackage The package making the call.
1126      * @param callingFeatureId The feature in the package.
1127      * @return the displayed dialing number if set, or null if not set.
1128      */
getLine1NumberForDisplay(int subId, String callingPackage, String callingFeatureId)1129     String getLine1NumberForDisplay(int subId, String callingPackage, String callingFeatureId);
1130 
1131     /**
1132      * Returns the displayed alphatag of the dialing number if it was set
1133      * previously via {@link #setLine1NumberForDisplay}. Otherwise returns null.
1134      *
1135      * @param subId whose alphatag associated with line 1 is returned.
1136      * @param callingPackage The package making the call.
1137      * @param callingFeatureId The feature in the package.
1138      * @return the displayed alphatag of the dialing number if set, or null if
1139      *         not set.
1140      */
getLine1AlphaTagForDisplay(int subId, String callingPackage, String callingFeatureId)1141     String getLine1AlphaTagForDisplay(int subId, String callingPackage, String callingFeatureId);
1142 
1143     /**
1144      * Return the set of subscriber IDs that should be considered "merged together" for data usage
1145      * purposes. This is commonly {@code null} to indicate no merging is required. Any returned
1146      * subscribers are sorted in a deterministic order.
1147      * <p>
1148      * The returned set of subscriber IDs will include the subscriber ID corresponding to this
1149      * TelephonyManager's subId.
1150      *
1151      * @hide
1152      */
getMergedSubscriberIds(int subId, String callingPackage, String callingFeatureId)1153     String[] getMergedSubscriberIds(int subId, String callingPackage, String callingFeatureId);
1154 
1155     /**
1156      * @hide
1157      */
getMergedSubscriberIdsFromGroup(int subId, String callingPackage)1158     String[] getMergedSubscriberIdsFromGroup(int subId, String callingPackage);
1159 
1160     /**
1161      * Override the operator branding for the current ICCID.
1162      *
1163      * Once set, whenever the SIM is present in the device, the service
1164      * provider name (SPN) and the operator name will both be replaced by the
1165      * brand value input. To unset the value, the same function should be
1166      * called with a null brand value.
1167      *
1168      * <p>Requires Permission:
1169      *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
1170      *  or has to be carrier app - see #hasCarrierPrivileges.
1171      *
1172      * @param subId The subscription to use.
1173      * @param brand The brand name to display/set.
1174      * @return true if the operation was executed correctly.
1175      */
setOperatorBrandOverride(int subId, String brand)1176     boolean setOperatorBrandOverride(int subId, String brand);
1177 
1178     /**
1179      * Override the roaming indicator for the current ICCID.
1180      *
1181      * Using this call, the carrier app (see #hasCarrierPrivileges) can override
1182      * the platform's notion of a network operator being considered roaming or not.
1183      * The change only affects the ICCID that was active when this call was made.
1184      *
1185      * If null is passed as any of the input, the corresponding value is deleted.
1186      *
1187      * <p>Requires that the caller have carrier privilege. See #hasCarrierPrivileges.
1188      *
1189      * @param subId for which the roaming overrides apply.
1190      * @param gsmRoamingList - List of MCCMNCs to be considered roaming for 3GPP RATs.
1191      * @param gsmNonRoamingList - List of MCCMNCs to be considered not roaming for 3GPP RATs.
1192      * @param cdmaRoamingList - List of SIDs to be considered roaming for 3GPP2 RATs.
1193      * @param cdmaNonRoamingList - List of SIDs to be considered not roaming for 3GPP2 RATs.
1194      * @return true if the operation was executed correctly.
1195      */
setRoamingOverride(int subId, in List<String> gsmRoamingList, in List<String> gsmNonRoamingList, in List<String> cdmaRoamingList, in List<String> cdmaNonRoamingList)1196     boolean setRoamingOverride(int subId, in List<String> gsmRoamingList,
1197             in List<String> gsmNonRoamingList, in List<String> cdmaRoamingList,
1198             in List<String> cdmaNonRoamingList);
1199 
1200     /**
1201      * Returns the result and response from RIL for oem request
1202      *
1203      * @param oemReq the data is sent to ril.
1204      * @param oemResp the respose data from RIL.
1205      * @return negative value request was not handled or get error
1206      *         0 request was handled succesfully, but no response data
1207      *         positive value success, data length of response
1208      */
invokeOemRilRequestRaw(in byte[] oemReq, out byte[] oemResp)1209     int invokeOemRilRequestRaw(in byte[] oemReq, out byte[] oemResp);
1210 
1211     /**
1212      * Check if any mobile Radios need to be shutdown.
1213      *
1214      * @return true is any mobile radio needs to be shutdown
1215      */
needMobileRadioShutdown()1216     boolean needMobileRadioShutdown();
1217 
1218     /**
1219      * Shutdown Mobile Radios
1220      */
shutdownMobileRadios()1221     void shutdownMobileRadios();
1222 
1223     /**
1224      * Set phone radio type and access technology.
1225      *
1226      * @param rafs an RadioAccessFamily array to indicate all phone's
1227      *        new radio access family. The length of RadioAccessFamily
1228      *        must equ]]al to phone count.
1229      */
setRadioCapability(in RadioAccessFamily[] rafs)1230     void setRadioCapability(in RadioAccessFamily[] rafs);
1231 
1232     /**
1233      * Get phone radio type and access technology.
1234      *
1235      * @param phoneId which phone you want to get
1236      * @param callingPackage the name of the package making the call
1237      * @return phone radio type and access technology
1238      */
getRadioAccessFamily(in int phoneId, String callingPackage)1239     int getRadioAccessFamily(in int phoneId, String callingPackage);
1240 
1241     /**
1242      * Enables or disables video calling.
1243      *
1244      * @param enable Whether to enable video calling.
1245      */
enableVideoCalling(boolean enable)1246     void enableVideoCalling(boolean enable);
1247 
1248     /**
1249      * Whether video calling has been enabled by the user.
1250      *
1251      * @param callingPackage The package making the call.
1252      * @param callingFeatureId The feature in the package.
1253      * @return {@code true} if the user has enabled video calling, {@code false} otherwise.
1254      */
isVideoCallingEnabled(String callingPackage, String callingFeatureId)1255     boolean isVideoCallingEnabled(String callingPackage, String callingFeatureId);
1256 
1257     /**
1258      * Whether the DTMF tone length can be changed.
1259      *
1260      * @param subId The subscription to use.
1261      * @param callingPackage The package making the call.
1262      * @param callingFeatureId The feature in the package.
1263      * @return {@code true} if the DTMF tone length can be changed.
1264      */
canChangeDtmfToneLength(int subId, String callingPackage, String callingFeatureId)1265     boolean canChangeDtmfToneLength(int subId, String callingPackage, String callingFeatureId);
1266 
1267     /**
1268      * Whether the device is a world phone.
1269      *
1270      * @param callingPackage The package making the call.
1271      * @param callingFeatureId The feature in the package.
1272      * @return {@code true} if the devices is a world phone.
1273      */
isWorldPhone(int subId, String callingPackage, String callingFeatureId)1274     boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId);
1275 
1276     /**
1277      * Whether the phone supports TTY mode.
1278      *
1279      * @return {@code true} if the device supports TTY mode.
1280      */
isTtyModeSupported()1281     boolean isTtyModeSupported();
1282 
isRttSupported(int subscriptionId)1283     boolean isRttSupported(int subscriptionId);
1284 
1285     /**
1286      * Whether the phone supports hearing aid compatibility.
1287      *
1288      * @return {@code true} if the device supports hearing aid compatibility.
1289      */
isHearingAidCompatibilitySupported()1290     boolean isHearingAidCompatibilitySupported();
1291 
1292     /**
1293      * Get IMS Registration Status on a particular subid.
1294      *
1295      * @param subId user preferred subId.
1296      *
1297      * @return {@code true} if the IMS status is registered.
1298      */
isImsRegistered(int subId)1299     boolean isImsRegistered(int subId);
1300 
1301     /**
1302      * Returns the Status of Wi-Fi Calling for the subscription id specified.
1303      */
isWifiCallingAvailable(int subId)1304     boolean isWifiCallingAvailable(int subId);
1305 
1306      /**
1307      * Returns the Status of VT (video telephony) for the subscription ID specified.
1308      */
isVideoTelephonyAvailable(int subId)1309     boolean isVideoTelephonyAvailable(int subId);
1310 
1311     /**
1312     * Returns the MMTEL IMS registration technology for the subsciption ID specified.
1313     */
getImsRegTechnologyForMmTel(int subId)1314     int getImsRegTechnologyForMmTel(int subId);
1315 
1316     /** @deprecated Use {@link #getDeviceIdWithFeature(String, String) instead */
1317     @UnsupportedAppUsage
getDeviceId(String callingPackage)1318     String getDeviceId(String callingPackage);
1319 
1320     /**
1321       * Returns the unique device ID of phone, for example, the IMEI for
1322       * GSM and the MEID for CDMA phones. Return null if device ID is not available.
1323       *
1324       * @param callingPackage The package making the call.
1325       * @param callingFeatureId The feature in the package
1326       * <p>Requires Permission:
1327       *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1328       */
getDeviceIdWithFeature(String callingPackage, String callingFeatureId)1329     String getDeviceIdWithFeature(String callingPackage, String callingFeatureId);
1330 
1331     /**
1332      * Returns the IMEI for the given slot.
1333      *
1334      * @param slotIndex - device slot.
1335      * @param callingPackage The package making the call.
1336      * @param callingFeatureId The feature in the package
1337      * <p>Requires Permission:
1338      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1339      */
getImeiForSlot(int slotIndex, String callingPackage, String callingFeatureId)1340     String getImeiForSlot(int slotIndex, String callingPackage, String callingFeatureId);
1341 
1342     /**
1343      * Returns the Type Allocation Code from the IMEI for the given slot.
1344      *
1345      * @param slotIndex - Which slot to retrieve the Type Allocation Code from.
1346      */
getTypeAllocationCodeForSlot(int slotIndex)1347     String getTypeAllocationCodeForSlot(int slotIndex);
1348 
1349     /**
1350      * Returns the MEID for the given slot.
1351      *
1352      * @param slotIndex - device slot.
1353      * @param callingPackage The package making the call.
1354      * @param callingFeatureId The feature in the package
1355      * <p>Requires Permission:
1356      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1357      */
getMeidForSlot(int slotIndex, String callingPackage, String callingFeatureId)1358     String getMeidForSlot(int slotIndex, String callingPackage, String callingFeatureId);
1359 
1360     /**
1361      * Returns the Manufacturer Code from the MEID for the given slot.
1362      *
1363      * @param slotIndex - Which slot to retrieve the Manufacturer Code from.
1364      */
getManufacturerCodeForSlot(int slotIndex)1365     String getManufacturerCodeForSlot(int slotIndex);
1366 
1367     /**
1368      * Returns the device software version.
1369      *
1370      * @param slotIndex - device slot.
1371      * @param callingPackage The package making the call.
1372      * @param callingFeatureId The feature in the package.
1373      * <p>Requires Permission:
1374      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1375      */
getDeviceSoftwareVersionForSlot(int slotIndex, String callingPackage, String callingFeatureId)1376     String getDeviceSoftwareVersionForSlot(int slotIndex, String callingPackage,
1377             String callingFeatureId);
1378 
1379     /**
1380      * Returns the subscription ID associated with the specified PhoneAccount.
1381      */
getSubIdForPhoneAccount(in PhoneAccount phoneAccount)1382     int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
1383 
1384     /**
1385      * Returns the subscription ID associated with the specified PhoneAccountHandle.
1386      */
getSubIdForPhoneAccountHandle(in PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId)1387     int getSubIdForPhoneAccountHandle(in PhoneAccountHandle phoneAccountHandle,
1388             String callingPackage, String callingFeatureId);
1389 
1390     /**
1391      * Returns the PhoneAccountHandle associated with a subscription ID.
1392      */
getPhoneAccountHandleForSubscriptionId(int subscriptionId)1393     PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId);
1394 
factoryReset(int subId)1395     void factoryReset(int subId);
1396 
1397     /**
1398      * Returns users's current locale based on the SIM.
1399      *
1400      * The returned string will be a well formed BCP-47 language tag, or {@code null}
1401      * if no locale could be derived.
1402      */
getSimLocaleForSubscriber(int subId)1403     String getSimLocaleForSubscriber(int subId);
1404 
1405     /**
1406      * Requests the modem activity info asynchronously.
1407      * The implementor is expected to reply with the
1408      * {@link android.telephony.ModemActivityInfo} object placed into the Bundle with the key
1409      * {@link android.telephony.TelephonyManager#MODEM_ACTIVITY_RESULT_KEY}.
1410      * The result code is ignored.
1411      */
requestModemActivityInfo(in ResultReceiver result)1412     oneway void requestModemActivityInfo(in ResultReceiver result);
1413 
1414     /**
1415      * Get the service state on specified subscription
1416      * @param subId Subscription id
1417      * @param callingPackage The package making the call
1418      * @param callingFeatureId The feature in the package
1419      * @return Service state on specified subscription.
1420      */
getServiceStateForSubscriber(int subId, String callingPackage, String callingFeatureId)1421     ServiceState getServiceStateForSubscriber(int subId, String callingPackage,
1422             String callingFeatureId);
1423 
1424     /**
1425      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
1426      *
1427      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
1428      * voicemail ringtone.
1429      * @return The URI for the ringtone to play when receiving a voicemail from a specific
1430      * PhoneAccount.
1431      */
getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle)1432     Uri getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle);
1433 
1434     /**
1435      * Sets the per-account voicemail ringtone.
1436      *
1437      * <p>Requires that the calling app is the default dialer, or has carrier privileges, or
1438      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
1439      *
1440      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
1441      * voicemail ringtone.
1442      * @param uri The URI for the ringtone to play when receiving a voicemail from a specific
1443      * PhoneAccount.
1444      */
setVoicemailRingtoneUri(String callingPackage, in PhoneAccountHandle phoneAccountHandle, in Uri uri)1445     void setVoicemailRingtoneUri(String callingPackage,
1446             in PhoneAccountHandle phoneAccountHandle, in Uri uri);
1447 
1448     /**
1449      * Returns whether vibration is set for voicemail notification in Phone settings.
1450      *
1451      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
1452      * voicemail vibration setting.
1453      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
1454      */
isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle)1455     boolean isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle);
1456 
1457     /**
1458      * Sets the per-account preference whether vibration is enabled for voicemail notifications.
1459      *
1460      * <p>Requires that the calling app is the default dialer, or has carrier privileges, or
1461      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
1462      *
1463      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
1464      * voicemail vibration setting.
1465      * @param enabled Whether to enable or disable vibration for voicemail notifications from a
1466      * specific PhoneAccount.
1467      */
setVoicemailVibrationEnabled(String callingPackage, in PhoneAccountHandle phoneAccountHandle, boolean enabled)1468     void setVoicemailVibrationEnabled(String callingPackage,
1469             in PhoneAccountHandle phoneAccountHandle, boolean enabled);
1470 
1471     /**
1472      * Returns a list of packages that have carrier privileges for the specific phone.
1473      */
getPackagesWithCarrierPrivileges(int phoneId)1474     List<String> getPackagesWithCarrierPrivileges(int phoneId);
1475 
1476      /**
1477       * Returns a list of packages that have carrier privileges.
1478       */
getPackagesWithCarrierPrivilegesForAllPhones()1479     List<String> getPackagesWithCarrierPrivilegesForAllPhones();
1480 
1481     /**
1482      * Return the application ID for the app type.
1483      *
1484      * @param subId the subscription ID that this request applies to.
1485      * @param appType the uicc app type,
1486      * @return Application ID for specificied app type or null if no uicc or error.
1487      */
getAidForAppType(int subId, int appType)1488     String getAidForAppType(int subId, int appType);
1489 
1490     /**
1491     * Return the Electronic Serial Number.
1492     *
1493     * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
1494     *
1495     * @param subId the subscription ID that this request applies to.
1496     * @return ESN or null if error.
1497     * @hide
1498     */
getEsn(int subId)1499     String getEsn(int subId);
1500 
1501     /**
1502     * Return the Preferred Roaming List Version
1503     *
1504     * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
1505     * @param subId the subscription ID that this request applies to.
1506     * @return PRLVersion or null if error.
1507     * @hide
1508     */
getCdmaPrlVersion(int subId)1509     String getCdmaPrlVersion(int subId);
1510 
1511     /**
1512      * Get snapshot of Telephony histograms
1513      * @return List of Telephony histograms
1514      * Requires Permission:
1515      *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
1516      * Or the calling app has carrier privileges.
1517      */
getTelephonyHistograms()1518     List<TelephonyHistogram> getTelephonyHistograms();
1519 
1520     /**
1521      * Set the allowed carrier list and the excluded carrier list, indicating the priority between
1522      * the two lists.
1523      *
1524      * <p>Requires system privileges. In the future we may add this to carrier APIs.
1525      *
1526      * @return {@link #SET_CARRIER_RESTRICTION_SUCCESS} in case of success.
1527      * {@link #SET_CARRIER_RESTRICTION_NOT_SUPPORTED} if the modem does not support the
1528      * configuration. {@link #SET_CARRIER_RESTRICTION_ERROR} in all other error cases.
1529      */
setAllowedCarriers(in CarrierRestrictionRules carrierRestrictionRules)1530     int setAllowedCarriers(in CarrierRestrictionRules carrierRestrictionRules);
1531 
1532     /**
1533      * Get the allowed carrier list and the excluded carrier list indicating the priority between
1534      * the two lists.
1535      *
1536      * <p>Requires system privileges. In the future we may add this to carrier APIs.
1537      *
1538      * @return {@link CarrierRestrictionRules}; empty lists mean all carriers are allowed. It
1539      * returns null in case of error.
1540      */
getAllowedCarriers()1541     CarrierRestrictionRules getAllowedCarriers();
1542 
1543    /**
1544      * Returns carrier id of the given subscription.
1545      * <p>To recognize carrier as a first class identity, assign each carrier with a canonical
1546      * integer a.k.a carrier id.
1547      *
1548      * @param subId The subscription id
1549      * @return Carrier id of given subscription id. return {@link #UNKNOWN_CARRIER_ID} if
1550      * subscription is unavailable or carrier cannot be identified.
1551      * @throws IllegalStateException if telephony service is unavailable.
1552      * @hide
1553      */
getSubscriptionCarrierId(int subId)1554     int getSubscriptionCarrierId(int subId);
1555 
1556     /**
1557      * Returns carrier name of the given subscription.
1558      * <p>Carrier name is a user-facing name of carrier id {@link #getSimCarrierId(int)},
1559      * usually the brand name of the subsidiary (e.g. T-Mobile). Each carrier could configure
1560      * multiple {@link #getSimOperatorName() SPN} but should have a single carrier name.
1561      * Carrier name is not canonical identity, use {@link #getSimCarrierId(int)} instead.
1562      * <p>Returned carrier name is unlocalized.
1563      *
1564      * @return Carrier name of given subscription id. return {@code null} if subscription is
1565      * unavailable or carrier cannot be identified.
1566      * @throws IllegalStateException if telephony service is unavailable.
1567      * @hide
1568      */
getSubscriptionCarrierName(int subId)1569     String getSubscriptionCarrierName(int subId);
1570 
1571     /**
1572      * Returns fine-grained carrier id of the current subscription.
1573      *
1574      * <p>The specific carrier id can be used to further differentiate a carrier by different
1575      * networks, by prepaid v.s.postpaid or even by 4G v.s.3G plan. Each carrier has a unique
1576      * carrier id {@link #getSimCarrierId()} but can have multiple precise carrier id. e.g,
1577      * {@link #getSimCarrierId()} will always return Tracfone (id 2022) for a Tracfone SIM, while
1578      * {@link #getSimPreciseCarrierId()} can return Tracfone AT&T or Tracfone T-Mobile based on the
1579      * current underlying network.
1580      *
1581      * <p>For carriers without any fine-grained carrier ids, return {@link #getSimCarrierId()}
1582      *
1583      * @return Returns fine-grained carrier id of the current subscription.
1584      * Return {@link #UNKNOWN_CARRIER_ID} if the subscription is unavailable or the carrier cannot
1585      * be identified.
1586      * @hide
1587      */
getSubscriptionSpecificCarrierId(int subId)1588     int getSubscriptionSpecificCarrierId(int subId);
1589 
1590     /**
1591      * Similar like {@link #getSimCarrierIdName()}, returns user-facing name of the
1592      * specific carrier id {@link #getSimSpecificCarrierId()}
1593      *
1594      * <p>The returned name is unlocalized.
1595      *
1596      * @return user-facing name of the subscription specific carrier id. Return {@code null} if the
1597      * subscription is unavailable or the carrier cannot be identified.
1598      * @hide
1599      */
getSubscriptionSpecificCarrierName(int subId)1600     String getSubscriptionSpecificCarrierName(int subId);
1601 
1602     /**
1603      * Returns carrier id based on MCCMNC only. This will return a MNO carrier id used for fallback
1604      * check when exact carrier id {@link #getSimCarrierId()} configurations are not found
1605      *
1606      * @param isSubscriptionMccMnc. If {@true} it means this is a query for subscription mccmnc
1607      * {@false} otherwise.
1608      *
1609      * @return carrier id from passing mccmnc.
1610      * @hide
1611      */
getCarrierIdFromMccMnc(int slotIndex, String mccmnc, boolean isSubscriptionMccMnc)1612     int getCarrierIdFromMccMnc(int slotIndex, String mccmnc, boolean isSubscriptionMccMnc);
1613 
1614     /**
1615      * Action set from carrier signalling broadcast receivers to enable/disable metered apns
1616      * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
1617      * @param subId the subscription ID that this action applies to.
1618      * @param enabled control enable or disable metered apns.
1619      * @hide
1620      */
carrierActionSetMeteredApnsEnabled(int subId, boolean visible)1621     void carrierActionSetMeteredApnsEnabled(int subId, boolean visible);
1622 
1623     /**
1624      * Action set from carrier signalling broadcast receivers to enable/disable radio
1625      * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
1626      * @param subId the subscription ID that this action applies to.
1627      * @param enabled control enable or disable radio.
1628      * @hide
1629      */
carrierActionSetRadioEnabled(int subId, boolean enabled)1630     void carrierActionSetRadioEnabled(int subId, boolean enabled);
1631 
1632     /**
1633      * Action set from carrier signalling broadcast receivers to start/stop reporting default
1634      * network conditions.
1635      * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
1636      * @param subId the subscription ID that this action applies to.
1637      * @param report control start/stop reporting default network events.
1638      * @hide
1639      */
carrierActionReportDefaultNetworkStatus(int subId, boolean report)1640     void carrierActionReportDefaultNetworkStatus(int subId, boolean report);
1641 
1642     /**
1643      * Action set from carrier signalling broadcast receivers to reset all carrier actions.
1644      * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
1645      * @param subId the subscription ID that this action applies to.
1646      * @hide
1647      */
carrierActionResetAll(int subId)1648     void carrierActionResetAll(int subId);
1649 
1650     /**
1651      * Gets the voice call forwarding info {@link CallForwardingInfo}, given the call forward
1652      * reason.
1653      *
1654      * @param callForwardingReason the call forwarding reasons which are the bitwise-OR combination
1655      * of the following constants:
1656      * <ol>
1657      * <li>{@link CallForwardingInfo#REASON_BUSY} </li>
1658      * <li>{@link CallForwardingInfo#REASON_NO_REPLY} </li>
1659      * <li>{@link CallForwardingInfo#REASON_NOT_REACHABLE} </li>
1660      * </ol>
1661      *
1662      * @throws IllegalArgumentException if callForwardingReason is not a bitwise-OR combination
1663      * of {@link CallForwardingInfo.REASON_BUSY}, {@link CallForwardingInfo.REASON_BUSY},
1664      * {@link CallForwardingInfo.REASON_NOT_REACHABLE}
1665      *
1666      * @return {@link CallForwardingInfo} with the status {@link CallForwardingInfo#STATUS_ACTIVE}
1667      * or {@link CallForwardingInfo#STATUS_INACTIVE} and the target phone number to forward calls
1668      * to, if it's available. Otherwise, it will return a {@link CallForwardingInfo} with status
1669      * {@link CallForwardingInfo#STATUS_NOT_SUPPORTED} or
1670      * {@link CallForwardingInfo#STATUS_FDN_CHECK_FAILURE} depending on the situation.
1671      *
1672      * @hide
1673      */
getCallForwarding(int subId, int callForwardingReason)1674     CallForwardingInfo getCallForwarding(int subId, int callForwardingReason);
1675 
1676     /**
1677      * Sets the voice call forwarding info including status (enable/disable), call forwarding
1678      * reason, the number to forward, and the timeout before the forwarding is attempted.
1679      *
1680      * @param callForwardingInfo {@link CallForwardingInfo} to setup the call forwarding.
1681      * Enabling if {@link CallForwardingInfo#getStatus()} returns
1682      * {@link CallForwardingInfo#STATUS_ACTIVE}; Disabling if
1683      * {@link CallForwardingInfo#getStatus()} returns {@link CallForwardingInfo#STATUS_INACTIVE}.
1684      *
1685      * @throws IllegalArgumentException if any of the following:
1686      * 0) callForwardingInfo is null.
1687      * 1) {@link CallForwardingInfo#getStatus()} for callForwardingInfo returns neither
1688      * {@link CallForwardingInfo#STATUS_ACTIVE} nor {@link CallForwardingInfo#STATUS_INACTIVE}.
1689      * 2) {@link CallForwardingInfo#getReason()} for callForwardingInfo doesn't return the
1690      * bitwise-OR combination of {@link CallForwardingInfo.REASON_BUSY},
1691      * {@link CallForwardingInfo.REASON_BUSY}, {@link CallForwardingInfo.REASON_NOT_REACHABLE}
1692      * 3) {@link CallForwardingInfo#getNumber()} for callForwardingInfo returns null.
1693      * 4) {@link CallForwardingInfo#getTimeout()} for callForwardingInfo returns nagetive value.
1694      *
1695      * @return {@code true} to indicate it was set successfully; {@code false} otherwise.
1696      *
1697      * @hide
1698      */
setCallForwarding(int subId, in CallForwardingInfo callForwardingInfo)1699     boolean setCallForwarding(int subId, in CallForwardingInfo callForwardingInfo);
1700 
1701     /**
1702      * Gets the status of voice call waiting function. Call waiting function enables the waiting
1703      * for the incoming call when it reaches the user who is busy to make another call and allows
1704      * users to decide whether to switch to the incoming call.
1705      *
1706      * @return the status of call waiting function.
1707      * @hide
1708      */
getCallWaitingStatus(int subId)1709     int getCallWaitingStatus(int subId);
1710 
1711     /**
1712      * Sets the status for voice call waiting function. Call waiting function enables the waiting
1713      * for the incoming call when it reaches the user who is busy to make another call and allows
1714      * users to decide whether to switch to the incoming call.
1715      *
1716      * @param isEnable {@code true} to enable; {@code false} to disable.
1717      * @return {@code true} to indicate it was set successfully; {@code false} otherwise.
1718      *
1719      * @hide
1720      */
setCallWaitingStatus(int subId, boolean isEnable)1721     boolean setCallWaitingStatus(int subId, boolean isEnable);
1722 
1723     /**
1724      * Policy control of data connection. Usually used when data limit is passed.
1725      * @param enabled True if enabling the data, otherwise disabling.
1726      * @param subId Subscription index
1727      * @hide
1728      */
setPolicyDataEnabled(boolean enabled, int subId)1729     void setPolicyDataEnabled(boolean enabled, int subId);
1730 
1731     /**
1732      * Get Client request stats which will contain statistical information
1733      * on each request made by client.
1734      * @param callingPackage package making the call.
1735      * @param callingFeatureId The feature in the package.
1736      * @param subId Subscription index
1737      * @hide
1738      */
getClientRequestStats(String callingPackage, String callingFeatureId, int subid)1739     List<ClientRequestStats> getClientRequestStats(String callingPackage, String callingFeatureId,
1740             int subid);
1741 
1742     /**
1743      * Set SIM card power state.
1744      * @param slotIndex SIM slot id
1745      * @param state  State of SIM (power down, power up, pass through)
1746      * @hide
1747      * */
setSimPowerStateForSlot(int slotIndex, int state)1748     void setSimPowerStateForSlot(int slotIndex, int state);
1749 
1750     /**
1751      * Returns a list of Forbidden PLMNs from the specified SIM App
1752      * Returns null if the query fails.
1753      *
1754      * <p>Requires that the calling app has READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE
1755      *
1756      * @param subId subscription ID used for authentication
1757      * @param appType the icc application type, like {@link #APPTYPE_USIM}
1758      */
getForbiddenPlmns(int subId, int appType, String callingPackage, String callingFeatureId)1759     String[] getForbiddenPlmns(int subId, int appType, String callingPackage,
1760              String callingFeatureId);
1761 
1762     /**
1763      * Set the forbidden PLMN list from the givven app type (ex APPTYPE_USIM) on a particular
1764      * subscription.
1765      *
1766      * @param subId subId the id of the subscription
1767      * @param appType appType the uicc app type, must be USIM or SIM.
1768      * @param fplmns plmns the Forbiden plmns list that needed to be written to the SIM.
1769      * @param callingPackage the op Package name.
1770      * @param callingFeatureId the feature in the package.
1771      * @return number of fplmns that is successfully written to the SIM
1772      */
setForbiddenPlmns(int subId, int appType, in List<String> fplmns, String callingPackage, String callingFeatureId)1773     int setForbiddenPlmns(int subId, int appType, in List<String> fplmns, String callingPackage,
1774             String callingFeatureId);
1775 
1776     /**
1777      * Check if phone is in emergency callback mode
1778      * @return true if phone is in emergency callback mode
1779      * @param subId the subscription ID that this action applies to.
1780      * @hide
1781      */
getEmergencyCallbackMode(int subId)1782     boolean getEmergencyCallbackMode(int subId);
1783 
1784     /**
1785      * Get the most recently available signal strength information.
1786      *
1787      * Get the most recent SignalStrength information reported by the modem. Due
1788      * to power saving this information may not always be current.
1789      * @param subId Subscription index
1790      * @return the most recent cached signal strength info from the modem
1791      * @hide
1792      */
getSignalStrength(int subId)1793     SignalStrength getSignalStrength(int subId);
1794 
1795     /**
1796      * Get the card ID of the default eUICC card. If there is no eUICC, returns
1797      * {@link #INVALID_CARD_ID}.
1798      *
1799      * @param subId subscription ID used for authentication
1800      * @param callingPackage package making the call
1801      * @return card ID of the default eUICC card.
1802      */
getCardIdForDefaultEuicc(int subId, String callingPackage)1803     int getCardIdForDefaultEuicc(int subId, String callingPackage);
1804 
1805     /**
1806      * Gets information about currently inserted UICCs and eUICCs.
1807      * <p>
1808      * Requires that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
1809      * <p>
1810      * If the caller has carrier priviliges on any active subscription, then they have permission to
1811      * get simple information like the card ID ({@link UiccCardInfo#getCardId()}), whether the card
1812      * is an eUICC ({@link UiccCardInfo#isEuicc()}), and the slot index where the card is inserted
1813      * ({@link UiccCardInfo#getSlotIndex()}).
1814      * <p>
1815      * To get private information such as the EID ({@link UiccCardInfo#getEid()}) or ICCID
1816      * ({@link UiccCardInfo#getIccId()}), the caller must have carrier priviliges on that specific
1817      * UICC or eUICC card.
1818      * <p>
1819      * See {@link UiccCardInfo} for more details on the kind of information available.
1820      *
1821      * @param callingPackage package making the call, used to evaluate carrier privileges
1822      * @return a list of UiccCardInfo objects, representing information on the currently inserted
1823      * UICCs and eUICCs. Each UiccCardInfo in the list will have private information filtered out if
1824      * the caller does not have adequate permissions for that card.
1825      */
getUiccCardsInfo(String callingPackage)1826     List<UiccCardInfo> getUiccCardsInfo(String callingPackage);
1827 
1828     /**
1829      * Get slot info for all the UICC slots.
1830      * @return UiccSlotInfo array.
1831      * @hide
1832      */
getUiccSlotsInfo()1833     UiccSlotInfo[] getUiccSlotsInfo();
1834 
1835     /**
1836      * Map logicalSlot to physicalSlot, and activate the physicalSlot if it is inactive.
1837      * @param physicalSlots Index i in the array representing physical slot for phone i. The array
1838      *        size should be same as getPhoneCount().
1839      * @return boolean Return true if the switch succeeds, false if the switch fails.
1840      */
switchSlots(in int[] physicalSlots)1841     boolean switchSlots(in int[] physicalSlots);
1842 
1843     /**
1844      * Returns whether mobile data roaming is enabled on the subscription with id {@code subId}.
1845      *
1846      * @param subId the subscription id
1847      * @return {@code true} if the data roaming is enabled on this subscription.
1848      */
isDataRoamingEnabled(int subId)1849     boolean isDataRoamingEnabled(int subId);
1850 
1851     /**
1852      * Enables/Disables the data roaming on the subscription with id {@code subId}.
1853      *
1854      * @param subId the subscription id
1855      * @param isEnabled {@code true} to enable mobile data roaming, otherwise disable it.
1856      */
setDataRoamingEnabled(int subId, boolean isEnabled)1857     void setDataRoamingEnabled(int subId, boolean isEnabled);
1858 
1859     /**
1860      * Gets the roaming mode for the CDMA phone with the subscription id {@code subId}.
1861      *
1862      * @param the subscription id.
1863      * @return the roaming mode for CDMA phone.
1864      */
getCdmaRoamingMode(int subId)1865     int getCdmaRoamingMode(int subId);
1866 
1867     /**
1868      * Sets the roaming mode on the CDMA phone with the subscription {@code subId} to the given
1869      * roaming mode {@code mode}.
1870      *
1871      * @param subId the subscription id.
1872      * @param mode the roaming mode should be set.
1873      * @return {@code true} if successed.
1874      */
setCdmaRoamingMode(int subId, int mode)1875     boolean setCdmaRoamingMode(int subId, int mode);
1876 
1877     /**
1878      * Sets the subscription mode for CDMA phone with the subscription {@code subId} to the given
1879      * subscription mode {@code mode}.
1880      *
1881      * @param subId the subscription id.
1882      * @param mode the subscription mode should be set.
1883      * @return {@code true} if successed.
1884      */
setCdmaSubscriptionMode(int subId, int mode)1885     boolean setCdmaSubscriptionMode(int subId, int mode);
1886 
1887     /**
1888      * A test API to override carrier information including mccmnc, imsi, iccid, gid1, gid2,
1889      * plmn and spn. This would be handy for, eg, forcing a particular carrier id, carrier's config
1890      * (also any country or carrier overlays) to be loaded when using a test SIM with a call box.
1891      */
setCarrierTestOverride(int subId, String mccmnc, String imsi, String iccid, String gid1, String gid2, String plmn, String spn, String carrierPrivilegeRules, String apn)1892     void setCarrierTestOverride(int subId, String mccmnc, String imsi, String iccid, String gid1,
1893             String gid2, String plmn, String spn, String carrierPrivilegeRules, String apn);
1894 
1895     /**
1896      * A test API to return installed carrier id list version.
1897      */
getCarrierIdListVersion(int subId)1898     int getCarrierIdListVersion(int subId);
1899 
1900     /**
1901      * A test API to reload the UICC profile.
1902      * @hide
1903      */
refreshUiccProfile(int subId)1904     void refreshUiccProfile(int subId);
1905 
1906     /**
1907      * How many modems can have simultaneous data connections.
1908      * @hide
1909      */
getNumberOfModemsWithSimultaneousDataConnections(int subId, String callingPackage, String callingFeatureId)1910     int getNumberOfModemsWithSimultaneousDataConnections(int subId, String callingPackage,
1911             String callingFeatureId);
1912 
1913     /**
1914      * Return the network selection mode on the subscription with id {@code subId}.
1915      */
getNetworkSelectionMode(int subId)1916      int getNetworkSelectionMode(int subId);
1917 
1918      /**
1919      * Return true if the device is in emergency sms mode, false otherwise.
1920      */
isInEmergencySmsMode()1921      boolean isInEmergencySmsMode();
1922 
1923     /**
1924      * Return the modem radio power state for slot index.
1925      *
1926      */
getRadioPowerState(int slotIndex, String callingPackage, String callingFeatureId)1927     int getRadioPowerState(int slotIndex, String callingPackage, String callingFeatureId);
1928 
1929     // IMS specific AIDL commands, see ImsMmTelManager.java
1930 
1931     /**
1932      * Adds an IMS registration status callback for the subscription id specified.
1933      */
registerImsRegistrationCallback(int subId, IImsRegistrationCallback c)1934     void registerImsRegistrationCallback(int subId, IImsRegistrationCallback c);
1935      /**
1936       * Removes an existing IMS registration status callback for the subscription specified.
1937       */
unregisterImsRegistrationCallback(int subId, IImsRegistrationCallback c)1938     void unregisterImsRegistrationCallback(int subId, IImsRegistrationCallback c);
1939 
1940     /**
1941      * Get the IMS service registration state for the MmTelFeature associated with this sub id.
1942      */
getImsMmTelRegistrationState(int subId, IIntegerConsumer consumer)1943     void getImsMmTelRegistrationState(int subId, IIntegerConsumer consumer);
1944 
1945     /**
1946      * Get the transport type for the IMS service registration state.
1947      */
getImsMmTelRegistrationTransportType(int subId, IIntegerConsumer consumer)1948     void getImsMmTelRegistrationTransportType(int subId, IIntegerConsumer consumer);
1949 
1950     /**
1951      * Adds an IMS MmTel capabilities callback for the subscription specified.
1952      */
registerMmTelCapabilityCallback(int subId, IImsCapabilityCallback c)1953     void registerMmTelCapabilityCallback(int subId, IImsCapabilityCallback c);
1954 
1955     /**
1956      * Removes an existing IMS MmTel capabilities callback for the subscription specified.
1957      */
unregisterMmTelCapabilityCallback(int subId, IImsCapabilityCallback c)1958     void unregisterMmTelCapabilityCallback(int subId, IImsCapabilityCallback c);
1959 
1960     /**
1961      * return true if the IMS MmTel capability for the given registration tech is capable.
1962      */
isCapable(int subId, int capability, int regTech)1963     boolean isCapable(int subId, int capability, int regTech);
1964 
1965     /**
1966      * return true if the IMS MmTel capability for the given registration tech is available.
1967      */
isAvailable(int subId, int capability, int regTech)1968     boolean isAvailable(int subId, int capability, int regTech);
1969 
1970     /**
1971      * Return whether or not the MmTel capability is supported for the requested transport type.
1972      */
isMmTelCapabilitySupported(int subId, IIntegerConsumer callback, int capability, int transportType)1973     void isMmTelCapabilitySupported(int subId, IIntegerConsumer callback, int capability,
1974             int transportType);
1975 
1976     /**
1977      * Returns true if the user's setting for 4G LTE is enabled, for the subscription specified.
1978      */
isAdvancedCallingSettingEnabled(int subId)1979     boolean isAdvancedCallingSettingEnabled(int subId);
1980 
1981     /**
1982      * Modify the user's setting for whether or not 4G LTE is enabled.
1983      */
setAdvancedCallingSettingEnabled(int subId, boolean isEnabled)1984     void setAdvancedCallingSettingEnabled(int subId, boolean isEnabled);
1985 
1986     /**
1987      * return true if the user's setting for VT is enabled for the subscription.
1988      */
isVtSettingEnabled(int subId)1989     boolean isVtSettingEnabled(int subId);
1990 
1991     /**
1992      * Modify the user's setting for whether or not VT is available for the subscrption specified.
1993      */
setVtSettingEnabled(int subId, boolean isEnabled)1994     void setVtSettingEnabled(int subId, boolean isEnabled);
1995 
1996     /**
1997      * return true if the user's setting for whether or not Voice over WiFi is currently enabled.
1998      */
isVoWiFiSettingEnabled(int subId)1999     boolean isVoWiFiSettingEnabled(int subId);
2000 
2001     /**
2002      * sets the user's setting for Voice over WiFi enabled state.
2003      */
setVoWiFiSettingEnabled(int subId, boolean isEnabled)2004     void setVoWiFiSettingEnabled(int subId, boolean isEnabled);
2005 
2006     /**
2007      * return true if the user's setting for Voice over WiFi while roaming is enabled.
2008      */
isVoWiFiRoamingSettingEnabled(int subId)2009     boolean isVoWiFiRoamingSettingEnabled(int subId);
2010 
2011     /**
2012      * Sets the user's preference for whether or not Voice over WiFi is enabled for the current
2013      * subscription while roaming.
2014      */
setVoWiFiRoamingSettingEnabled(int subId, boolean isEnabled)2015     void setVoWiFiRoamingSettingEnabled(int subId, boolean isEnabled);
2016 
2017     /**
2018      * Set the Voice over WiFi enabled state, but do not persist the setting.
2019      */
setVoWiFiNonPersistent(int subId, boolean isCapable, int mode)2020     void setVoWiFiNonPersistent(int subId, boolean isCapable, int mode);
2021 
2022     /**
2023      * return the Voice over WiFi mode preference set by the user for the subscription specified.
2024      */
getVoWiFiModeSetting(int subId)2025     int getVoWiFiModeSetting(int subId);
2026 
2027     /**
2028      * sets the user's preference for the Voice over WiFi mode for the subscription specified.
2029      */
setVoWiFiModeSetting(int subId, int mode)2030     void setVoWiFiModeSetting(int subId, int mode);
2031 
2032     /**
2033      * return the Voice over WiFi mode preference set by the user for the subscription specified
2034      * while roaming.
2035      */
getVoWiFiRoamingModeSetting(int subId)2036     int getVoWiFiRoamingModeSetting(int subId);
2037 
2038     /**
2039      * sets the user's preference for the Voice over WiFi mode for the subscription specified
2040      * while roaming.
2041      */
setVoWiFiRoamingModeSetting(int subId, int mode)2042     void setVoWiFiRoamingModeSetting(int subId, int mode);
2043 
2044     /**
2045      * Modify the user's setting for whether or not RTT is enabled for the subscrption specified.
2046      */
setRttCapabilitySetting(int subId, boolean isEnabled)2047     void setRttCapabilitySetting(int subId, boolean isEnabled);
2048 
2049     /**
2050      * return true if TTY over VoLTE is enabled for the subscription specified.
2051      */
isTtyOverVolteEnabled(int subId)2052     boolean isTtyOverVolteEnabled(int subId);
2053 
2054     /**
2055      * Return the emergency number list from all the active subscriptions.
2056      */
getEmergencyNumberList(String callingPackage, String callingFeatureId)2057     Map getEmergencyNumberList(String callingPackage, String callingFeatureId);
2058 
2059     /**
2060      * Identify if the number is emergency number, based on all the active subscriptions.
2061      */
isEmergencyNumber(String number, boolean exactMatch)2062     boolean isEmergencyNumber(String number, boolean exactMatch);
2063 
2064     /**
2065      * Return a list of certs in hex string from loaded carrier privileges access rules.
2066      */
getCertsFromCarrierPrivilegeAccessRules(int subId)2067     List<String> getCertsFromCarrierPrivilegeAccessRules(int subId);
2068 
2069     /**
2070      * Register an IMS provisioning change callback with Telephony.
2071      */
registerImsProvisioningChangedCallback(int subId, IImsConfigCallback callback)2072     void registerImsProvisioningChangedCallback(int subId, IImsConfigCallback callback);
2073 
2074     /**
2075      * unregister an existing IMS provisioning change callback.
2076      */
unregisterImsProvisioningChangedCallback(int subId, IImsConfigCallback callback)2077     void unregisterImsProvisioningChangedCallback(int subId, IImsConfigCallback callback);
2078 
2079     /**
2080      * Set the provisioning status for the IMS MmTel capability using the specified subscription.
2081      */
setImsProvisioningStatusForCapability(int subId, int capability, int tech, boolean isProvisioned)2082     void setImsProvisioningStatusForCapability(int subId, int capability, int tech,
2083             boolean isProvisioned);
2084 
2085     /**
2086      * Get the provisioning status for the IMS MmTel capability specified.
2087      */
getImsProvisioningStatusForCapability(int subId, int capability, int tech)2088     boolean getImsProvisioningStatusForCapability(int subId, int capability, int tech);
2089 
2090     /**
2091      * Get the provisioning status for the IMS Rcs capability specified.
2092      */
getRcsProvisioningStatusForCapability(int subId, int capability)2093     boolean getRcsProvisioningStatusForCapability(int subId, int capability);
2094 
2095     /**
2096      * Set the provisioning status for the IMS Rcs capability using the specified subscription.
2097      */
setRcsProvisioningStatusForCapability(int subId, int capability, boolean isProvisioned)2098     void setRcsProvisioningStatusForCapability(int subId, int capability,
2099             boolean isProvisioned);
2100 
2101     /** Is the capability and tech flagged as provisioned in the cache */
isMmTelCapabilityProvisionedInCache(int subId, int capability, int tech)2102     boolean isMmTelCapabilityProvisionedInCache(int subId, int capability, int tech);
2103 
2104     /** Set the provisioning for the capability and tech in the cache */
cacheMmTelCapabilityProvisioning(int subId, int capability, int tech, boolean isProvisioned)2105     void cacheMmTelCapabilityProvisioning(int subId, int capability, int tech,
2106             boolean isProvisioned);
2107 
2108     /**
2109      * Return an integer containing the provisioning value for the specified provisioning key.
2110      */
getImsProvisioningInt(int subId, int key)2111     int getImsProvisioningInt(int subId, int key);
2112 
2113     /**
2114      * return a String containing the provisioning value for the provisioning key specified.
2115      */
getImsProvisioningString(int subId, int key)2116     String getImsProvisioningString(int subId, int key);
2117 
2118     /**
2119      * Set the integer provisioning value for the provisioning key specified.
2120      */
setImsProvisioningInt(int subId, int key, int value)2121     int setImsProvisioningInt(int subId, int key, int value);
2122 
2123     /**
2124      * Set the String provisioning value for the provisioning key specified.
2125      */
setImsProvisioningString(int subId, int key, String value)2126     int setImsProvisioningString(int subId, int key, String value);
2127 
2128     /**
2129      * Update Emergency Number List for Test Mode.
2130      */
updateEmergencyNumberListTestMode(int action, in EmergencyNumber num)2131     void updateEmergencyNumberListTestMode(int action, in EmergencyNumber num);
2132 
2133     /**
2134      * Get the full emergency number list for Test Mode.
2135      */
getEmergencyNumberListTestMode()2136     List<String> getEmergencyNumberListTestMode();
2137 
2138     /**
2139      * A test API to return the emergency number db version.
2140      */
getEmergencyNumberDbVersion(int subId)2141     int getEmergencyNumberDbVersion(int subId);
2142 
2143     /**
2144      * Notify Telephony for OTA emergency number database installation complete.
2145      */
notifyOtaEmergencyNumberDbInstalled()2146     void notifyOtaEmergencyNumberDbInstalled();
2147 
2148     /**
2149      * Override a customized file partition name for OTA emergency number database.
2150      */
updateOtaEmergencyNumberDbFilePath(in ParcelFileDescriptor otaParcelFileDescriptor)2151     void updateOtaEmergencyNumberDbFilePath(in ParcelFileDescriptor otaParcelFileDescriptor);
2152 
2153     /**
2154      * Reset file partition to default for OTA emergency number database.
2155      */
resetOtaEmergencyNumberDbFilePath()2156     void resetOtaEmergencyNumberDbFilePath();
2157 
2158     /**
2159      * Enable or disable a logical modem stack associated with the slotIndex.
2160      */
enableModemForSlot(int slotIndex, boolean enable)2161     boolean enableModemForSlot(int slotIndex, boolean enable);
2162 
2163     /**
2164      * Indicate if the enablement of multi SIM functionality is restricted.
2165      * @hide
2166      */
setMultiSimCarrierRestriction(boolean isMultiSimCarrierRestricted)2167     void setMultiSimCarrierRestriction(boolean isMultiSimCarrierRestricted);
2168 
2169     /**
2170      * Returns if the usage of multiple SIM cards at the same time is supported.
2171      *
2172      * @param callingPackage The package making the call.
2173      * @param callingFeatureId The feature in the package.
2174      * @return {@link #MULTISIM_ALLOWED} if the device supports multiple SIMs.
2175      * {@link #MULTISIM_NOT_SUPPORTED_BY_HARDWARE} if the device does not support multiple SIMs.
2176      * {@link #MULTISIM_NOT_SUPPORTED_BY_CARRIER} in the device supports multiple SIMs, but the
2177      * functionality is restricted by the carrier.
2178      */
isMultiSimSupported(String callingPackage, String callingFeatureId)2179     int isMultiSimSupported(String callingPackage, String callingFeatureId);
2180 
2181     /**
2182      * Switch configs to enable multi-sim or switch back to single-sim
2183      * @hide
2184      */
switchMultiSimConfig(int numOfSims)2185     void switchMultiSimConfig(int numOfSims);
2186 
2187     /**
2188      * Get if altering modems configurations will trigger reboot.
2189      * @hide
2190      */
doesSwitchMultiSimConfigTriggerReboot(int subId, String callingPackage, String callingFeatureId)2191     boolean doesSwitchMultiSimConfigTriggerReboot(int subId, String callingPackage,
2192              String callingFeatureId);
2193 
2194     /**
2195      * Get the mapping from logical slots to physical slots.
2196      */
getSlotsMapping()2197     int[] getSlotsMapping();
2198 
2199     /**
2200      * Get the IRadio HAL Version encoded as 100 * MAJOR_VERSION + MINOR_VERSION or -1 if unknown
2201      */
getRadioHalVersion()2202     int getRadioHalVersion();
2203 
2204     /**
2205      * Get the current calling package name.
2206      */
getCurrentPackageName()2207     String getCurrentPackageName();
2208 
2209     /**
2210      * Returns true if the specified type of application (e.g. {@link #APPTYPE_CSIM} is present
2211      * on the UICC card.
2212      * @hide
2213      */
isApplicationOnUicc(int subId, int appType)2214     boolean isApplicationOnUicc(int subId, int appType);
2215 
isModemEnabledForSlot(int slotIndex, String callingPackage, String callingFeatureId)2216     boolean isModemEnabledForSlot(int slotIndex, String callingPackage, String callingFeatureId);
2217 
isDataEnabledForApn(int apnType, int subId, String callingPackage)2218     boolean isDataEnabledForApn(int apnType, int subId, String callingPackage);
2219 
isApnMetered(int apnType, int subId)2220     boolean isApnMetered(int apnType, int subId);
2221 
setSystemSelectionChannels(in List<RadioAccessSpecifier> specifiers, int subId, IBooleanConsumer resultCallback)2222     oneway void setSystemSelectionChannels(in List<RadioAccessSpecifier> specifiers,
2223             int subId, IBooleanConsumer resultCallback);
2224 
isMvnoMatched(int subId, int mvnoType, String mvnoMatchData)2225     boolean isMvnoMatched(int subId, int mvnoType, String mvnoMatchData);
2226 
2227     /**
2228      * Enqueue a pending sms Consumer, which will answer with the user specified selection for an
2229      * outgoing SmsManager operation.
2230      */
enqueueSmsPickResult(String callingPackage, String callingAttributeTag, IIntegerConsumer subIdResult)2231     oneway void enqueueSmsPickResult(String callingPackage, String callingAttributeTag,
2232         IIntegerConsumer subIdResult);
2233 
2234     /**
2235      * Returns the MMS user agent.
2236      */
getMmsUserAgent(int subId)2237     String getMmsUserAgent(int subId);
2238 
2239     /**
2240      * Returns the MMS user agent profile URL.
2241      */
getMmsUAProfUrl(int subId)2242     String getMmsUAProfUrl(int subId);
2243 
2244     /**
2245      * Set allowing mobile data during voice call.
2246      */
setDataAllowedDuringVoiceCall(int subId, boolean allow)2247     boolean setDataAllowedDuringVoiceCall(int subId, boolean allow);
2248 
2249     /**
2250      * Check whether data is allowed during voice call. Note this is for dual sim device that
2251      * data might be disabled on non-default data subscription but explicitly turned on by settings.
2252      */
isDataAllowedInVoiceCall(int subId)2253     boolean isDataAllowedInVoiceCall(int subId);
2254 
2255     /**
2256      * Set whether a subscription always allows MMS connection.
2257      */
setAlwaysAllowMmsData(int subId, boolean allow)2258     boolean setAlwaysAllowMmsData(int subId, boolean allow);
2259 
2260     /**
2261      * Command line command to enable or disable handling of CEP data for test purposes.
2262      */
setCepEnabled(boolean isCepEnabled)2263     oneway void setCepEnabled(boolean isCepEnabled);
2264 
2265     /**
2266      * Notify Rcs auto config received.
2267      */
notifyRcsAutoConfigurationReceived(int subId, in byte[] config, boolean isCompressed)2268     void notifyRcsAutoConfigurationReceived(int subId, in byte[] config, boolean isCompressed);
2269 
isIccLockEnabled(int subId)2270     boolean isIccLockEnabled(int subId);
2271 
setIccLockEnabled(int subId, boolean enabled, String password)2272     int setIccLockEnabled(int subId, boolean enabled, String password);
2273 
changeIccLockPassword(int subId, String oldPassword, String newPassword)2274     int changeIccLockPassword(int subId, String oldPassword, String newPassword);
2275 
2276     /**
2277      * Whether device can connect to 5G network when two SIMs are active.
2278      */
canConnectTo5GInDsdsMode()2279     boolean canConnectTo5GInDsdsMode();
2280 }
2281