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.ComponentName;
21 import android.content.Intent;
22 import android.content.IntentSender;
23 import android.os.Bundle;
24 import android.os.ICancellationSignal;
25 import android.os.IBinder;
26 import android.os.Messenger;
27 import android.os.ParcelFileDescriptor;
28 import android.os.ResultReceiver;
29 import android.os.WorkSource;
30 import android.net.NetworkStats;
31 import android.net.Uri;
32 import android.service.carrier.CarrierIdentifier;
33 import android.telecom.PhoneAccount;
34 import android.telecom.PhoneAccountHandle;
35 import android.telephony.CallForwardingInfo;
36 import android.telephony.CarrierRestrictionRules;
37 import android.telephony.CellIdentity;
38 import android.telephony.CellInfo;
39 import android.telephony.CellBroadcastIdRange;
40 import android.telephony.ClientRequestStats;
41 import android.telephony.ThermalMitigationRequest;
42 import android.telephony.gba.UaSecurityProtocolIdentifier;
43 import android.telephony.IBootstrapAuthenticationCallback;
44 import android.telephony.IccOpenLogicalChannelResponse;
45 import android.telephony.ICellInfoCallback;
46 import android.telephony.ModemActivityInfo;
47 import android.telephony.NeighboringCellInfo;
48 import android.telephony.NetworkScanRequest;
49 import android.telephony.PhoneCapability;
50 import android.telephony.PhoneNumberRange;
51 import android.telephony.RadioAccessFamily;
52 import android.telephony.RadioAccessSpecifier;
53 import android.telephony.ServiceState;
54 import android.telephony.SignalStrength;
55 import android.telephony.SignalStrengthUpdateRequest;
56 import android.telephony.TelephonyHistogram;
57 import android.telephony.VisualVoicemailSmsFilterSettings;
58 import android.telephony.emergency.EmergencyNumber;
59 import android.telephony.ims.RcsClientConfiguration;
60 import android.telephony.ims.RcsContactUceCapability;
61 import android.telephony.ims.aidl.IFeatureProvisioningCallback;
62 import android.telephony.ims.aidl.IImsCapabilityCallback;
63 import android.telephony.ims.aidl.IImsConfig;
64 import android.telephony.ims.aidl.IImsConfigCallback;
65 import android.telephony.ims.aidl.IImsMmTelFeature;
66 import android.telephony.ims.aidl.IImsRcsFeature;
67 import android.telephony.ims.aidl.IImsRegistration;
68 import android.telephony.ims.aidl.IImsRegistrationCallback;
69 import android.telephony.ims.aidl.IRcsConfigCallback;
70 import android.telephony.satellite.ISatelliteDatagramCallback;
71 import android.telephony.satellite.ISatelliteTransmissionUpdateCallback;
72 import android.telephony.satellite.ISatelliteProvisionStateCallback;
73 import android.telephony.satellite.ISatelliteStateCallback;
74 import android.telephony.satellite.SatelliteCapabilities;
75 import android.telephony.satellite.SatelliteDatagram;
76 import com.android.ims.internal.IImsServiceFeatureCallback;
77 import com.android.internal.telephony.CellNetworkScanResult;
78 import com.android.internal.telephony.IBooleanConsumer;
79 import com.android.internal.telephony.ICallForwardingInfoCallback;
80 import com.android.internal.telephony.IccLogicalChannelRequest;
81 import com.android.internal.telephony.IImsStateCallback;
82 import com.android.internal.telephony.IIntegerConsumer;
83 import com.android.internal.telephony.INumberVerificationCallback;
84 import com.android.internal.telephony.OperatorInfo;
85 
86 import java.util.List;
87 import java.util.Map;
88 
89 import android.telephony.UiccCardInfo;
90 import android.telephony.UiccSlotInfo;
91 import android.telephony.UiccSlotMapping;
92 
93 /**
94  * Interface used to interact with the phone.  Mostly this is used by the
95  * TelephonyManager class.  A few places are still using this directly.
96  * Please clean them up if possible and use TelephonyManager instead.
97  *
98  * {@hide}
99  */
100 interface ITelephony {
101 
102     /**
103      * Dial a number. This doesn't place the call. It displays
104      * the Dialer screen.
105      * @param number the number to be dialed. If null, this
106      * would display the Dialer screen with no number pre-filled.
107      */
108     @UnsupportedAppUsage
dial(String number)109     void dial(String number);
110 
111     /**
112      * Place a call to the specified number.
113      * @param callingPackage The package making the call.
114      * @param number the number to be called.
115      */
116     @UnsupportedAppUsage
call(String callingPackage, String number)117     void call(String callingPackage, String number);
118 
119     /** @deprecated Use {@link #isRadioOnWithFeature(String, String) instead */
120     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
isRadioOn(String callingPackage)121     boolean isRadioOn(String callingPackage);
122 
123     /**
124      * Check to see if the radio is on or not.
125      * @param callingPackage the name of the package making the call.
126      * @param callingFeatureId The feature in the package.
127      * @return returns true if the radio is on.
128      */
isRadioOnWithFeature(String callingPackage, String callingFeatureId)129     boolean isRadioOnWithFeature(String callingPackage, String callingFeatureId);
130 
131     /**
132      * @deprecated Use {@link #isRadioOnForSubscriberWithFeature(int, String, String) instead
133      */
134     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
isRadioOnForSubscriber(int subId, String callingPackage)135     boolean isRadioOnForSubscriber(int subId, String callingPackage);
136 
137     /**
138      * Check to see if the radio is on or not on particular subId.
139      * @param subId user preferred subId.
140      * @param callingPackage the name of the package making the call.
141      * @param callingFeatureId The feature in the package.
142      * @return returns true if the radio is on.
143      */
isRadioOnForSubscriberWithFeature(int subId, String callingPackage, String callingFeatureId)144     boolean isRadioOnForSubscriberWithFeature(int subId, String callingPackage, String callingFeatureId);
145 
146     /**
147      * Set the user-set status for enriched calling with call composer.
148      */
setCallComposerStatus(int subId, int status)149     void setCallComposerStatus(int subId, int status);
150 
151     /**
152      * Get the user-set status for enriched calling with call composer.
153      */
getCallComposerStatus(int subId)154     int getCallComposerStatus(int subId);
155 
156     /**
157      * Supply a pin to unlock the SIM for particular subId.
158      * Blocks until a result is determined.
159      * @param pin The pin to check.
160      * @param subId user preferred subId.
161      * @return whether the operation was a success.
162      */
supplyPinForSubscriber(int subId, String pin)163     boolean supplyPinForSubscriber(int subId, String pin);
164 
165     /**
166      * Supply puk to unlock the SIM and set SIM pin to new pin.
167      *  Blocks until a result is determined.
168      * @param puk The puk to check.
169      *        pin The new pin to be set in SIM
170      * @param subId user preferred subId.
171      * @return whether the operation was a success.
172      */
supplyPukForSubscriber(int subId, String puk, String pin)173     boolean supplyPukForSubscriber(int subId, String puk, String pin);
174 
175     /**
176      * Supply a pin to unlock the SIM.  Blocks until a result is determined.
177      * Returns a specific success/error code.
178      * @param pin The pin to check.
179      * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
180      *         retValue[1] = number of attempts remaining if known otherwise -1
181      */
supplyPinReportResultForSubscriber(int subId, String pin)182     int[] supplyPinReportResultForSubscriber(int subId, String pin);
183 
184     /**
185      * Supply puk to unlock the SIM and set SIM pin to new pin.
186      * Blocks until a result is determined.
187      * Returns a specific success/error code
188      * @param puk The puk to check
189      *        pin The pin to check.
190      * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
191      *         retValue[1] = number of attempts remaining if known otherwise -1
192      */
supplyPukReportResultForSubscriber(int subId, String puk, String pin)193     int[] supplyPukReportResultForSubscriber(int subId, String puk, String pin);
194 
195     /**
196      * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
197      * without SEND (so <code>dial</code> is not appropriate).
198      *
199      * @param dialString the MMI command to be executed.
200      * @return true if MMI command is executed.
201      */
202     @UnsupportedAppUsage
handlePinMmi(String dialString)203     boolean handlePinMmi(String dialString);
204 
205 
206     /**
207      * Handles USSD commands.
208      *
209      * @param subId The subscription to use.
210      * @param ussdRequest the USSD command to be executed.
211      * @param wrappedCallback receives a callback result.
212      */
handleUssdRequest(int subId, String ussdRequest, in ResultReceiver wrappedCallback)213     void handleUssdRequest(int subId, String ussdRequest, in ResultReceiver wrappedCallback);
214 
215     /**
216      * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
217      * without SEND (so <code>dial</code> is not appropriate) for
218      * a particular subId.
219      * @param dialString the MMI command to be executed.
220      * @param subId user preferred subId.
221      * @return true if MMI command is executed.
222      */
223     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
handlePinMmiForSubscriber(int subId, String dialString)224     boolean handlePinMmiForSubscriber(int subId, String dialString);
225 
226     /**
227      * Toggles the radio on or off.
228      */
229     @UnsupportedAppUsage
toggleRadioOnOff()230     void toggleRadioOnOff();
231 
232     /**
233      * Toggles the radio on or off on particular subId.
234      * @param subId user preferred subId.
235      */
toggleRadioOnOffForSubscriber(int subId)236     void toggleRadioOnOffForSubscriber(int subId);
237 
238     /**
239      * Set the radio to on or off
240      */
241     @UnsupportedAppUsage
setRadio(boolean turnOn)242     boolean setRadio(boolean turnOn);
243 
244     /**
245      * Set the radio to on or off on particular subId.
246      * @param subId user preferred subId.
247      */
setRadioForSubscriber(int subId, boolean turnOn)248     boolean setRadioForSubscriber(int subId, boolean turnOn);
249 
250     /**
251      * Set the radio to on or off unconditionally
252      */
setRadioPower(boolean turnOn)253     boolean setRadioPower(boolean turnOn);
254 
255     /**
256      * Vote on powering off the radio for a reason. The radio will be turned on only when there is
257      * no reason to power it off. When any of the voters want to power it off, it will be turned
258      * off. In case of emergency, the radio will be turned on even if there are some reasons for
259      * powering it off, and these radio off votes will be cleared.
260      * Multiple apps can vote for the same reason and the last vote will take effect. Each app is
261      * responsible for its vote. A powering-off vote of a reason will be maintained until it is
262      * cleared by calling {@link clearRadioPowerOffForReason} for that reason, or an emergency call
263      * is made, or the device is rebooted. When an app comes backup from a crash, it needs to make
264      * sure if its vote is as expected. An app can use the API {@link getRadioPowerOffReasons} to
265      * check its vote.
266      *
267      * @param subId The subscription ID.
268      * @param reason The reason for powering off radio.
269      * @return true on success and false on failure.
270      */
requestRadioPowerOffForReason(int subId, int reason)271     boolean requestRadioPowerOffForReason(int subId, int reason);
272 
273     /**
274      * Remove the vote on powering off the radio for a reasonas, requested by
275      * {@link requestRadioPowerOffForReason}.
276      *
277      * @param subId The subscription ID.
278      * @param reason The reason for powering off radio.
279      * @return true on success and false on failure.
280      */
clearRadioPowerOffForReason(int subId, int reason)281     boolean clearRadioPowerOffForReason(int subId, int reason);
282 
283     /**
284      * Get reasons for powering off radio, as requested by {@link requestRadioPowerOffForReason}.
285      *
286      * @param subId The subscription ID.
287      * @param callingPackage The package making the call.
288      * @param callingFeatureId The feature in the package.
289      * @return List of reasons for powering off radio.
290      */
getRadioPowerOffReasons(int subId, String callingPackage, String callingFeatureId)291     List getRadioPowerOffReasons(int subId, String callingPackage, String callingFeatureId);
292 
293     /**
294      * This method has been removed due to security and stability issues.
295      */
296     @UnsupportedAppUsage
updateServiceLocation()297     void updateServiceLocation();
298 
299     /**
300      * Version of updateServiceLocation that records the caller and validates permissions.
301      */
updateServiceLocationWithPackageName(String callingPkg)302     void updateServiceLocationWithPackageName(String callingPkg);
303 
304     /**
305      * This method has been removed due to security and stability issues.
306      */
307     @UnsupportedAppUsage
enableLocationUpdates()308     void enableLocationUpdates();
309 
310     /**
311      * This method has been removed due to security and stability issues.
312      */
313     @UnsupportedAppUsage
disableLocationUpdates()314     void disableLocationUpdates();
315 
316     /**
317      * Allow mobile data connections.
318      */
319     @UnsupportedAppUsage
enableDataConnectivity(String callingPackage)320     boolean enableDataConnectivity(String callingPackage);
321 
322     /**
323      * Disallow mobile data connections.
324      */
325     @UnsupportedAppUsage
disableDataConnectivity(String callingPackage)326     boolean disableDataConnectivity(String callingPackage);
327 
328     /**
329      * Report whether data connectivity is possible.
330      */
isDataConnectivityPossible(int subId)331     boolean isDataConnectivityPossible(int subId);
332 
333     // Uses CellIdentity which is Parcelable here; will convert to CellLocation in client.
getCellLocation(String callingPkg, String callingFeatureId)334     CellIdentity getCellLocation(String callingPkg, String callingFeatureId);
335 
336     /**
337      * Returns the ISO country code equivalent of the current registered
338      * operator's MCC (Mobile Country Code).
339      * @see android.telephony.TelephonyManager#getNetworkCountryIso
340      */
getNetworkCountryIsoForPhone(int phoneId)341     String getNetworkCountryIsoForPhone(int phoneId);
342 
343     /**
344      * Returns the neighboring cell information of the device.
345      */
getNeighboringCellInfo(String callingPkg, String callingFeatureId)346     List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg, String callingFeatureId);
347 
348     @UnsupportedAppUsage
getCallState()349     int getCallState();
350 
351     /**
352      * Returns the call state for a specific subscriiption.
353      */
getCallStateForSubscription(int subId, String callingPackage, String featureId)354     int getCallStateForSubscription(int subId, String callingPackage, String featureId);
355 
356     /**
357      * Replaced by getDataActivityForSubId.
358      */
359     @UnsupportedAppUsage(maxTargetSdk = 28)
getDataActivity()360     int getDataActivity();
361 
362     /**
363      * Returns a constant indicating the type of activity on a data connection
364      * (cellular).
365      *
366      * @see #DATA_ACTIVITY_NONE
367      * @see #DATA_ACTIVITY_IN
368      * @see #DATA_ACTIVITY_OUT
369      * @see #DATA_ACTIVITY_INOUT
370      * @see #DATA_ACTIVITY_DORMANT
371      */
getDataActivityForSubId(int subId)372     int getDataActivityForSubId(int subId);
373 
374     /**
375      * Replaced by getDataStateForSubId.
376      */
377     @UnsupportedAppUsage(maxTargetSdk = 28)
getDataState()378     int getDataState();
379 
380     /**
381      * Returns a constant indicating the current data connection state
382      * (cellular).
383      *
384      * @see #DATA_DISCONNECTED
385      * @see #DATA_CONNECTING
386      * @see #DATA_CONNECTED
387      * @see #DATA_SUSPENDED
388      */
getDataStateForSubId(int subId)389     int getDataStateForSubId(int subId);
390 
391     /**
392      * Returns the current active phone type as integer.
393      * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
394      * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
395      */
396     @UnsupportedAppUsage
getActivePhoneType()397     int getActivePhoneType();
398 
399     /**
400      * Returns the current active phone type as integer for particular slot.
401      * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
402      * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
403      * @param slotIndex - slot to query.
404      */
getActivePhoneTypeForSlot(int slotIndex)405     int getActivePhoneTypeForSlot(int slotIndex);
406 
407     /**
408      * Returns the CDMA ERI icon index to display
409      * @param callingPackage package making the call.
410      * @param callingFeatureId The feature in the package.
411      */
getCdmaEriIconIndex(String callingPackage, String callingFeatureId)412     int getCdmaEriIconIndex(String callingPackage, String callingFeatureId);
413 
414     /**
415      * Returns the CDMA ERI icon index to display on particular subId.
416      * @param subId user preferred subId.
417      * @param callingPackage package making the call.
418      * @param callingFeatureId The feature in the package.
419      */
getCdmaEriIconIndexForSubscriber(int subId, String callingPackage, String callingFeatureId)420     int getCdmaEriIconIndexForSubscriber(int subId, String callingPackage,
421             String callingFeatureId);
422 
423     /**
424      * Returns the CDMA ERI icon mode,
425      * 0 - ON
426      * 1 - FLASHING
427      * @param callingPackage package making the call.
428      * @param callingFeatureId The feature in the package.
429      */
getCdmaEriIconMode(String callingPackage, String callingFeatureId)430     int getCdmaEriIconMode(String callingPackage, String callingFeatureId);
431 
432     /**
433      * Returns the CDMA ERI icon mode on particular subId,
434      * 0 - ON
435      * 1 - FLASHING
436      * @param subId user preferred subId.
437      * @param callingPackage package making the call.
438      * @param callingFeatureId The feature in the package.
439      */
getCdmaEriIconModeForSubscriber(int subId, String callingPackage, String callingFeatureId)440     int getCdmaEriIconModeForSubscriber(int subId, String callingPackage,
441             String callingFeatureId);
442 
443     /**
444      * Returns the CDMA ERI text,
445      * @param callingPackage package making the call.
446      * @param callingFeatureId The feature in the package.
447      */
getCdmaEriText(String callingPackage, String callingFeatureId)448     String getCdmaEriText(String callingPackage, String callingFeatureId);
449 
450     /**
451      * Returns the CDMA ERI text for particular subId,
452      * @param subId user preferred subId.
453      * @param callingPackage package making the call.
454      * @param callingFeatureId The feature in the package.
455      */
getCdmaEriTextForSubscriber(int subId, String callingPackage, String callingFeatureId)456     String getCdmaEriTextForSubscriber(int subId, String callingPackage, String callingFeatureId);
457 
458     /**
459      * Returns true if OTA service provisioning needs to run.
460      * Only relevant on some technologies, others will always
461      * return false.
462      */
needsOtaServiceProvisioning()463     boolean needsOtaServiceProvisioning();
464 
465     /**
466      * Sets the voicemail number for a particular subscriber.
467      */
setVoiceMailNumber(int subId, String alphaTag, String number)468     boolean setVoiceMailNumber(int subId, String alphaTag, String number);
469 
470      /**
471       * Sets the voice activation state for a particular subscriber.
472       */
setVoiceActivationState(int subId, int activationState)473     void setVoiceActivationState(int subId, int activationState);
474 
475      /**
476       * Sets the data activation state for a particular subscriber.
477       */
setDataActivationState(int subId, int activationState)478     void setDataActivationState(int subId, int activationState);
479 
480      /**
481       * Returns the voice activation state for a particular subscriber.
482       * @param subId user preferred sub
483       * @param callingPackage package queries voice activation state
484       */
getVoiceActivationState(int subId, String callingPackage)485     int getVoiceActivationState(int subId, String callingPackage);
486 
487      /**
488       * Returns the data activation state for a particular subscriber.
489       * @param subId user preferred sub
490       * @param callingPackage package queris data activation state
491       */
getDataActivationState(int subId, String callingPackage)492     int getDataActivationState(int subId, String callingPackage);
493 
494     /**
495      * Returns the unread count of voicemails for a subId.
496      * @param subId user preferred subId.
497      * Returns the unread count of voicemails
498      */
getVoiceMessageCountForSubscriber(int subId, String callingPackage, String callingFeatureId)499     int getVoiceMessageCountForSubscriber(int subId, String callingPackage,
500             String callingFeatureId);
501 
502     /**
503       * Returns true if current state supports both voice and data
504       * simultaneously. This can change based on location or network condition.
505       */
isConcurrentVoiceAndDataAllowed(int subId)506     boolean isConcurrentVoiceAndDataAllowed(int subId);
507 
getVisualVoicemailSettings(String callingPackage, int subId)508     Bundle getVisualVoicemailSettings(String callingPackage, int subId);
509 
getVisualVoicemailPackageName(String callingPackage, String callingFeatureId, int subId)510     String getVisualVoicemailPackageName(String callingPackage, String callingFeatureId, int subId);
511 
512     // Not oneway, caller needs to make sure the vaule is set before receiving a SMS
enableVisualVoicemailSmsFilter(String callingPackage, int subId, in VisualVoicemailSmsFilterSettings settings)513     void enableVisualVoicemailSmsFilter(String callingPackage, int subId,
514             in VisualVoicemailSmsFilterSettings settings);
515 
disableVisualVoicemailSmsFilter(String callingPackage, int subId)516     oneway void disableVisualVoicemailSmsFilter(String callingPackage, int subId);
517 
518     // Get settings set by the calling package
getVisualVoicemailSmsFilterSettings(String callingPackage, int subId)519     VisualVoicemailSmsFilterSettings getVisualVoicemailSmsFilterSettings(String callingPackage,
520             int subId);
521 
522     /**
523      *  Get settings set by the current default dialer, Internal use only.
524      *  Requires READ_PRIVILEGED_PHONE_STATE permission.
525      */
getActiveVisualVoicemailSmsFilterSettings(int subId)526     VisualVoicemailSmsFilterSettings getActiveVisualVoicemailSmsFilterSettings(int subId);
527 
528     /**
529      * Send a visual voicemail SMS. Internal use only.
530      * Requires caller to be the default dialer and have SEND_SMS permission
531      */
sendVisualVoicemailSmsForSubscriber(in String callingPackage, String callingAttributeTag, in int subId, in String number, in int port, in String text, in PendingIntent sentIntent)532     void sendVisualVoicemailSmsForSubscriber(in String callingPackage, String callingAttributeTag,
533             in int subId, in String number, in int port, in String text, in PendingIntent sentIntent);
534 
535     // Send the special dialer code. The IPC caller must be the current default dialer.
sendDialerSpecialCode(String callingPackageName, String inputCode)536     void sendDialerSpecialCode(String callingPackageName, String inputCode);
537 
538     /**
539      * Returns the network type of a subId.
540      * @param subId user preferred subId.
541      * @param callingPackage package making the call.
542      * @param callingFeatureId The feature in the package.
543      */
getNetworkTypeForSubscriber(int subId, String callingPackage, String callingFeatureId)544     int getNetworkTypeForSubscriber(int subId, String callingPackage, String callingFeatureId);
545 
546     /**
547      * Returns the network type for data transmission
548      * @param callingPackage package making the call.
549      * @param callingFeatureId The feature in the package.
550      */
getDataNetworkType(String callingPackage, String callingFeatureId)551     int getDataNetworkType(String callingPackage, String callingFeatureId);
552 
553     /**
554      * Returns the data network type of a subId
555      * @param subId user preferred subId.
556      * @param callingPackage package making the call.
557      * @param callingFeatureId The feature in the package.
558      */
getDataNetworkTypeForSubscriber(int subId, String callingPackage, String callingFeatureId)559     int getDataNetworkTypeForSubscriber(int subId, String callingPackage,
560             String callingFeatureId);
561 
562     /**
563       * Returns the voice network type of a subId
564       * @param subId user preferred subId.
565       * @param callingPackage package making the call.getLteOnCdmaMode
566       * @param callingFeatureId The feature in the package.
567       * Returns the network type
568       */
getVoiceNetworkTypeForSubscriber(int subId, String callingPackage, String callingFeatureId)569     int getVoiceNetworkTypeForSubscriber(int subId, String callingPackage,
570             String callingFeatureId);
571 
572     /**
573      * Return true if an ICC card is present
574      */
575     @UnsupportedAppUsage
hasIccCard()576     boolean hasIccCard();
577 
578     /**
579      * Return true if an ICC card is present for a subId.
580      * @param slotIndex user preferred slotIndex.
581      * Return true if an ICC card is present
582      */
hasIccCardUsingSlotIndex(int slotIndex)583     boolean hasIccCardUsingSlotIndex(int slotIndex);
584 
585     /**
586      * Return if the current radio is LTE on CDMA. This
587      * is a tri-state return value as for a period of time
588      * the mode may be unknown.
589      *
590      * @param callingPackage the name of the calling package
591      * @param callingFeatureId The feature in the package.
592      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
593      * or {@link PHone#LTE_ON_CDMA_TRUE}
594      */
getLteOnCdmaMode(String callingPackage, String callingFeatureId)595     int getLteOnCdmaMode(String callingPackage, String callingFeatureId);
596 
597     /**
598      * Return if the current radio is LTE on CDMA. This
599      * is a tri-state return value as for a period of time
600      * the mode may be unknown.
601      *
602      * @param callingPackage the name of the calling package
603      * @param callingFeatureId The feature in the package.
604      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
605      * or {@link PHone#LTE_ON_CDMA_TRUE}
606      */
getLteOnCdmaModeForSubscriber(int subId, String callingPackage, String callingFeatureId)607     int getLteOnCdmaModeForSubscriber(int subId, String callingPackage, String callingFeatureId);
608 
609     /**
610      * Returns all observed cell information of the device.
611      */
getAllCellInfo(String callingPkg, String callingFeatureId)612     List<CellInfo> getAllCellInfo(String callingPkg, String callingFeatureId);
613 
614     /**
615      * Request a cell information update for the specified subscription,
616      * reported via the CellInfoCallback.
617      */
requestCellInfoUpdate(int subId, in ICellInfoCallback cb, String callingPkg, String callingFeatureId)618     void requestCellInfoUpdate(int subId, in ICellInfoCallback cb, String callingPkg,
619             String callingFeatureId);
620 
621     /**
622      * Request a cell information update for the specified subscription,
623      * reported via the CellInfoCallback.
624      *
625      * @param workSource the requestor to whom the power consumption for this should be attributed.
626      */
requestCellInfoUpdateWithWorkSource(int subId, in ICellInfoCallback cb, in String callingPkg, String callingFeatureId, in WorkSource ws)627     void requestCellInfoUpdateWithWorkSource(int subId, in ICellInfoCallback cb,
628             in String callingPkg, String callingFeatureId, in WorkSource ws);
629 
630     /**
631      * Sets minimum time in milli-seconds between onCellInfoChanged
632      */
setCellInfoListRate(int rateInMillis, int subId)633     void setCellInfoListRate(int rateInMillis, int subId);
634 
635     /**
636      * Opens a logical channel to the ICC card.
637      *
638      * Input parameters equivalent to TS 27.007 AT+CCHO command.
639      *
640      * @param request the parcelable used to indicate how to open the logical channel.
641      * @return an IccOpenLogicalChannelResponse object.
642      */
iccOpenLogicalChannel(in IccLogicalChannelRequest request)643     IccOpenLogicalChannelResponse iccOpenLogicalChannel(in IccLogicalChannelRequest request);
644 
645     /**
646      * Closes a previously opened logical channel to the ICC card.
647      *
648      * Input parameters equivalent to TS 27.007 AT+CCHC command.
649      *
650      * @param request the parcelable used to indicate how to close the logical channel.
651      * @return true if the channel was closed successfully.
652      */
iccCloseLogicalChannel(in IccLogicalChannelRequest request)653     boolean iccCloseLogicalChannel(in IccLogicalChannelRequest request);
654 
655     /**
656      * Transmit an APDU to the ICC card over a logical channel using the physical slot index and port index.
657      *
658      * Input parameters equivalent to TS 27.007 AT+CGLA command.
659      *
660      * @param slotIndex The physical slot index of the target ICC card
661      * @param portIndex The unique index referring to a port belonging to the SIM slot
662      * @param channel is the channel id to be closed as returned by a
663      *            successful iccOpenLogicalChannel.
664      * @param cla Class of the APDU command.
665      * @param instruction Instruction of the APDU command.
666      * @param p1 P1 value of the APDU command.
667      * @param p2 P2 value of the APDU command.
668      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
669      *            is sent to the SIM.
670      * @param data Data to be sent with the APDU.
671      * @return The APDU response from the ICC card with the status appended at
672      *            the end.
673      */
iccTransmitApduLogicalChannelByPort(int slotIndex, int portIndex, int channel, int cla, int instruction, int p1, int p2, int p3, String data)674     String iccTransmitApduLogicalChannelByPort(int slotIndex, int portIndex, int channel, int cla, int instruction,
675             int p1, int p2, int p3, String data);
676 
677     /**
678      * Transmit an APDU to the ICC card over a logical channel.
679      *
680      * Input parameters equivalent to TS 27.007 AT+CGLA command.
681      *
682      * @param subId The subscription to use.
683      * @param channel is the channel id to be closed as returned by a
684      *            successful iccOpenLogicalChannel.
685      * @param cla Class of the APDU command.
686      * @param instruction Instruction of the APDU command.
687      * @param p1 P1 value of the APDU command.
688      * @param p2 P2 value of the APDU command.
689      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
690      *            is sent to the SIM.
691      * @param data Data to be sent with the APDU.
692      * @return The APDU response from the ICC card with the status appended at
693      *            the end.
694      */
695     @UnsupportedAppUsage(trackingBug = 171933273)
iccTransmitApduLogicalChannel(int subId, int channel, int cla, int instruction, int p1, int p2, int p3, String data)696     String iccTransmitApduLogicalChannel(int subId, int channel, int cla, int instruction,
697             int p1, int p2, int p3, String data);
698 
699     /**
700      * Transmit an APDU to the ICC card over the basic channel using the physical slot index and port index.
701      *
702      * Input parameters equivalent to TS 27.007 AT+CSIM command.
703      *
704      * @param slotIndex The physical slot index of the target ICC card
705      * @param portIndex The unique index referring to a port belonging to the SIM slot
706      * @param callingPackage the name of the package making the call.
707      * @param cla Class of the APDU command.
708      * @param instruction Instruction of the APDU command.
709      * @param p1 P1 value of the APDU command.
710      * @param p2 P2 value of the APDU command.
711      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
712      *            is sent to the SIM.
713      * @param data Data to be sent with the APDU.
714      * @return The APDU response from the ICC card with the status appended at
715      *            the end.
716      */
iccTransmitApduBasicChannelByPort(int slotIndex, int portIndex, String callingPackage, int cla, int instruction, int p1, int p2, int p3, String data)717     String iccTransmitApduBasicChannelByPort(int slotIndex, int portIndex, String callingPackage, int cla,
718             int instruction, int p1, int p2, int p3, String data);
719 
720     /**
721      * Transmit an APDU to the ICC card over the basic channel.
722      *
723      * Input parameters equivalent to TS 27.007 AT+CSIM command.
724      *
725      * @param subId The subscription to use.
726      * @param callingPackage the name of the package making the call.
727      * @param cla Class of the APDU command.
728      * @param instruction Instruction of the APDU command.
729      * @param p1 P1 value of the APDU command.
730      * @param p2 P2 value of the APDU command.
731      * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
732      *            is sent to the SIM.
733      * @param data Data to be sent with the APDU.
734      * @return The APDU response from the ICC card with the status appended at
735      *            the end.
736      */
iccTransmitApduBasicChannel(int subId, String callingPackage, int cla, int instruction, int p1, int p2, int p3, String data)737     String iccTransmitApduBasicChannel(int subId, String callingPackage, int cla, int instruction,
738             int p1, int p2, int p3, String data);
739 
740     /**
741      * Returns the response APDU for a command APDU sent through SIM_IO.
742      *
743      * @param subId The subscription to use.
744      * @param fileID
745      * @param command
746      * @param p1 P1 value of the APDU command.
747      * @param p2 P2 value of the APDU command.
748      * @param p3 P3 value of the APDU command.
749      * @param filePath
750      * @return The APDU response.
751      */
iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2, int p3, String filePath)752     byte[] iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2, int p3,
753             String filePath);
754 
755     /**
756      * Send ENVELOPE to the SIM and returns the response.
757      *
758      * @param subId The subscription to use.
759      * @param contents  String containing SAT/USAT response in hexadecimal
760      *                  format starting with command tag. See TS 102 223 for
761      *                  details.
762      * @return The APDU response from the ICC card, with the last 4 bytes
763      *         being the status word. If the command fails, returns an empty
764      *         string.
765      */
sendEnvelopeWithStatus(int subId, String content)766     String sendEnvelopeWithStatus(int subId, String content);
767 
768     /**
769      * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
770      * Used for device configuration by some CDMA operators.
771      *
772      * @param itemID the ID of the item to read.
773      * @return the NV item as a String, or null on any failure.
774      */
nvReadItem(int itemID)775     String nvReadItem(int itemID);
776 
777     /**
778      * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
779      * Used for device configuration by some CDMA operators.
780      *
781      * @param itemID the ID of the item to read.
782      * @param itemValue the value to write, as a String.
783      * @return true on success; false on any failure.
784      */
nvWriteItem(int itemID, String itemValue)785     boolean nvWriteItem(int itemID, String itemValue);
786 
787     /**
788      * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
789      * Used for device configuration by some CDMA operators.
790      *
791      * @param preferredRoamingList byte array containing the new PRL.
792      * @return true on success; false on any failure.
793      */
nvWriteCdmaPrl(in byte[] preferredRoamingList)794     boolean nvWriteCdmaPrl(in byte[] preferredRoamingList);
795 
796     /**
797      * Rollback modem configurations to factory default except some config which are in whitelist.
798      * Used for device configuration by some CDMA operators.
799      *
800      * <p>Requires Permission:
801      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
802      * app has carrier privileges (see {@link #hasCarrierPrivileges}).
803      *
804      * @param slotIndex - device slot.
805      * @return {@code true} on success; {@code false} on any failure.
806      */
resetModemConfig(int slotIndex)807     boolean resetModemConfig(int slotIndex);
808 
809     /**
810      * Generate a radio modem reset. Used for device configuration by some CDMA operators.
811      * Different than {@link #setRadioPower(boolean)}, modem reboot will power down sim card.
812      *
813      * <p>Requires Permission:
814      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
815      * app has carrier privileges (see {@link #hasCarrierPrivileges}).
816      *
817      * @param slotIndex - device slot.
818      * @return {@code true} on success; {@code false} on any failure.
819      */
rebootModem(int slotIndex)820     boolean rebootModem(int slotIndex);
821 
822     /*
823      * Get the allowed network type.
824      * Used for device configuration by some CDMA operators.
825      *
826      * @param subId the id of the subscription to query.
827      * @return the allowed network type bitmask, defined in RILConstants.java.
828      */
getAllowedNetworkTypesBitmask(int subId)829     int getAllowedNetworkTypesBitmask(int subId);
830 
831     /**
832      * Check whether DUN APN is required for tethering with subId.
833      *
834      * @param subId the id of the subscription to require tethering.
835      * @return {@code true} if DUN APN is required for tethering.
836      * @hide
837      */
isTetheringApnRequiredForSubscriber(int subId)838     boolean isTetheringApnRequiredForSubscriber(int subId);
839 
840     /**
841     * Enables framework IMS and triggers IMS Registration.
842     */
enableIms(int slotId)843     void enableIms(int slotId);
844 
845     /**
846     * Disables framework IMS and triggers IMS deregistration.
847     */
disableIms(int slotId)848     void disableIms(int slotId);
849 
850     /**
851     * Toggle framework IMS disables and enables.
852     */
resetIms(int slotIndex)853     void resetIms(int slotIndex);
854 
855     /**
856      *  Get IImsMmTelFeature binder from ImsResolver that corresponds to the subId and MMTel feature
857      *  as well as registering the MmTelFeature for callbacks using the IImsServiceFeatureCallback
858      *  interface.
859      */
registerMmTelFeatureCallback(int slotId, in IImsServiceFeatureCallback callback)860     void registerMmTelFeatureCallback(int slotId, in IImsServiceFeatureCallback callback);
861 
862     /**
863      * Unregister a callback that was previously registered through
864      * {@link #registerMmTelFeatureCallback}. This should always be called when the callback is no
865      * longer being used.
866      */
unregisterImsFeatureCallback(in IImsServiceFeatureCallback callback)867     void unregisterImsFeatureCallback(in IImsServiceFeatureCallback callback);
868 
869     /**
870     * Returns the IImsRegistration associated with the slot and feature specified.
871     */
getImsRegistration(int slotId, int feature)872     IImsRegistration getImsRegistration(int slotId, int feature);
873 
874     /**
875     * Returns the IImsConfig associated with the slot and feature specified.
876     */
getImsConfig(int slotId, int feature)877     IImsConfig getImsConfig(int slotId, int feature);
878 
879     /**
880     *  @return true if the ImsService to bind to for the slot id specified was set, false otherwise.
881     */
setBoundImsServiceOverride(int slotIndex, boolean isCarrierService, in int[] featureTypes, in String packageName)882     boolean setBoundImsServiceOverride(int slotIndex, boolean isCarrierService,
883             in int[] featureTypes, in String packageName);
884 
885     /**
886      *  @return true if the ImsService cleared any carrier ImsService overrides, false otherwise.
887      */
clearCarrierImsServiceOverride(int slotIndex)888     boolean clearCarrierImsServiceOverride(int slotIndex);
889 
890     /**
891     * @return the package name of the carrier/device ImsService associated with this slot.
892     */
getBoundImsServicePackage(int slotIndex, boolean isCarrierImsService, int featureType)893     String getBoundImsServicePackage(int slotIndex, boolean isCarrierImsService, int featureType);
894 
895     /**
896      * Get the MmTelFeature state attached to this subscription id.
897      */
getImsMmTelFeatureState(int subId, IIntegerConsumer callback)898     void getImsMmTelFeatureState(int subId, IIntegerConsumer callback);
899 
900     /**
901      * Set the network selection mode to automatic.
902      *
903      * @param subId the id of the subscription to update.
904      */
setNetworkSelectionModeAutomatic(int subId)905     void setNetworkSelectionModeAutomatic(int subId);
906 
907     /**
908      * Perform a radio scan and return the list of avialble networks.
909      *
910      * @param subId the id of the subscription.
911      * @param callingPackage the calling package
912      * @param callingFeatureId The feature in the package
913      * @return CellNetworkScanResult containing status of scan and networks.
914      */
getCellNetworkScanResults(int subId, String callingPackage, String callingFeatureId)915     CellNetworkScanResult getCellNetworkScanResults(int subId, String callingPackage,
916             String callingFeatureId);
917 
918     /**
919      * Perform a radio network scan and return the id of this scan.
920      *
921      * @param subId the id of the subscription.
922      * @param renounceFineLocationAccess Set this to true if the caller would not like to
923      * receive fine location related information
924      * @param request Defines all the configs for network scan.
925      * @param messenger Callback messages will be sent using this messenger.
926      * @param binder the binder object instantiated in TelephonyManager.
927      * @param callingPackage the calling package
928      * @param callingFeatureId The feature in the package
929      * @return An id for this scan.
930      */
requestNetworkScan(int subId, in boolean renounceFineLocationAccess, in NetworkScanRequest request, in Messenger messenger, in IBinder binder, in String callingPackage, String callingFeatureId)931     int requestNetworkScan(int subId, in boolean renounceFineLocationAccess,
932             in NetworkScanRequest request, in Messenger messenger, in IBinder binder,
933 	    in String callingPackage, String callingFeatureId);
934 
935     /**
936      * Stop an existing radio network scan.
937      *
938      * @param subId the id of the subscription.
939      * @param scanId The id of the scan that is going to be stopped.
940      */
stopNetworkScan(int subId, int scanId)941     void stopNetworkScan(int subId, int scanId);
942 
943     /**
944      * Ask the radio to connect to the input network and change selection mode to manual.
945      *
946      * @param subId the id of the subscription.
947      * @param operatorInfo the operator inforamtion, included the PLMN, long name and short name of
948      * the operator to attach to.
949      * @param persistSelection whether the selection will persist until reboot. If true, only allows
950      * attaching to the selected PLMN until reboot; otherwise, attach to the chosen PLMN and resume
951      * normal network selection next time.
952      * @return {@code true} on success; {@code true} on any failure.
953      */
setNetworkSelectionModeManual( int subId, in OperatorInfo operatorInfo, boolean persisSelection)954     boolean setNetworkSelectionModeManual(
955             int subId, in OperatorInfo operatorInfo, boolean persisSelection);
956 
957     /**
958      * Get the allowed network types for certain reason.
959      *
960      * @param subId the id of the subscription.
961      * @param reason the reason the allowed network type change is taking place
962      * @return allowedNetworkTypes the allowed network types.
963      */
getAllowedNetworkTypesForReason(int subId, int reason)964     long getAllowedNetworkTypesForReason(int subId, int reason);
965 
966     /**
967      * Set the allowed network types and provide the reason triggering the allowed network change.
968      *
969      * @param subId the id of the subscription.
970      * @param reason the reason the allowed network type change is taking place
971      * @param allowedNetworkTypes the allowed network types.
972      * @return true on success; false on any failure.
973      */
setAllowedNetworkTypesForReason(int subId, int reason, long allowedNetworkTypes)974     boolean setAllowedNetworkTypesForReason(int subId, int reason, long allowedNetworkTypes);
975 
976     /**
977      * Get the user enabled state of Mobile Data.
978      *
979      * TODO: remove and use isUserDataEnabled.
980      * This can't be removed now because some vendor codes
981      * calls through ITelephony directly while they should
982      * use TelephonyManager.
983      *
984      * @return true on enabled
985      */
986     @UnsupportedAppUsage
getDataEnabled(int subId)987     boolean getDataEnabled(int subId);
988 
989     /**
990      * Get the user enabled state of Mobile Data.
991      *
992      * @return true on enabled
993      */
isUserDataEnabled(int subId)994     boolean isUserDataEnabled(int subId);
995 
996     /**
997      * Check if data is enabled on the device. It can be disabled by
998      * user, carrier, policy or thermal.
999      * @return true on enabled
1000      */
isDataEnabled(int subId)1001     boolean isDataEnabled(int subId);
1002 
1003     /**
1004      * Control of data connection and provide the reason triggering the data connection control.
1005      *
1006      * @param subId user preferred subId.
1007      * @param reason the reason the data enable change is taking place
1008      * @param enable true to turn on, else false
1009      * @param callingPackage the package that changed the data enabled state
1010      */
setDataEnabledForReason(int subId, int reason, boolean enable, String callingPackage)1011      void setDataEnabledForReason(int subId, int reason, boolean enable, String callingPackage);
1012 
1013     /**
1014      * Return whether data is enabled for certain reason
1015      * @param subId user preferred subId.       .
1016      * @param reason the reason the data enable change is taking place
1017      * @return true on enabled
1018     */
isDataEnabledForReason(int subId, int reason)1019     boolean isDataEnabledForReason(int subId, int reason);
1020 
1021      /**
1022      * Checks if manual network selection is allowed.
1023      *
1024      * @return {@code true} if manual network selection is allowed, otherwise return {@code false}.
1025      */
isManualNetworkSelectionAllowed(int subId)1026      boolean isManualNetworkSelectionAllowed(int subId);
1027 
1028     /**
1029      * Set IMS registration state
1030      */
setImsRegistrationState(boolean registered)1031     void setImsRegistrationState(boolean registered);
1032 
1033     /**
1034      * Return MDN string for CDMA phone.
1035      * @param subId user preferred subId.
1036      */
getCdmaMdn(int subId)1037     String getCdmaMdn(int subId);
1038 
1039     /**
1040      * Return MIN string for CDMA phone.
1041      * @param subId user preferred subId.
1042      */
getCdmaMin(int subId)1043     String getCdmaMin(int subId);
1044 
1045     /**
1046      * Request that the next incoming call from a number matching {@code range} be intercepted.
1047      * @param range The range of phone numbers the caller expects a phone call from.
1048      * @param timeoutMillis The amount of time to wait for such a call, or
1049      *                      {@link #MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS}, whichever is lesser.
1050      * @param callback the callback aidl
1051      * @param callingPackage the calling package name.
1052      */
requestNumberVerification(in PhoneNumberRange range, long timeoutMillis, in INumberVerificationCallback callback, String callingPackage)1053     void requestNumberVerification(in PhoneNumberRange range, long timeoutMillis,
1054             in INumberVerificationCallback callback, String callingPackage);
1055 
1056     /**
1057      * Has the calling application been granted special privileges by the carrier.
1058      *
1059      * If any of the packages in the calling UID has carrier privileges, the
1060      * call will return true. This access is granted by the owner of the UICC
1061      * card and does not depend on the registered carrier.
1062      *
1063      * TODO: Add a link to documentation.
1064      *
1065      * @param subId The subscription to use.
1066      * @return carrier privilege status defined in TelephonyManager.
1067      */
getCarrierPrivilegeStatus(int subId)1068     int getCarrierPrivilegeStatus(int subId);
1069 
1070     /**
1071      * Similar to above, but check for the given uid.
1072      */
getCarrierPrivilegeStatusForUid(int subId, int uid)1073     int getCarrierPrivilegeStatusForUid(int subId, int uid);
1074 
1075     /**
1076      * Similar to above, but check for the package whose name is pkgName.
1077      * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
1078      */
checkCarrierPrivilegesForPackage(int subId, String pkgName)1079     int checkCarrierPrivilegesForPackage(int subId, String pkgName);
1080 
1081     /**
1082      * Similar to above, but check across all phones.
1083      * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
1084      */
checkCarrierPrivilegesForPackageAnyPhone(String pkgName)1085     int checkCarrierPrivilegesForPackageAnyPhone(String pkgName);
1086 
1087     /**
1088      * Returns list of the package names of the carrier apps that should handle the input intent
1089      * and have carrier privileges for the given phoneId.
1090      *
1091      * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
1092      *
1093      * @param intent Intent that will be sent.
1094      * @param phoneId The phoneId on which the carrier app has carrier privileges.
1095      * @return list of carrier app package names that can handle the intent on phoneId.
1096      *         Returns null if there is an error and an empty list if there
1097      *         are no matching packages.
1098      */
getCarrierPackageNamesForIntentAndPhone(in Intent intent, int phoneId)1099     List<String> getCarrierPackageNamesForIntentAndPhone(in Intent intent, int phoneId);
1100 
1101     /**
1102      * Set the line 1 phone number string and its alphatag for the current ICCID
1103      * for display purpose only, for example, displayed in Phone Status. It won't
1104      * change the actual MSISDN/MDN. To unset alphatag or number, pass in a null
1105      * value.
1106      *
1107      * @param subId the subscriber that the alphatag and dialing number belongs to.
1108      * @param alphaTag alpha-tagging of the dailing nubmer
1109      * @param number The dialing number
1110      * @return true if the operation was executed correctly.
1111      */
setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number)1112     boolean setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number);
1113 
1114     /**
1115      * Returns the displayed dialing number string if it was set previously via
1116      * {@link #setLine1NumberForDisplay}. Otherwise returns null.
1117      *
1118      * @param subId whose dialing number for line 1 is returned.
1119      * @param callingPackage The package making the call.
1120      * @param callingFeatureId The feature in the package.
1121      * @return the displayed dialing number if set, or null if not set.
1122      */
getLine1NumberForDisplay(int subId, String callingPackage, String callingFeatureId)1123     String getLine1NumberForDisplay(int subId, String callingPackage, String callingFeatureId);
1124 
1125     /**
1126      * Returns the displayed alphatag of the dialing number if it was set
1127      * previously via {@link #setLine1NumberForDisplay}. Otherwise returns null.
1128      *
1129      * @param subId whose alphatag associated with line 1 is returned.
1130      * @param callingPackage The package making the call.
1131      * @param callingFeatureId The feature in the package.
1132      * @return the displayed alphatag of the dialing number if set, or null if
1133      *         not set.
1134      */
getLine1AlphaTagForDisplay(int subId, String callingPackage, String callingFeatureId)1135     String getLine1AlphaTagForDisplay(int subId, String callingPackage, String callingFeatureId);
1136 
1137     /**
1138      * Return the set of subscriber IDs that should be considered "merged together" for data usage
1139      * purposes. This is commonly {@code null} to indicate no merging is required. Any returned
1140      * subscribers are sorted in a deterministic order.
1141      * <p>
1142      * The returned set of subscriber IDs will include the subscriber ID corresponding to this
1143      * TelephonyManager's subId.
1144      *
1145      * @hide
1146      */
getMergedSubscriberIds(int subId, String callingPackage, String callingFeatureId)1147     String[] getMergedSubscriberIds(int subId, String callingPackage, String callingFeatureId);
1148 
1149     /**
1150      * @hide
1151      */
getMergedImsisFromGroup(int subId, String callingPackage)1152     String[] getMergedImsisFromGroup(int subId, String callingPackage);
1153 
1154     /**
1155      * Override the operator branding for the current ICCID.
1156      *
1157      * Once set, whenever the SIM is present in the device, the service
1158      * provider name (SPN) and the operator name will both be replaced by the
1159      * brand value input. To unset the value, the same function should be
1160      * called with a null brand value.
1161      *
1162      * <p>Requires Permission:
1163      *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
1164      *  or has to be carrier app - see #hasCarrierPrivileges.
1165      *
1166      * @param subId The subscription to use.
1167      * @param brand The brand name to display/set.
1168      * @return true if the operation was executed correctly.
1169      */
setOperatorBrandOverride(int subId, String brand)1170     boolean setOperatorBrandOverride(int subId, String brand);
1171 
1172     /**
1173      * Override the roaming indicator for the current ICCID.
1174      *
1175      * Using this call, the carrier app (see #hasCarrierPrivileges) can override
1176      * the platform's notion of a network operator being considered roaming or not.
1177      * The change only affects the ICCID that was active when this call was made.
1178      *
1179      * If null is passed as any of the input, the corresponding value is deleted.
1180      *
1181      * <p>Requires that the caller have carrier privilege. See #hasCarrierPrivileges.
1182      *
1183      * @param subId for which the roaming overrides apply.
1184      * @param gsmRoamingList - List of MCCMNCs to be considered roaming for 3GPP RATs.
1185      * @param gsmNonRoamingList - List of MCCMNCs to be considered not roaming for 3GPP RATs.
1186      * @param cdmaRoamingList - List of SIDs to be considered roaming for 3GPP2 RATs.
1187      * @param cdmaNonRoamingList - List of SIDs to be considered not roaming for 3GPP2 RATs.
1188      * @return true if the operation was executed correctly.
1189      */
setRoamingOverride(int subId, in List<String> gsmRoamingList, in List<String> gsmNonRoamingList, in List<String> cdmaRoamingList, in List<String> cdmaNonRoamingList)1190     boolean setRoamingOverride(int subId, in List<String> gsmRoamingList,
1191             in List<String> gsmNonRoamingList, in List<String> cdmaRoamingList,
1192             in List<String> cdmaNonRoamingList);
1193 
1194     /**
1195      * Returns the result and response from RIL for oem request
1196      *
1197      * @param oemReq the data is sent to ril.
1198      * @param oemResp the respose data from RIL.
1199      * @return negative value request was not handled or get error
1200      *         0 request was handled succesfully, but no response data
1201      *         positive value success, data length of response
1202      */
invokeOemRilRequestRaw(in byte[] oemReq, out byte[] oemResp)1203     int invokeOemRilRequestRaw(in byte[] oemReq, out byte[] oemResp);
1204 
1205     /**
1206      * Check if any mobile Radios need to be shutdown.
1207      *
1208      * @return true is any mobile radio needs to be shutdown
1209      */
needMobileRadioShutdown()1210     boolean needMobileRadioShutdown();
1211 
1212     /**
1213      * Shutdown Mobile Radios
1214      */
shutdownMobileRadios()1215     void shutdownMobileRadios();
1216 
1217     /**
1218      * Get phone radio type and access technology.
1219      *
1220      * @param phoneId which phone you want to get
1221      * @param callingPackage the name of the package making the call
1222      * @return phone radio type and access technology
1223      */
getRadioAccessFamily(in int phoneId, String callingPackage)1224     int getRadioAccessFamily(in int phoneId, String callingPackage);
1225 
uploadCallComposerPicture(int subscriptionId, String callingPackage, String contentType, in ParcelFileDescriptor fd, in ResultReceiver callback)1226     void uploadCallComposerPicture(int subscriptionId, String callingPackage,
1227             String contentType, in ParcelFileDescriptor fd, in ResultReceiver callback);
1228 
1229     /**
1230      * Enables or disables video calling.
1231      *
1232      * @param enable Whether to enable video calling.
1233      */
enableVideoCalling(boolean enable)1234     void enableVideoCalling(boolean enable);
1235 
1236     /**
1237      * Whether video calling has been enabled by the user.
1238      *
1239      * @param callingPackage The package making the call.
1240      * @param callingFeatureId The feature in the package.
1241      * @return {@code true} if the user has enabled video calling, {@code false} otherwise.
1242      */
isVideoCallingEnabled(String callingPackage, String callingFeatureId)1243     boolean isVideoCallingEnabled(String callingPackage, String callingFeatureId);
1244 
1245     /**
1246      * Whether the DTMF tone length can be changed.
1247      *
1248      * @param subId The subscription to use.
1249      * @param callingPackage The package making the call.
1250      * @param callingFeatureId The feature in the package.
1251      * @return {@code true} if the DTMF tone length can be changed.
1252      */
canChangeDtmfToneLength(int subId, String callingPackage, String callingFeatureId)1253     boolean canChangeDtmfToneLength(int subId, String callingPackage, String callingFeatureId);
1254 
1255     /**
1256      * Whether the device is a world phone.
1257      *
1258      * @param callingPackage The package making the call.
1259      * @param callingFeatureId The feature in the package.
1260      * @return {@code true} if the devices is a world phone.
1261      */
isWorldPhone(int subId, String callingPackage, String callingFeatureId)1262     boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId);
1263 
1264     /**
1265      * Whether the phone supports TTY mode.
1266      *
1267      * @return {@code true} if the device supports TTY mode.
1268      */
isTtyModeSupported()1269     boolean isTtyModeSupported();
1270 
isRttSupported(int subscriptionId)1271     boolean isRttSupported(int subscriptionId);
1272 
1273     /**
1274      * Whether the phone supports hearing aid compatibility.
1275      *
1276      * @return {@code true} if the device supports hearing aid compatibility.
1277      */
isHearingAidCompatibilitySupported()1278     boolean isHearingAidCompatibilitySupported();
1279 
1280     /**
1281      * Get IMS Registration Status on a particular subid.
1282      *
1283      * @param subId user preferred subId.
1284      *
1285      * @return {@code true} if the IMS status is registered.
1286      */
isImsRegistered(int subId)1287     boolean isImsRegistered(int subId);
1288 
1289     /**
1290      * Returns the Status of Wi-Fi Calling for the subscription id specified.
1291      */
isWifiCallingAvailable(int subId)1292     boolean isWifiCallingAvailable(int subId);
1293 
1294      /**
1295      * Returns the Status of VT (video telephony) for the subscription ID specified.
1296      */
isVideoTelephonyAvailable(int subId)1297     boolean isVideoTelephonyAvailable(int subId);
1298 
1299     /**
1300     * Returns the MMTEL IMS registration technology for the subsciption ID specified.
1301     */
getImsRegTechnologyForMmTel(int subId)1302     int getImsRegTechnologyForMmTel(int subId);
1303 
1304     /** @deprecated Use {@link #getDeviceIdWithFeature(String, String) instead */
1305     @UnsupportedAppUsage
getDeviceId(String callingPackage)1306     String getDeviceId(String callingPackage);
1307 
1308     /**
1309       * Returns the unique device ID of phone, for example, the IMEI for
1310       * GSM and the MEID for CDMA phones. Return null if device ID is not available.
1311       *
1312       * @param callingPackage The package making the call.
1313       * @param callingFeatureId The feature in the package
1314       * <p>Requires Permission:
1315       *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1316       */
getDeviceIdWithFeature(String callingPackage, String callingFeatureId)1317     String getDeviceIdWithFeature(String callingPackage, String callingFeatureId);
1318 
1319     /**
1320      * Returns the IMEI for the given slot.
1321      *
1322      * @param slotIndex - device slot.
1323      * @param callingPackage The package making the call.
1324      * @param callingFeatureId The feature in the package
1325      * <p>Requires Permission:
1326      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1327      */
getImeiForSlot(int slotIndex, String callingPackage, String callingFeatureId)1328     String getImeiForSlot(int slotIndex, String callingPackage, String callingFeatureId);
1329 
1330     /**
1331      * Returns the primary IMEI of the device
1332      *
1333      * @param callingPackage The package name of the caller
1334      * @param callingFeatureId The feature Id of the calling package
1335      * @throws UnsupportedOperationException if the radio doesn't support this feature.
1336      * @throws SecurityException if the caller does not have the required permission/privileges
1337      */
getPrimaryImei(String callingPackage, String callingFeatureId)1338     String getPrimaryImei(String callingPackage, String callingFeatureId);
1339 
1340     /**
1341      * Returns the Type Allocation Code from the IMEI for the given slot.
1342      *
1343      * @param slotIndex - Which slot to retrieve the Type Allocation Code from.
1344      */
getTypeAllocationCodeForSlot(int slotIndex)1345     String getTypeAllocationCodeForSlot(int slotIndex);
1346 
1347     /**
1348      * Returns the MEID for the given slot.
1349      *
1350      * @param slotIndex - device slot.
1351      * @param callingPackage The package making the call.
1352      * @param callingFeatureId The feature in the package
1353      * <p>Requires Permission:
1354      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1355      */
getMeidForSlot(int slotIndex, String callingPackage, String callingFeatureId)1356     String getMeidForSlot(int slotIndex, String callingPackage, String callingFeatureId);
1357 
1358     /**
1359      * Returns the Manufacturer Code from the MEID for the given slot.
1360      *
1361      * @param slotIndex - Which slot to retrieve the Manufacturer Code from.
1362      */
getManufacturerCodeForSlot(int slotIndex)1363     String getManufacturerCodeForSlot(int slotIndex);
1364 
1365     /**
1366      * Returns the device software version.
1367      *
1368      * @param slotIndex - device slot.
1369      * @param callingPackage The package making the call.
1370      * @param callingFeatureId The feature in the package.
1371      * <p>Requires Permission:
1372      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1373      */
getDeviceSoftwareVersionForSlot(int slotIndex, String callingPackage, String callingFeatureId)1374     String getDeviceSoftwareVersionForSlot(int slotIndex, String callingPackage,
1375             String callingFeatureId);
1376 
1377     /**
1378      * Returns the subscription ID associated with the specified PhoneAccountHandle.
1379      */
getSubIdForPhoneAccountHandle(in PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId)1380     int getSubIdForPhoneAccountHandle(in PhoneAccountHandle phoneAccountHandle,
1381             String callingPackage, String callingFeatureId);
1382 
1383     /**
1384      * Returns the PhoneAccountHandle associated with a subscription ID.
1385      */
getPhoneAccountHandleForSubscriptionId(int subscriptionId)1386     PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId);
1387 
factoryReset(int subId, String callingPackage)1388     void factoryReset(int subId, String callingPackage);
1389 
1390     /**
1391      * Returns users's current locale based on the SIM.
1392      *
1393      * The returned string will be a well formed BCP-47 language tag, or {@code null}
1394      * if no locale could be derived.
1395      */
getSimLocaleForSubscriber(int subId)1396     String getSimLocaleForSubscriber(int subId);
1397 
1398     /**
1399      * Requests the modem activity info asynchronously.
1400      * The implementor is expected to reply with the
1401      * {@link android.telephony.ModemActivityInfo} object placed into the Bundle with the key
1402      * {@link android.telephony.TelephonyManager#MODEM_ACTIVITY_RESULT_KEY}.
1403      * The result code is ignored.
1404      */
requestModemActivityInfo(in ResultReceiver result)1405     oneway void requestModemActivityInfo(in ResultReceiver result);
1406 
1407     /**
1408      * Get the service state on specified subscription
1409      * @param subId Subscription id
1410      * @param renounceFineLocationAccess Set this to true if the caller would not like to
1411      * receive fine location related information
1412      * @param renounceCoarseLocationAccess Set this to true if the caller would not like to
1413      * receive coarse location related information
1414      * @param callingPackage The package making the call
1415      * @param callingFeatureId The feature in the package
1416      * @return Service state on specified subscription.
1417      */
getServiceStateForSubscriber(int subId, boolean renounceFineLocationAccess, boolean renounceCoarseLocationAccess, String callingPackage, String callingFeatureId)1418     ServiceState getServiceStateForSubscriber(int subId, boolean renounceFineLocationAccess,
1419             boolean renounceCoarseLocationAccess,
1420             String callingPackage, String callingFeatureId);
1421 
1422     /**
1423      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
1424      *
1425      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
1426      * voicemail ringtone.
1427      * @return The URI for the ringtone to play when receiving a voicemail from a specific
1428      * PhoneAccount.
1429      */
getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle)1430     Uri getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle);
1431 
1432     /**
1433      * Sets the per-account voicemail ringtone.
1434      *
1435      * <p>Requires that the calling app is the default dialer, or has carrier privileges, or
1436      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
1437      *
1438      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
1439      * voicemail ringtone.
1440      * @param uri The URI for the ringtone to play when receiving a voicemail from a specific
1441      * PhoneAccount.
1442      */
setVoicemailRingtoneUri(String callingPackage, in PhoneAccountHandle phoneAccountHandle, in Uri uri)1443     void setVoicemailRingtoneUri(String callingPackage,
1444             in PhoneAccountHandle phoneAccountHandle, in Uri uri);
1445 
1446     /**
1447      * Returns whether vibration is set for voicemail notification in Phone settings.
1448      *
1449      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
1450      * voicemail vibration setting.
1451      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
1452      */
isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle)1453     boolean isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle);
1454 
1455     /**
1456      * Sets the per-account preference whether vibration is enabled for voicemail notifications.
1457      *
1458      * <p>Requires that the calling app is the default dialer, or has carrier privileges, or
1459      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
1460      *
1461      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
1462      * voicemail vibration setting.
1463      * @param enabled Whether to enable or disable vibration for voicemail notifications from a
1464      * specific PhoneAccount.
1465      */
setVoicemailVibrationEnabled(String callingPackage, in PhoneAccountHandle phoneAccountHandle, boolean enabled)1466     void setVoicemailVibrationEnabled(String callingPackage,
1467             in PhoneAccountHandle phoneAccountHandle, boolean enabled);
1468 
1469     /**
1470      * Returns a list of packages that have carrier privileges for the specific phone.
1471      * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
1472      */
getPackagesWithCarrierPrivileges(int phoneId)1473     List<String> getPackagesWithCarrierPrivileges(int phoneId);
1474 
1475      /**
1476       * Returns a list of packages that have carrier privileges.
1477       * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
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 radio
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 radio.
1619      * @hide
1620      */
carrierActionSetRadioEnabled(int subId, boolean enabled)1621     void carrierActionSetRadioEnabled(int subId, boolean enabled);
1622 
1623     /**
1624      * Action set from carrier signalling broadcast receivers to start/stop reporting default
1625      * network conditions.
1626      * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
1627      * @param subId the subscription ID that this action applies to.
1628      * @param report control start/stop reporting default network events.
1629      * @hide
1630      */
carrierActionReportDefaultNetworkStatus(int subId, boolean report)1631     void carrierActionReportDefaultNetworkStatus(int subId, boolean report);
1632 
1633     /**
1634      * Action set from carrier signalling broadcast receivers to reset all carrier actions.
1635      * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
1636      * @param subId the subscription ID that this action applies to.
1637      * @hide
1638      */
carrierActionResetAll(int subId)1639     void carrierActionResetAll(int subId);
1640 
getCallForwarding(int subId, int callForwardingReason, ICallForwardingInfoCallback callback)1641     void getCallForwarding(int subId, int callForwardingReason,
1642             ICallForwardingInfoCallback callback);
1643 
setCallForwarding(int subId, in CallForwardingInfo callForwardingInfo, IIntegerConsumer callback)1644     void setCallForwarding(int subId, in CallForwardingInfo callForwardingInfo,
1645             IIntegerConsumer callback);
1646 
getCallWaitingStatus(int subId, IIntegerConsumer callback)1647     void getCallWaitingStatus(int subId, IIntegerConsumer callback);
1648 
setCallWaitingStatus(int subId, boolean enabled, IIntegerConsumer callback)1649     void setCallWaitingStatus(int subId, boolean enabled, IIntegerConsumer callback);
1650 
1651     /**
1652      * Get Client request stats which will contain statistical information
1653      * on each request made by client.
1654      * @param callingPackage package making the call.
1655      * @param callingFeatureId The feature in the package.
1656      * @param subId Subscription index
1657      * @hide
1658      */
getClientRequestStats(String callingPackage, String callingFeatureId, int subid)1659     List<ClientRequestStats> getClientRequestStats(String callingPackage, String callingFeatureId,
1660             int subid);
1661 
1662     /**
1663      * Set SIM card power state.
1664      * @param slotIndex SIM slot id
1665      * @param state  State of SIM (power down, power up, pass through)
1666      * @hide
1667      */
setSimPowerStateForSlot(int slotIndex, int state)1668     void setSimPowerStateForSlot(int slotIndex, int state);
1669 
1670     /**
1671      * Set SIM card power state.
1672      * @param slotIndex SIM slot id
1673      * @param state  State of SIM (power down, power up, pass through)
1674      * @param callback callback to receive result info
1675      * @hide
1676      */
setSimPowerStateForSlotWithCallback(int slotIndex, int state, IIntegerConsumer callback)1677     void setSimPowerStateForSlotWithCallback(int slotIndex, int state, IIntegerConsumer callback);
1678 
1679     /**
1680      * Returns a list of Forbidden PLMNs from the specified SIM App
1681      * Returns null if the query fails.
1682      *
1683      * <p>Requires that the calling app has READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE
1684      *
1685      * @param subId subscription ID used for authentication
1686      * @param appType the icc application type, like {@link #APPTYPE_USIM}
1687      */
getForbiddenPlmns(int subId, int appType, String callingPackage, String callingFeatureId)1688     String[] getForbiddenPlmns(int subId, int appType, String callingPackage,
1689              String callingFeatureId);
1690 
1691     /**
1692      * Set the forbidden PLMN list from the givven app type (ex APPTYPE_USIM) on a particular
1693      * subscription.
1694      *
1695      * @param subId subId the id of the subscription
1696      * @param appType appType the uicc app type, must be USIM or SIM.
1697      * @param fplmns plmns the Forbiden plmns list that needed to be written to the SIM.
1698      * @param callingPackage the op Package name.
1699      * @param callingFeatureId the feature in the package.
1700      * @return number of fplmns that is successfully written to the SIM
1701      */
setForbiddenPlmns(int subId, int appType, in List<String> fplmns, String callingPackage, String callingFeatureId)1702     int setForbiddenPlmns(int subId, int appType, in List<String> fplmns, String callingPackage,
1703             String callingFeatureId);
1704 
1705     /**
1706      * Check if phone is in emergency callback mode
1707      * @return true if phone is in emergency callback mode
1708      * @param subId the subscription ID that this action applies to.
1709      * @hide
1710      */
getEmergencyCallbackMode(int subId)1711     boolean getEmergencyCallbackMode(int subId);
1712 
1713     /**
1714      * Get the most recently available signal strength information.
1715      *
1716      * Get the most recent SignalStrength information reported by the modem. Due
1717      * to power saving this information may not always be current.
1718      * @param subId Subscription index
1719      * @return the most recent cached signal strength info from the modem
1720      * @hide
1721      */
getSignalStrength(int subId)1722     SignalStrength getSignalStrength(int subId);
1723 
1724     /**
1725      * Get the card ID of the default eUICC card. If there is no eUICC, returns
1726      * {@link #INVALID_CARD_ID}.
1727      *
1728      * @param subId subscription ID used for authentication
1729      * @param callingPackage package making the call
1730      * @return card ID of the default eUICC card.
1731      */
getCardIdForDefaultEuicc(int subId, String callingPackage)1732     int getCardIdForDefaultEuicc(int subId, String callingPackage);
1733 
1734     /**
1735      * Gets information about currently inserted UICCs and eUICCs.
1736      * <p>
1737      * Requires that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
1738      * <p>
1739      * If the caller has carrier priviliges on any active subscription, then they have permission to
1740      * get simple information like the card ID ({@link UiccCardInfo#getCardId()}), whether the card
1741      * is an eUICC ({@link UiccCardInfo#isEuicc()}), and the slot index where the card is inserted
1742      * ({@link UiccCardInfo#getSlotIndex()}).
1743      * <p>
1744      * To get private information such as the EID ({@link UiccCardInfo#getEid()}) or ICCID
1745      * ({@link UiccCardInfo#getIccId()}), the caller must have carrier priviliges on that specific
1746      * UICC or eUICC card.
1747      * <p>
1748      * See {@link UiccCardInfo} for more details on the kind of information available.
1749      *
1750      * @param callingPackage package making the call, used to evaluate carrier privileges
1751      * @return a list of UiccCardInfo objects, representing information on the currently inserted
1752      * UICCs and eUICCs. Each UiccCardInfo in the list will have private information filtered out if
1753      * the caller does not have adequate permissions for that card.
1754      */
getUiccCardsInfo(String callingPackage)1755     List<UiccCardInfo> getUiccCardsInfo(String callingPackage);
1756 
1757     /**
1758      * Get slot info for all the UICC slots.
1759      * @return UiccSlotInfo array.
1760      * @hide
1761      */
getUiccSlotsInfo(String callingPackage)1762     UiccSlotInfo[] getUiccSlotsInfo(String callingPackage);
1763 
1764     /**
1765      * Map logicalSlot to physicalSlot, and activate the physicalSlot if it is inactive.
1766      * @param physicalSlots Index i in the array representing physical slot for phone i. The array
1767      *        size should be same as getPhoneCount().
1768      * @deprecated Use {@link #setSimSlotMapping(in List<UiccSlotMapping> slotMapping)} instead.
1769      * @return boolean Return true if the switch succeeds, false if the switch fails.
1770      */
switchSlots(in int[] physicalSlots)1771     boolean switchSlots(in int[] physicalSlots);
1772 
1773     /**
1774      * Maps the logical slots to the SlotPortMapping which consist of both physical slot index and
1775      * port index. Logical slot is the slot that is seen by modem. Physical slot is the actual
1776      * physical slot. Port index is the index (enumerated value) for the associated port available
1777      * on the SIM. Each physical slot can have multiple ports which enables multi-enabled profile
1778      * (MEP). If eUICC physical slot supports 2 ports, then the port index is numbered 0,1 and if
1779      * eUICC2 supports 4 ports then the port index is numbered 0,1,2,3. Each portId is unique within
1780      * a UICC physical slot but not necessarily unique across UICC’s. SEP(Single enabled profile)
1781      * eUICC and non-eUICC will only have port Index 0.
1782      *
1783      * Logical slots that are already mapped to the requested SlotPortMapping are not impacted.
1784      * @param slotMapping Index i in the list representing slot mapping for phone i.
1785      *
1786      * @return {@code true} if the switch succeeds, {@code false} if the switch fails.
1787      */
setSimSlotMapping(in List<UiccSlotMapping> slotMapping)1788     boolean setSimSlotMapping(in List<UiccSlotMapping> slotMapping);
1789 
1790     /**
1791      * Returns whether mobile data roaming is enabled on the subscription with id {@code subId}.
1792      *
1793      * @param subId the subscription id
1794      * @return {@code true} if the data roaming is enabled on this subscription.
1795      */
isDataRoamingEnabled(int subId)1796     boolean isDataRoamingEnabled(int subId);
1797 
1798     /**
1799      * Enables/Disables the data roaming on the subscription with id {@code subId}.
1800      *
1801      * @param subId the subscription id
1802      * @param isEnabled {@code true} to enable mobile data roaming, otherwise disable it.
1803      */
setDataRoamingEnabled(int subId, boolean isEnabled)1804     void setDataRoamingEnabled(int subId, boolean isEnabled);
1805 
1806     /**
1807      * Gets the roaming mode for the CDMA phone with the subscription id {@code subId}.
1808      *
1809      * @param the subscription id.
1810      * @return the roaming mode for CDMA phone.
1811      */
getCdmaRoamingMode(int subId)1812     int getCdmaRoamingMode(int subId);
1813 
1814     /**
1815      * Sets the roaming mode on the CDMA phone with the subscription {@code subId} to the given
1816      * roaming mode {@code mode}.
1817      *
1818      * @param subId the subscription id.
1819      * @param mode the roaming mode should be set.
1820      * @return {@code true} if successed.
1821      */
setCdmaRoamingMode(int subId, int mode)1822     boolean setCdmaRoamingMode(int subId, int mode);
1823 
1824     /**
1825      * Gets the subscription mode for the CDMA phone with the subscription id {@code subId}.
1826      *
1827      * @param the subscription id.
1828      * @return the subscription mode for CDMA phone.
1829      */
getCdmaSubscriptionMode(int subId)1830     int getCdmaSubscriptionMode(int subId);
1831 
1832     /**
1833      * Sets the subscription mode for CDMA phone with the subscription {@code subId} to the given
1834      * subscription mode {@code mode}.
1835      *
1836      * @param subId the subscription id.
1837      * @param mode the subscription mode should be set.
1838      * @return {@code true} if successed.
1839      */
setCdmaSubscriptionMode(int subId, int mode)1840     boolean setCdmaSubscriptionMode(int subId, int mode);
1841 
1842     /**
1843      * A test API to override carrier information including mccmnc, imsi, iccid, gid1, gid2,
1844      * plmn and spn. This would be handy for, eg, forcing a particular carrier id, carrier's config
1845      * (also any country or carrier overlays) to be loaded when using a test SIM with a call box.
1846      */
setCarrierTestOverride(int subId, String mccmnc, String imsi, String iccid, String gid1, String gid2, String plmn, String spn, String carrierPrivilegeRules, String apn)1847     void setCarrierTestOverride(int subId, String mccmnc, String imsi, String iccid, String gid1,
1848             String gid2, String plmn, String spn, String carrierPrivilegeRules, String apn);
1849 
1850     /**
1851      * Forcibly sets a package as a carrier provisioning package.
1852      *
1853      * This override is ephemeral, and will disappear upon phone process restart (including
1854      * device reboot).
1855      *
1856      * WARNING: This API is meant for testing purposes only. This enables automated testing for
1857      * cases where the carrier service package is used as a permissioning gate for features such as
1858      * restricted carrier network access (restricted APNs and Merged Carrier Wifi)
1859      *
1860      * @param carrierServicePackage The package that should be marked as the carrier service
1861      *     package, or {@code null} to disable the override.
1862      */
setCarrierServicePackageOverride(int subId, String carrierServicePackage, String callingPackage)1863     void setCarrierServicePackageOverride(int subId, String carrierServicePackage,
1864                 String callingPackage);
1865 
1866     /**
1867      * A test API to return installed carrier id list version.
1868      */
getCarrierIdListVersion(int subId)1869     int getCarrierIdListVersion(int subId);
1870 
1871     /**
1872      * A test API to reload the UICC profile.
1873      * @hide
1874      */
refreshUiccProfile(int subId)1875     void refreshUiccProfile(int subId);
1876 
1877     /**
1878      * How many modems can have simultaneous data connections.
1879      * @hide
1880      */
getNumberOfModemsWithSimultaneousDataConnections(int subId, String callingPackage, String callingFeatureId)1881     int getNumberOfModemsWithSimultaneousDataConnections(int subId, String callingPackage,
1882             String callingFeatureId);
1883 
1884     /**
1885      * Return the network selection mode on the subscription with id {@code subId}.
1886      */
getNetworkSelectionMode(int subId)1887      int getNetworkSelectionMode(int subId);
1888 
1889      /**
1890      * Return true if the device is in emergency sms mode, false otherwise.
1891      */
isInEmergencySmsMode()1892      boolean isInEmergencySmsMode();
1893 
1894     /**
1895      * Return the modem radio power state for slot index.
1896      *
1897      */
getRadioPowerState(int slotIndex, String callingPackage, String callingFeatureId)1898     int getRadioPowerState(int slotIndex, String callingPackage, String callingFeatureId);
1899 
1900     // IMS specific AIDL commands, see ImsMmTelManager.java
1901 
1902     /**
1903      * Adds an IMS registration status callback for the subscription id specified.
1904      */
registerImsRegistrationCallback(int subId, IImsRegistrationCallback c)1905     void registerImsRegistrationCallback(int subId, IImsRegistrationCallback c);
1906      /**
1907       * Removes an existing IMS registration status callback for the subscription specified.
1908       */
unregisterImsRegistrationCallback(int subId, IImsRegistrationCallback c)1909     void unregisterImsRegistrationCallback(int subId, IImsRegistrationCallback c);
1910 
1911     /**
1912      * Get the IMS service registration state for the MmTelFeature associated with this sub id.
1913      */
getImsMmTelRegistrationState(int subId, IIntegerConsumer consumer)1914     void getImsMmTelRegistrationState(int subId, IIntegerConsumer consumer);
1915 
1916     /**
1917      * Get the transport type for the IMS service registration state.
1918      */
getImsMmTelRegistrationTransportType(int subId, IIntegerConsumer consumer)1919     void getImsMmTelRegistrationTransportType(int subId, IIntegerConsumer consumer);
1920 
1921     /**
1922      * Adds an IMS MmTel capabilities callback for the subscription specified.
1923      */
registerMmTelCapabilityCallback(int subId, IImsCapabilityCallback c)1924     void registerMmTelCapabilityCallback(int subId, IImsCapabilityCallback c);
1925 
1926     /**
1927      * Removes an existing IMS MmTel capabilities callback for the subscription specified.
1928      */
unregisterMmTelCapabilityCallback(int subId, IImsCapabilityCallback c)1929     void unregisterMmTelCapabilityCallback(int subId, IImsCapabilityCallback c);
1930 
1931     /**
1932      * return true if the IMS MmTel capability for the given registration tech is capable.
1933      */
isCapable(int subId, int capability, int regTech)1934     boolean isCapable(int subId, int capability, int regTech);
1935 
1936     /**
1937      * return true if the IMS MmTel capability for the given registration tech is available.
1938      */
isAvailable(int subId, int capability, int regTech)1939     boolean isAvailable(int subId, int capability, int regTech);
1940 
1941     /**
1942      * Return whether or not the MmTel capability is supported for the requested transport type.
1943      */
isMmTelCapabilitySupported(int subId, IIntegerConsumer callback, int capability, int transportType)1944     void isMmTelCapabilitySupported(int subId, IIntegerConsumer callback, int capability,
1945             int transportType);
1946 
1947     /**
1948      * Returns true if the user's setting for 4G LTE is enabled, for the subscription specified.
1949      */
isAdvancedCallingSettingEnabled(int subId)1950     boolean isAdvancedCallingSettingEnabled(int subId);
1951 
1952     /**
1953      * Modify the user's setting for whether or not 4G LTE is enabled.
1954      */
setAdvancedCallingSettingEnabled(int subId, boolean isEnabled)1955     void setAdvancedCallingSettingEnabled(int subId, boolean isEnabled);
1956 
1957     /**
1958      * return true if the user's setting for VT is enabled for the subscription.
1959      */
isVtSettingEnabled(int subId)1960     boolean isVtSettingEnabled(int subId);
1961 
1962     /**
1963      * Modify the user's setting for whether or not VT is available for the subscrption specified.
1964      */
setVtSettingEnabled(int subId, boolean isEnabled)1965     void setVtSettingEnabled(int subId, boolean isEnabled);
1966 
1967     /**
1968      * return true if the user's setting for whether or not Voice over WiFi is currently enabled.
1969      */
isVoWiFiSettingEnabled(int subId)1970     boolean isVoWiFiSettingEnabled(int subId);
1971 
1972     /**
1973      * sets the user's setting for Voice over WiFi enabled state.
1974      */
setVoWiFiSettingEnabled(int subId, boolean isEnabled)1975     void setVoWiFiSettingEnabled(int subId, boolean isEnabled);
1976 
1977     /**
1978      * return true if the user's setting for Voice over Cross SIM is enabled and false if it is not
1979      */
isCrossSimCallingEnabledByUser(int subId)1980     boolean isCrossSimCallingEnabledByUser(int subId);
1981 
1982     /**
1983      * Sets the user's setting for whether or not Voice over Cross SIM is enabled.
1984      */
setCrossSimCallingEnabled(int subId, boolean isEnabled)1985     void setCrossSimCallingEnabled(int subId, boolean isEnabled);
1986 
1987     /**
1988      * return true if the user's setting for Voice over WiFi while roaming is enabled.
1989      */
isVoWiFiRoamingSettingEnabled(int subId)1990     boolean isVoWiFiRoamingSettingEnabled(int subId);
1991 
1992     /**
1993      * Sets the user's preference for whether or not Voice over WiFi is enabled for the current
1994      * subscription while roaming.
1995      */
setVoWiFiRoamingSettingEnabled(int subId, boolean isEnabled)1996     void setVoWiFiRoamingSettingEnabled(int subId, boolean isEnabled);
1997 
1998     /**
1999      * Set the Voice over WiFi enabled state, but do not persist the setting.
2000      */
setVoWiFiNonPersistent(int subId, boolean isCapable, int mode)2001     void setVoWiFiNonPersistent(int subId, boolean isCapable, int mode);
2002 
2003     /**
2004      * return the Voice over WiFi mode preference set by the user for the subscription specified.
2005      */
getVoWiFiModeSetting(int subId)2006     int getVoWiFiModeSetting(int subId);
2007 
2008     /**
2009      * sets the user's preference for the Voice over WiFi mode for the subscription specified.
2010      */
setVoWiFiModeSetting(int subId, int mode)2011     void setVoWiFiModeSetting(int subId, int mode);
2012 
2013     /**
2014      * return the Voice over WiFi mode preference set by the user for the subscription specified
2015      * while roaming.
2016      */
getVoWiFiRoamingModeSetting(int subId)2017     int getVoWiFiRoamingModeSetting(int subId);
2018 
2019     /**
2020      * sets the user's preference for the Voice over WiFi mode for the subscription specified
2021      * while roaming.
2022      */
setVoWiFiRoamingModeSetting(int subId, int mode)2023     void setVoWiFiRoamingModeSetting(int subId, int mode);
2024 
2025     /**
2026      * Modify the user's setting for whether or not RTT is enabled for the subscrption specified.
2027      */
setRttCapabilitySetting(int subId, boolean isEnabled)2028     void setRttCapabilitySetting(int subId, boolean isEnabled);
2029 
2030     /**
2031      * return true if TTY over VoLTE is enabled for the subscription specified.
2032      */
isTtyOverVolteEnabled(int subId)2033     boolean isTtyOverVolteEnabled(int subId);
2034 
2035     /**
2036      * Return the emergency number list from all the active subscriptions.
2037      */
2038     @SuppressWarnings(value={"untyped-collection"})
getEmergencyNumberList(String callingPackage, String callingFeatureId)2039     Map getEmergencyNumberList(String callingPackage, String callingFeatureId);
2040 
2041     /**
2042      * Identify if the number is emergency number, based on all the active subscriptions.
2043      */
isEmergencyNumber(String number, boolean exactMatch)2044     boolean isEmergencyNumber(String number, boolean exactMatch);
2045 
2046     /**
2047      * Return a list of certs in hex string from loaded carrier privileges access rules.
2048      */
getCertsFromCarrierPrivilegeAccessRules(int subId)2049     List<String> getCertsFromCarrierPrivilegeAccessRules(int subId);
2050 
2051     /**
2052      * Register an IMS provisioning change callback with Telephony.
2053      */
registerImsProvisioningChangedCallback(int subId, IImsConfigCallback callback)2054     void registerImsProvisioningChangedCallback(int subId, IImsConfigCallback callback);
2055 
2056     /**
2057      * unregister an existing IMS provisioning change callback.
2058      */
unregisterImsProvisioningChangedCallback(int subId, IImsConfigCallback callback)2059     void unregisterImsProvisioningChangedCallback(int subId, IImsConfigCallback callback);
2060 
2061     /**
2062      * Register an IMS provisioning change callback with Telephony.
2063      */
registerFeatureProvisioningChangedCallback(int subId, IFeatureProvisioningCallback callback)2064     void registerFeatureProvisioningChangedCallback(int subId,
2065             IFeatureProvisioningCallback callback);
2066 
2067     /**
2068      * unregister an existing IMS provisioning change callback.
2069      */
unregisterFeatureProvisioningChangedCallback(int subId, IFeatureProvisioningCallback callback)2070     void unregisterFeatureProvisioningChangedCallback(int subId,
2071             IFeatureProvisioningCallback callback);
2072 
2073     /**
2074      * Set the provisioning status for the IMS MmTel capability using the specified subscription.
2075      */
setImsProvisioningStatusForCapability(int subId, int capability, int tech, boolean isProvisioned)2076     void setImsProvisioningStatusForCapability(int subId, int capability, int tech,
2077             boolean isProvisioned);
2078 
2079     /**
2080      * Get the provisioning status for the IMS MmTel capability specified.
2081      */
getImsProvisioningStatusForCapability(int subId, int capability, int tech)2082     boolean getImsProvisioningStatusForCapability(int subId, int capability, int tech);
2083 
2084     /**
2085      * Get the provisioning status for the IMS Rcs capability specified.
2086      */
getRcsProvisioningStatusForCapability(int subId, int capability, int tech)2087     boolean getRcsProvisioningStatusForCapability(int subId, int capability, int tech);
2088 
2089     /**
2090      * Set the provisioning status for the IMS Rcs capability using the specified subscription.
2091      */
setRcsProvisioningStatusForCapability(int subId, int capability, int tech, boolean isProvisioned)2092     void setRcsProvisioningStatusForCapability(int subId, int capability, int tech,
2093             boolean isProvisioned);
2094 
2095     /**
2096      * Return an integer containing the provisioning value for the specified provisioning key.
2097      */
getImsProvisioningInt(int subId, int key)2098     int getImsProvisioningInt(int subId, int key);
2099 
2100     /**
2101      * return a String containing the provisioning value for the provisioning key specified.
2102      */
getImsProvisioningString(int subId, int key)2103     String getImsProvisioningString(int subId, int key);
2104 
2105     /**
2106      * Set the integer provisioning value for the provisioning key specified.
2107      */
setImsProvisioningInt(int subId, int key, int value)2108     int setImsProvisioningInt(int subId, int key, int value);
2109 
2110     /**
2111      * Set the String provisioning value for the provisioning key specified.
2112      */
setImsProvisioningString(int subId, int key, String value)2113     int setImsProvisioningString(int subId, int key, String value);
2114 
2115     /**
2116      * Start emergency callback mode for testing.
2117      */
startEmergencyCallbackMode()2118     void startEmergencyCallbackMode();
2119 
2120     /**
2121      * Update Emergency Number List for Test Mode.
2122      */
updateEmergencyNumberListTestMode(int action, in EmergencyNumber num)2123     void updateEmergencyNumberListTestMode(int action, in EmergencyNumber num);
2124 
2125     /**
2126      * Get the full emergency number list for Test Mode.
2127      */
getEmergencyNumberListTestMode()2128     List<String> getEmergencyNumberListTestMode();
2129 
2130     /**
2131      * A test API to return the emergency number db version.
2132      */
getEmergencyNumberDbVersion(int subId)2133     int getEmergencyNumberDbVersion(int subId);
2134 
2135     /**
2136      * Notify Telephony for OTA emergency number database installation complete.
2137      */
notifyOtaEmergencyNumberDbInstalled()2138     void notifyOtaEmergencyNumberDbInstalled();
2139 
2140     /**
2141      * Override a customized file partition name for OTA emergency number database.
2142      */
updateOtaEmergencyNumberDbFilePath(in ParcelFileDescriptor otaParcelFileDescriptor)2143     void updateOtaEmergencyNumberDbFilePath(in ParcelFileDescriptor otaParcelFileDescriptor);
2144 
2145     /**
2146      * Reset file partition to default for OTA emergency number database.
2147      */
resetOtaEmergencyNumberDbFilePath()2148     void resetOtaEmergencyNumberDbFilePath();
2149 
2150     /**
2151      * Enable or disable a logical modem stack associated with the slotIndex.
2152      */
enableModemForSlot(int slotIndex, boolean enable)2153     boolean enableModemForSlot(int slotIndex, boolean enable);
2154 
2155     /**
2156      * Indicate if the enablement of multi SIM functionality is restricted.
2157      * @hide
2158      */
setMultiSimCarrierRestriction(boolean isMultiSimCarrierRestricted)2159     void setMultiSimCarrierRestriction(boolean isMultiSimCarrierRestricted);
2160 
2161     /**
2162      * Returns if the usage of multiple SIM cards at the same time is supported.
2163      *
2164      * @param callingPackage The package making the call.
2165      * @param callingFeatureId The feature in the package.
2166      * @return {@link #MULTISIM_ALLOWED} if the device supports multiple SIMs.
2167      * {@link #MULTISIM_NOT_SUPPORTED_BY_HARDWARE} if the device does not support multiple SIMs.
2168      * {@link #MULTISIM_NOT_SUPPORTED_BY_CARRIER} in the device supports multiple SIMs, but the
2169      * functionality is restricted by the carrier.
2170      */
isMultiSimSupported(String callingPackage, String callingFeatureId)2171     int isMultiSimSupported(String callingPackage, String callingFeatureId);
2172 
2173     /**
2174      * Switch configs to enable multi-sim or switch back to single-sim
2175      * @hide
2176      */
switchMultiSimConfig(int numOfSims)2177     void switchMultiSimConfig(int numOfSims);
2178 
2179     /**
2180      * Get if altering modems configurations will trigger reboot.
2181      * @hide
2182      */
doesSwitchMultiSimConfigTriggerReboot(int subId, String callingPackage, String callingFeatureId)2183     boolean doesSwitchMultiSimConfigTriggerReboot(int subId, String callingPackage,
2184              String callingFeatureId);
2185 
2186     /**
2187      * Get the mapping from logical slots to port index.
2188      */
getSlotsMapping(String callingPackage)2189     List<UiccSlotMapping> getSlotsMapping(String callingPackage);
2190 
2191     /**
2192      * Get the IRadio HAL Version encoded as 100 * MAJOR_VERSION + MINOR_VERSION or -1 if unknown
2193      */
getRadioHalVersion()2194     int getRadioHalVersion();
2195 
2196     /**
2197      * Get the HAL Version of a specific service
2198      * encoded as 100 * MAJOR_VERSION + MINOR_VERSION or -1 if unknown
2199      */
getHalVersion(int service)2200     int getHalVersion(int service);
2201 
2202     /**
2203      * Get the current calling package name.
2204      */
getCurrentPackageName()2205     String getCurrentPackageName();
2206 
2207     /**
2208      * Returns true if the specified type of application (e.g. {@link #APPTYPE_CSIM} is present
2209      * on the UICC card.
2210      * @hide
2211      */
isApplicationOnUicc(int subId, int appType)2212     boolean isApplicationOnUicc(int subId, int appType);
2213 
isModemEnabledForSlot(int slotIndex, String callingPackage, String callingFeatureId)2214     boolean isModemEnabledForSlot(int slotIndex, String callingPackage, String callingFeatureId);
2215 
isDataEnabledForApn(int apnType, int subId, String callingPackage)2216     boolean isDataEnabledForApn(int apnType, int subId, String callingPackage);
2217 
isApnMetered(int apnType, int subId)2218     boolean isApnMetered(int apnType, int subId);
2219 
setSystemSelectionChannels(in List<RadioAccessSpecifier> specifiers, int subId, IBooleanConsumer resultCallback)2220     oneway void setSystemSelectionChannels(in List<RadioAccessSpecifier> specifiers,
2221             int subId, IBooleanConsumer resultCallback);
2222 
getSystemSelectionChannels(int subId)2223     List<RadioAccessSpecifier> getSystemSelectionChannels(int subId);
2224 
isMvnoMatched(int slotIndex, int mvnoType, String mvnoMatchData)2225     boolean isMvnoMatched(int slotIndex, 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      * Show error dialog to switch to managed profile.
2236      */
showSwitchToManagedProfileDialog()2237     oneway void showSwitchToManagedProfileDialog();
2238 
2239     /**
2240      * Returns the MMS user agent.
2241      */
getMmsUserAgent(int subId)2242     String getMmsUserAgent(int subId);
2243 
2244     /**
2245      * Returns the MMS user agent profile URL.
2246      */
getMmsUAProfUrl(int subId)2247     String getMmsUAProfUrl(int subId);
2248 
setMobileDataPolicyEnabled(int subscriptionId, int policy, boolean enabled)2249     void setMobileDataPolicyEnabled(int subscriptionId, int policy, boolean enabled);
2250 
isMobileDataPolicyEnabled(int subscriptionId, int policy)2251     boolean isMobileDataPolicyEnabled(int subscriptionId, int policy);
2252 
2253     /**
2254      * Command line command to enable or disable handling of CEP data for test purposes.
2255      */
setCepEnabled(boolean isCepEnabled)2256     oneway void setCepEnabled(boolean isCepEnabled);
2257 
2258     /**
2259      * Notify Rcs auto config received.
2260      */
notifyRcsAutoConfigurationReceived(int subId, in byte[] config, boolean isCompressed)2261     void notifyRcsAutoConfigurationReceived(int subId, in byte[] config, boolean isCompressed);
2262 
isIccLockEnabled(int subId)2263     boolean isIccLockEnabled(int subId);
2264 
setIccLockEnabled(int subId, boolean enabled, String password)2265     int setIccLockEnabled(int subId, boolean enabled, String password);
2266 
changeIccLockPassword(int subId, String oldPassword, String newPassword)2267     int changeIccLockPassword(int subId, String oldPassword, String newPassword);
2268 
2269     /**
2270      * Request for receiving user activity notification
2271      */
requestUserActivityNotification()2272     oneway void requestUserActivityNotification();
2273 
2274     /**
2275      * Called when userActivity is signalled in the power manager.
2276      * This is safe to call from any thread, with any window manager locks held or not.
2277      */
userActivity()2278     oneway void userActivity();
2279 
2280     /**
2281      * Get the user manual network selection.
2282      * Return null if inactive or phone process is down.
2283      *
2284      * @param subId the id of the subscription
2285      * @return operatorinfo on success
2286      */
getManualNetworkSelectionPlmn(int subId)2287     String getManualNetworkSelectionPlmn(int subId);
2288 
2289     /**
2290      * Whether device can connect to 5G network when two SIMs are active.
2291      */
canConnectTo5GInDsdsMode()2292     boolean canConnectTo5GInDsdsMode();
2293 
2294     /**
2295      * Returns a list of the equivalent home PLMNs (EF_EHPLMN) from the USIM app.
2296      *
2297      * @return A list of equivalent home PLMNs. Returns an empty list if EF_EHPLMN is empty or
2298      * does not exist on the SIM card.
2299      */
getEquivalentHomePlmns(int subId, String callingPackage, String callingFeatureId)2300     List<String> getEquivalentHomePlmns(int subId, String callingPackage, String callingFeatureId);
2301 
2302     /**
2303      * Enable or disable Voice over NR (VoNR)
2304      * @param subId the subscription ID that this action applies to.
2305      * @param enabled enable or disable VoNR.
2306      * @return operation result.
2307      */
setVoNrEnabled(int subId, boolean enabled)2308     int setVoNrEnabled(int subId, boolean enabled);
2309 
2310     /**
2311      * Is voice over NR enabled
2312      * @return true if VoNR is enabled else false
2313      */
isVoNrEnabled(int subId)2314     boolean isVoNrEnabled(int subId);
2315 
2316     /**
2317      * Enable/Disable E-UTRA-NR Dual Connectivity
2318      * @return operation result. See TelephonyManager.EnableNrDualConnectivityResult for
2319      * details
2320      * @param subId the id of the subscription
2321      * @param enable enable/disable dual connectivity
2322      */
setNrDualConnectivityState(int subId, int nrDualConnectivityState)2323     int setNrDualConnectivityState(int subId, int nrDualConnectivityState);
2324 
2325     /**
2326      * Is E-UTRA-NR Dual Connectivity enabled
2327      * @param subId the id of the subscription
2328      * @return true if dual connectivity is enabled else false
2329      */
isNrDualConnectivityEnabled(int subId)2330     boolean isNrDualConnectivityEnabled(int subId);
2331 
2332     /**
2333      * Checks whether the device supports the given capability on the radio interface.
2334      *
2335      * @param capability the name of the capability
2336      * @return the availability of the capability
2337      */
isRadioInterfaceCapabilitySupported(String capability)2338     boolean isRadioInterfaceCapabilitySupported(String capability);
2339 
2340     /**
2341      * Thermal mitigation request to control functionalities at modem.
2342      *
2343      * @param subId the id of the subscription
2344      * @param thermalMitigationRequest holds the parameters necessary for the request.
2345      * @param callingPackage the package name of the calling package.
2346      * @throws InvalidThermalMitigationRequestException if the parametes are invalid.
2347      */
sendThermalMitigationRequest(int subId, in ThermalMitigationRequest thermalMitigationRequest, String callingPackage)2348     int sendThermalMitigationRequest(int subId,
2349             in ThermalMitigationRequest thermalMitigationRequest,
2350             String callingPackage);
2351 
2352     /**
2353      * get the Generic Bootstrapping Architecture authentication keys
2354      */
bootstrapAuthenticationRequest(int subId, int appType, in Uri nafUrl, in UaSecurityProtocolIdentifier securityProtocol, boolean forceBootStrapping, IBootstrapAuthenticationCallback callback)2355     void bootstrapAuthenticationRequest(int subId, int appType, in Uri nafUrl,
2356             in UaSecurityProtocolIdentifier securityProtocol,
2357             boolean forceBootStrapping, IBootstrapAuthenticationCallback callback);
2358 
2359     /**
2360      * Set the GbaService Package Name that Telephony will bind to.
2361      */
setBoundGbaServiceOverride(int subId, String packageName)2362     boolean setBoundGbaServiceOverride(int subId, String packageName);
2363 
2364     /**
2365      * Return the package name of the currently bound GbaService.
2366      */
getBoundGbaService(int subId)2367     String getBoundGbaService(int subId);
2368 
2369     /**
2370      * Set the release time for telephony to unbind GbaService.
2371      */
setGbaReleaseTimeOverride(int subId, int interval)2372     boolean setGbaReleaseTimeOverride(int subId, int interval);
2373 
2374     /**
2375      * Return the release time for telephony to unbind GbaService.
2376      */
getGbaReleaseTime(int subId)2377     int getGbaReleaseTime(int subId);
2378 
2379     /**
2380      * Provide the client configuration parameters of the RCS application.
2381      */
setRcsClientConfiguration(int subId, in RcsClientConfiguration rcc)2382     void setRcsClientConfiguration(int subId, in RcsClientConfiguration rcc);
2383 
2384     /**
2385      * return value to indicate whether the device and the carrier can support RCS VoLTE
2386      * single registration.
2387      */
isRcsVolteSingleRegistrationCapable(int subId)2388     boolean isRcsVolteSingleRegistrationCapable(int subId);
2389 
2390     /**
2391      * Register RCS provisioning callback.
2392      */
registerRcsProvisioningCallback(int subId, IRcsConfigCallback callback)2393     void registerRcsProvisioningCallback(int subId, IRcsConfigCallback callback);
2394 
2395     /**
2396      * Unregister RCS provisioning callback.
2397      */
unregisterRcsProvisioningCallback(int subId, IRcsConfigCallback callback)2398     void unregisterRcsProvisioningCallback(int subId, IRcsConfigCallback callback);
2399 
2400     /**
2401      * trigger RCS reconfiguration.
2402      */
triggerRcsReconfiguration(int subId)2403     void triggerRcsReconfiguration(int subId);
2404 
2405     /**
2406      * Enables or disables the test mode for RCS VoLTE single registration.
2407      */
setRcsSingleRegistrationTestModeEnabled(boolean enabled)2408     void setRcsSingleRegistrationTestModeEnabled(boolean enabled);
2409 
2410     /**
2411      * Gets the test mode for RCS VoLTE single registration.
2412      */
getRcsSingleRegistrationTestModeEnabled()2413     boolean getRcsSingleRegistrationTestModeEnabled();
2414 
2415     /**
2416      * Overrides the config of RCS VoLTE single registration enabled for the device.
2417      */
setDeviceSingleRegistrationEnabledOverride(String enabled)2418     void setDeviceSingleRegistrationEnabledOverride(String enabled);
2419 
2420     /**
2421      * Gets the config of RCS VoLTE single registration enabled for the device.
2422      */
getDeviceSingleRegistrationEnabled()2423     boolean getDeviceSingleRegistrationEnabled();
2424 
2425     /**
2426      * Overrides the config of RCS VoLTE single registration enabled for the carrier/subscription.
2427      */
setCarrierSingleRegistrationEnabledOverride(int subId, String enabled)2428     boolean setCarrierSingleRegistrationEnabledOverride(int subId, String enabled);
2429 
2430     /**
2431      * Sends a device to device message; only for use through shell.
2432      */
sendDeviceToDeviceMessage(int message, int value)2433     void sendDeviceToDeviceMessage(int message, int value);
2434 
2435     /**
2436      * Sets the specified transport active; only for use through shell.
2437      */
setActiveDeviceToDeviceTransport(String transport)2438     void setActiveDeviceToDeviceTransport(String transport);
2439 
2440     /**
2441      * Forces Device to Device communication to be enabled, even if the device config has it
2442      * disabled.
2443      */
setDeviceToDeviceForceEnabled(boolean isForceEnabled)2444     void setDeviceToDeviceForceEnabled(boolean isForceEnabled);
2445 
2446     /**
2447      * Gets the config of RCS VoLTE single registration enabled for the carrier/subscription.
2448      */
getCarrierSingleRegistrationEnabled(int subId)2449     boolean getCarrierSingleRegistrationEnabled(int subId);
2450 
2451     /**
2452      * Overrides the ims feature validation result
2453      */
setImsFeatureValidationOverride(int subId, String enabled)2454     boolean setImsFeatureValidationOverride(int subId, String enabled);
2455 
2456     /**
2457      * Gets the ims feature validation override value
2458      */
getImsFeatureValidationOverride(int subId)2459     boolean getImsFeatureValidationOverride(int subId);
2460 
2461     /**
2462      *  Return the mobile provisioning url that is used to launch a browser to allow users to manage
2463      *  their mobile plan.
2464      */
getMobileProvisioningUrl()2465     String getMobileProvisioningUrl();
2466 
2467     /*
2468      * Remove the EAB contacts from the EAB database.
2469      */
removeContactFromEab(int subId, String contacts)2470     int removeContactFromEab(int subId, String contacts);
2471 
2472     /**
2473      * Get the EAB contact from the EAB database.
2474      */
getContactFromEab(String contact)2475     String getContactFromEab(String contact);
2476 
2477     /**
2478      * Get the EAB capability from the EAB database.
2479      */
getCapabilityFromEab(String contact)2480     String getCapabilityFromEab(String contact);
2481 
2482     /*
2483      * Check whether the device supports RCS User Capability Exchange or not.
2484      */
getDeviceUceEnabled()2485     boolean getDeviceUceEnabled();
2486 
2487     /*
2488      * Set the device supports RCS User Capability Exchange.
2489      */
setDeviceUceEnabled(boolean isEnabled)2490      void setDeviceUceEnabled(boolean isEnabled);
2491 
2492     /**
2493      * Add feature tags to the IMS registration being tracked by UCE and potentially
2494      * generate a new PUBLISH to the network.
2495      * Note: This is designed for a SHELL command only.
2496      */
addUceRegistrationOverrideShell(int subId, in List<String> featureTags)2497     RcsContactUceCapability addUceRegistrationOverrideShell(int subId, in List<String> featureTags);
2498 
2499     /**
2500      * Remove feature tags from the IMS registration being tracked by UCE and potentially
2501      * generate a new PUBLISH to the network.
2502      * Note: This is designed for a SHELL command only.
2503      */
removeUceRegistrationOverrideShell(int subId, in List<String> featureTags)2504     RcsContactUceCapability removeUceRegistrationOverrideShell(int subId,
2505             in List<String> featureTags);
2506 
2507     /**
2508      * Clear overridden feature tags in the IMS registration being tracked by UCE and potentially
2509      * generate a new PUBLISH to the network.
2510      * Note: This is designed for a SHELL command only.
2511      */
clearUceRegistrationOverrideShell(int subId)2512     RcsContactUceCapability clearUceRegistrationOverrideShell(int subId);
2513 
2514     /**
2515      * Get the latest RcsContactUceCapability structure that is used in SIP PUBLISH procedures.
2516      * Note: This is designed for a SHELL command only.
2517      */
getLatestRcsContactUceCapabilityShell(int subId)2518     RcsContactUceCapability getLatestRcsContactUceCapabilityShell(int subId);
2519 
2520     /**
2521      * Returns the last PIDF XML sent to the network during the last PUBLISH or "none" if the
2522      * device does not have an active PUBLISH.
2523      * Note: This is designed for a SHELL command only.
2524      */
getLastUcePidfXmlShell(int subId)2525     String getLastUcePidfXmlShell(int subId);
2526 
2527     /**
2528       * Remove UCE requests cannot be sent to the network status.
2529       * Note: This is designed for a SHELL command only.
2530       */
removeUceRequestDisallowedStatus(int subId)2531     boolean removeUceRequestDisallowedStatus(int subId);
2532 
2533     /**
2534      * Set the timeout for contact capabilities request.
2535      * Note: This is designed for a SHELL command only.
2536      */
setCapabilitiesRequestTimeout(int subId, long timeoutAfterMs)2537     boolean setCapabilitiesRequestTimeout(int subId, long timeoutAfterMs);
2538 
2539     /**
2540      * Set a SignalStrengthUpdateRequest to receive notification when Signal Strength breach the
2541      * specified thresholds.
2542      */
setSignalStrengthUpdateRequest(int subId, in SignalStrengthUpdateRequest request, String callingPackage)2543     void setSignalStrengthUpdateRequest(int subId, in SignalStrengthUpdateRequest request,
2544             String callingPackage);
2545 
2546     /**
2547      * Clear a SignalStrengthUpdateRequest from system.
2548      */
clearSignalStrengthUpdateRequest(int subId, in SignalStrengthUpdateRequest request, String callingPackage)2549     void clearSignalStrengthUpdateRequest(int subId, in SignalStrengthUpdateRequest request,
2550             String callingPackage);
2551 
2552     /**
2553      * Gets the current phone capability.
2554      */
getPhoneCapability()2555     PhoneCapability getPhoneCapability();
2556 
2557     /**
2558      * Prepare TelephonyManager for an unattended reboot. The reboot is
2559      * required to be done shortly after the API is invoked.
2560      *
2561      * Requires system privileges.
2562      *
2563      * @return {@link #PREPARE_UNATTENDED_REBOOT_SUCCESS} in case of success.
2564      * {@link #PREPARE_UNATTENDED_REBOOT_PIN_REQUIRED} if the device contains
2565      * at least one SIM card for which the user needs to manually enter the PIN
2566      * code after the reboot. {@link #PREPARE_UNATTENDED_REBOOT_ERROR} in case
2567      * of error.
2568      */
prepareForUnattendedReboot()2569     int prepareForUnattendedReboot();
2570 
2571     /**
2572      * Request to get the current slicing configuration including URSP rules and
2573      * NSSAIs (configured, allowed and rejected).
2574      */
getSlicingConfig(in ResultReceiver callback)2575     void getSlicingConfig(in ResultReceiver callback);
2576 
2577     /**
2578      * Check whether the given premium capability is available for purchase from the carrier.
2579      */
isPremiumCapabilityAvailableForPurchase(int capability, int subId)2580     boolean isPremiumCapabilityAvailableForPurchase(int capability, int subId);
2581 
2582     /**
2583      * Purchase the given premium capability from the carrier.
2584      */
purchasePremiumCapability(int capability, IIntegerConsumer callback, int subId)2585     void purchasePremiumCapability(int capability, IIntegerConsumer callback, int subId);
2586 
2587     /**
2588      * Register an IMS connection state callback
2589      */
registerImsStateCallback(int subId, int feature, in IImsStateCallback cb, in String callingPackage)2590     void registerImsStateCallback(int subId, int feature, in IImsStateCallback cb,
2591             in String callingPackage);
2592 
2593     /**
2594      * Unregister an IMS connection state callback
2595      */
unregisterImsStateCallback(in IImsStateCallback cb)2596     void unregisterImsStateCallback(in IImsStateCallback cb);
2597 
2598     /**
2599      * return last known cell identity
2600      * @param subId user preferred subId.
2601      * @param callingPackage the name of the package making the call.
2602      * @param callingFeatureId The feature in the package.
2603      */
getLastKnownCellIdentity(int subId, String callingPackage, String callingFeatureId)2604     CellIdentity getLastKnownCellIdentity(int subId, String callingPackage,
2605             String callingFeatureId);
2606 
2607     /**
2608      *  @return true if the modem service is set successfully, false otherwise.
2609      */
setModemService(in String serviceName)2610     boolean setModemService(in String serviceName);
2611 
2612     /**
2613      * @return the service name of the modem service which bind to.
2614      */
getModemService()2615     String getModemService();
2616 
2617     /**
2618      * Is Provisioning required for capability
2619      * @return true if provisioning is required for the MMTEL capability and IMS
2620      * registration technology specified, false if it is not required.
2621      */
isProvisioningRequiredForCapability(int subId, int capability, int tech)2622     boolean isProvisioningRequiredForCapability(int subId, int capability, int tech);
2623 
2624     /**
2625      * Is RCS Provisioning required for capability
2626      * @return true if provisioning is required for the RCS capability and IMS
2627      * registration technology specified, false if it is not required.
2628      */
isRcsProvisioningRequiredForCapability(int subId, int capability, int tech)2629     boolean isRcsProvisioningRequiredForCapability(int subId, int capability, int tech);
2630 
2631     /**
2632      * Sets a voice service state from telecom based on the current PhoneAccounts registered. See
2633      * PhoneAccount#CAPABILITY_VOICE_CALLING_AVAILABLE.
2634      */
setVoiceServiceStateOverride(int subId, boolean hasService, String callingPackage)2635     void setVoiceServiceStateOverride(int subId, boolean hasService, String callingPackage);
2636 
2637     /**
2638      * Returns the package name that provides the {@link CarrierService} implementation for the
2639      * specified {@code logicalSlotIndex}, or {@code null} if no package with carrier privileges
2640      * declares one.
2641      *
2642      * @param logicalSlotIndex The slot index to fetch the {@link CarrierService} package for
2643      * @return The system-selected package that provides the {@link CarrierService} implementation
2644      * for the slot, or {@code null} if none is resolved
2645      */
getCarrierServicePackageNameForLogicalSlot(int logicalSlotIndex)2646     String getCarrierServicePackageNameForLogicalSlot(int logicalSlotIndex);
2647 
2648     /**
2649      * set removable eSIM as default eUICC.
2650      *
2651      * @hide
2652      */
setRemovableEsimAsDefaultEuicc(boolean isDefault, String callingPackage)2653     void setRemovableEsimAsDefaultEuicc(boolean isDefault, String callingPackage);
2654 
2655     /**
2656      * Returns whether the removable eSIM is default eUICC or not.
2657      *
2658      * @hide
2659      */
isRemovableEsimDefaultEuicc(String callingPackage)2660     boolean isRemovableEsimDefaultEuicc(String callingPackage);
2661 
2662     /**
2663      * Get the component name of the default app to direct respond-via-message intent for the
2664      * user associated with this subscription, update the cache if there is no respond-via-message
2665      * application currently configured for this user.
2666      * @return component name of the app and class to direct Respond Via Message intent to, or
2667      * {@code null} if the functionality is not supported.
2668      * @hide
2669      */
getDefaultRespondViaMessageApplication(int subId, boolean updateIfNeeded)2670     ComponentName getDefaultRespondViaMessageApplication(int subId, boolean updateIfNeeded);
2671 
2672     /**
2673      * Get the SIM state for the logical SIM slot index.
2674      *
2675      * @param slotIndex Logical SIM slot index.
2676      */
getSimStateForSlotIndex(int slotIndex)2677     int getSimStateForSlotIndex(int slotIndex);
2678 
2679     /**
2680      * Request telephony to persist state for debugging emergency call failures.
2681      *
2682      * @param dropBoxTag Tag to use when persisting data to dropbox service.
2683      * @param enableLogcat whether to collect logcat output
2684      * @param logcatStartTimestampMillis timestamp from when logcat buffers would be persisted
2685      * @param enableTelecomDump whether to collect telecom dumpsys
2686      * @param enableTelephonyDump whether to collect telephony dumpsys
2687      *
2688      * @hide
2689      */
2690     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2691             + "android.Manifest.permission.DUMP)")
persistEmergencyCallDiagnosticData(String dropboxTag, boolean enableLogcat, long logcatStartTimestampMillis, boolean enableTelecomDump, boolean enableTelephonyDump)2692     void persistEmergencyCallDiagnosticData(String dropboxTag, boolean enableLogcat,
2693         long logcatStartTimestampMillis, boolean enableTelecomDump, boolean enableTelephonyDump);
2694     /**
2695      * Set whether the radio is able to connect with null ciphering or integrity
2696      * algorithms. This is a global setting and will apply to all active subscriptions
2697      * and all new subscriptions after this.
2698      *
2699      * <p>Requires Permission:
2700      *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
2701      *
2702      * @param enabled when true, null  cipher and integrity algorithms are allowed.
2703      * @hide
2704      */
setNullCipherAndIntegrityEnabled(boolean enabled)2705     void setNullCipherAndIntegrityEnabled(boolean enabled);
2706 
2707     /**
2708      * Get whether the radio is able to connect with null ciphering or integrity
2709      * algorithms. Note that this retrieves the phone-global preference and not
2710      * the state of the radio.
2711      *
2712      * @hide
2713      */
isNullCipherAndIntegrityPreferenceEnabled()2714     boolean isNullCipherAndIntegrityPreferenceEnabled();
2715 
2716     /**
2717      * Get current broadcast ranges.
2718      */
getCellBroadcastIdRanges(int subId)2719     List<CellBroadcastIdRange> getCellBroadcastIdRanges(int subId);
2720 
2721     /**
2722      * Set reception of cell broadcast messages with the list of the given ranges
2723      */
setCellBroadcastIdRanges(int subId, in List<CellBroadcastIdRange> ranges, IIntegerConsumer callback)2724     void setCellBroadcastIdRanges(int subId, in List<CellBroadcastIdRange> ranges,
2725             IIntegerConsumer callback);
2726 
2727     /**
2728      * Returns whether the domain selection service is supported.
2729      *
2730      * @return {@code true} if the domain selection service is supported.
2731      */
isDomainSelectionSupported()2732     boolean isDomainSelectionSupported();
2733 
2734     /**
2735      * Get the carrier restriction status of the device.
2736      */
getCarrierRestrictionStatus(IIntegerConsumer internalCallback, String packageName)2737     void getCarrierRestrictionStatus(IIntegerConsumer internalCallback, String packageName);
2738 
2739     /**
2740      * Request to enable or disable the satellite modem.
2741      *
2742      * @param subId The subId of the subscription to enable or disable the satellite modem for.
2743      * @param enable True to enable the satellite modem and false to disable.
2744      * @param isDemoModeEnabled True if demo mode is enabled and false otherwise.
2745      * @param callback The callback to get the result of the request.
2746      */
2747     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2748             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
requestSatelliteEnabled(int subId, boolean enable, boolean isDemoModeEnabled, in IIntegerConsumer callback)2749     void requestSatelliteEnabled(int subId, boolean enable, boolean isDemoModeEnabled,
2750             in IIntegerConsumer callback);
2751 
2752     /**
2753      * Request to get whether the satellite modem is enabled.
2754      *
2755      * @param subId The subId of the subscription to request whether satellite is enabled for.
2756      * @param receiver Result receiver to get the error code of the request and whether the
2757      *                 satellite modem is enabled.
2758      */
2759     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2760             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
requestIsSatelliteEnabled(int subId, in ResultReceiver receiver)2761     void requestIsSatelliteEnabled(int subId, in ResultReceiver receiver);
2762 
2763     /**
2764      * Request to get whether the satellite service demo mode is enabled.
2765      *
2766      * @param subId The subId of the subscription to request whether the satellite demo mode is
2767      *              enabled for.
2768      * @param receiver Result receiver to get the error code of the request and whether the
2769      *                 satellite demo mode is enabled.
2770      */
2771     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2772             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
requestIsDemoModeEnabled(int subId, in ResultReceiver receiver)2773     void requestIsDemoModeEnabled(int subId, in ResultReceiver receiver);
2774 
2775     /**
2776      * Request to get whether the satellite service is supported on the device.
2777      *
2778      * @param subId The subId of the subscription to check whether satellite is supported for.
2779      * @param receiver Result receiver to get the error code of the request and whether the
2780      *                 satellite service is supported on the device.
2781      */
requestIsSatelliteSupported(int subId, in ResultReceiver receiver)2782     void requestIsSatelliteSupported(int subId, in ResultReceiver receiver);
2783 
2784     /**
2785      * Request to get the capabilities of the satellite service.
2786      *
2787      * @param subId The subId of the subscription to get the capabilities for.
2788      * @param receiver Result receiver to get the error code of the request and the requested
2789      *                 capabilities of the satellite service.
2790      */
2791     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2792             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
requestSatelliteCapabilities(int subId, in ResultReceiver receiver)2793     void requestSatelliteCapabilities(int subId, in ResultReceiver receiver);
2794 
2795     /**
2796      * Start receiving satellite transmission updates.
2797      *
2798      * @param subId The subId of the subscription to stop satellite transmission updates for.
2799      * @param resultCallback The callback to get the result of the request.
2800      * @param callback The callback to handle transmission updates.
2801      */
2802     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2803             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
startSatelliteTransmissionUpdates(int subId, in IIntegerConsumer resultCallback, in ISatelliteTransmissionUpdateCallback callback)2804     void startSatelliteTransmissionUpdates(int subId, in IIntegerConsumer resultCallback,
2805             in ISatelliteTransmissionUpdateCallback callback);
2806 
2807     /**
2808      * Stop receiving satellite transmission updates.
2809      *
2810      * @param subId The subId of the subscritpion to stop satellite transmission updates for.
2811      * @param resultCallback The callback to get the result of the request.
2812      * @param callback The callback that was passed to startSatelliteTransmissionUpdates.
2813      */
2814     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2815             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
stopSatelliteTransmissionUpdates(int subId, in IIntegerConsumer resultCallback, in ISatelliteTransmissionUpdateCallback callback)2816     void stopSatelliteTransmissionUpdates(int subId, in IIntegerConsumer resultCallback,
2817             in ISatelliteTransmissionUpdateCallback callback);
2818 
2819     /**
2820      * Register the subscription with a satellite provider.
2821      * This is needed to register the subscription if the provider allows dynamic registration.
2822      *
2823      * @param subId The subId of the subscription to be provisioned.
2824      * @param token The token to be used as a unique identifier for provisioning with satellite
2825      *              gateway.
2826      * @provisionData Data from the provisioning app that can be used by provisioning server
2827      * @param callback The callback to get the result of the request.
2828      *
2829      * @return The signal transport used by callers to cancel the provision request.
2830      */
2831     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2832             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
provisionSatelliteService(int subId, in String token, in byte[] provisionData, in IIntegerConsumer callback)2833     ICancellationSignal provisionSatelliteService(int subId, in String token,
2834             in byte[] provisionData, in IIntegerConsumer callback);
2835 
2836     /**
2837      * Unregister the subscription with the satellite provider.
2838      * This is needed to unregister the subscription if the provider allows dynamic registration.
2839      * Once deprovisioned,
2840      * {@link SatelliteCallback.SatelliteProvisionStateListener#onSatelliteProvisionStateChanged}
2841      * should report as deprovisioned.
2842      *
2843      * @param subId The subId of the subscription to be deprovisioned.
2844      * @param token The token of the device/subscription to be deprovisioned.
2845      * @param callback The callback to get the result of the request.
2846      */
2847     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2848             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
deprovisionSatelliteService(int subId, in String token, in IIntegerConsumer callback)2849     void deprovisionSatelliteService(int subId, in String token, in IIntegerConsumer callback);
2850 
2851 
2852     /**
2853      * Registers for provision state changed from satellite modem.
2854      *
2855      * @param subId The subId of the subscription to register for provision state changed.
2856      * @param callback The callback to handle the satellite provision state changed event.
2857      *
2858      * @return The {@link SatelliteError} result of the operation.
2859      */
2860     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2861             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
registerForSatelliteProvisionStateChanged(int subId, in ISatelliteProvisionStateCallback callback)2862     int registerForSatelliteProvisionStateChanged(int subId,
2863             in ISatelliteProvisionStateCallback callback);
2864 
2865     /**
2866      * Unregisters for provision state changed from satellite modem.
2867      * If callback was not registered before, the request will be ignored.
2868      *
2869      * @param subId The subId of the subscription to unregister for provision state changed.
2870      * @param callback The callback that was passed to registerForSatelliteProvisionStateChanged.
2871      */
2872     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2873             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
unregisterForSatelliteProvisionStateChanged(int subId, in ISatelliteProvisionStateCallback callback)2874     void unregisterForSatelliteProvisionStateChanged(int subId,
2875             in ISatelliteProvisionStateCallback callback);
2876 
2877     /**
2878      * Request to get whether the device is provisioned with a satellite provider.
2879      *
2880      * @param subId The subId of the subscription to get whether the device is provisioned for.
2881      * @param receiver Result receiver to get the error code of the request and whether the
2882      *                 device is provisioned with a satellite provider.
2883      */
2884     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2885             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
requestIsSatelliteProvisioned(int subId, in ResultReceiver receiver)2886     void requestIsSatelliteProvisioned(int subId, in ResultReceiver receiver);
2887 
2888     /**
2889      * Registers for modem state changed from satellite modem.
2890      *
2891      * @param subId The subId of the subscription to register for satellite modem state changed.
2892      * @param callback The callback to handle the satellite modem state changed event.
2893      *
2894      * @return The {@link SatelliteError} result of the operation.
2895      */
2896     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2897             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
registerForSatelliteModemStateChanged(int subId, ISatelliteStateCallback callback)2898     int registerForSatelliteModemStateChanged(int subId, ISatelliteStateCallback callback);
2899 
2900     /**
2901      * Unregisters for modem state changed from satellite modem.
2902      * If callback was not registered before, the request will be ignored.
2903      *
2904      * @param subId The subId of the subscription to unregister for satellite modem state changed.
2905      * @param callback The callback that was passed to registerForSatelliteStateChanged.
2906      */
2907     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2908             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
unregisterForSatelliteModemStateChanged(int subId, ISatelliteStateCallback callback)2909     void unregisterForSatelliteModemStateChanged(int subId, ISatelliteStateCallback callback);
2910 
2911    /**
2912      * Register to receive incoming datagrams over satellite.
2913      *
2914      * @param subId The subId of the subscription to register for incoming satellite datagrams.
2915      * @param callback The callback to handle the incoming datagrams.
2916      *
2917      * @return The {@link SatelliteError} result of the operation.
2918      */
2919     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2920             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
registerForSatelliteDatagram(int subId, ISatelliteDatagramCallback callback)2921     int registerForSatelliteDatagram(int subId, ISatelliteDatagramCallback callback);
2922 
2923    /**
2924      * Unregister to stop receiving incoming datagrams over satellite.
2925      * If callback was not registered before, the request will be ignored.
2926      *
2927      * @param subId The subId of the subscription to unregister for incoming satellite datagrams.
2928      * @param callback The callback that was passed to registerForSatelliteDatagram.
2929      */
2930     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2931             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
unregisterForSatelliteDatagram(int subId, ISatelliteDatagramCallback callback)2932     void unregisterForSatelliteDatagram(int subId, ISatelliteDatagramCallback callback);
2933 
2934    /**
2935     * Poll pending satellite datagrams over satellite.
2936     *
2937     * @param subId The subId of the subscription used for receiving datagrams.
2938     * @param callback The callback to get the result of the request.
2939     */
2940     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2941                 + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
pollPendingSatelliteDatagrams(int subId, IIntegerConsumer callback)2942     void pollPendingSatelliteDatagrams(int subId, IIntegerConsumer callback);
2943 
2944    /**
2945     * Send datagram over satellite.
2946     *
2947     * @param subId The subId of the subscription to send satellite datagrams for.
2948     * @param datagramType Type of datagram.
2949     * @param datagram Datagram to send over satellite.
2950     * @param needFullScreenPointingUI this is used to indicate pointingUI app to open in
2951     *                                 full screen mode.
2952     * @param callback The callback to get the result of the request.
2953     */
2954     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2955             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
sendSatelliteDatagram(int subId, int datagramType, in SatelliteDatagram datagram, in boolean needFullScreenPointingUI, IIntegerConsumer callback)2956     void sendSatelliteDatagram(int subId, int datagramType,
2957              in SatelliteDatagram datagram, in boolean needFullScreenPointingUI,
2958              IIntegerConsumer callback);
2959 
2960     /**
2961      * Request to get whether satellite communication is allowed for the current location.
2962      *
2963      * @param subId The subId of the subscription to get whether satellite communication is allowed
2964      *              for the current location for.
2965      * @param receiver Result receiver to get the error code of the request and whether satellite
2966      *                 communication is allowed for the current location.
2967      */
2968     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2969             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
requestIsSatelliteCommunicationAllowedForCurrentLocation(int subId, in ResultReceiver receiver)2970     void requestIsSatelliteCommunicationAllowedForCurrentLocation(int subId,
2971             in ResultReceiver receiver);
2972 
2973     /**
2974      * Request to get the time after which the satellite will be visible.
2975      *
2976      * @param subId The subId to get the time after which the satellite will be visible for.
2977      * @param receiver Result receiver to get the error code of the request and the requested
2978      *                 time after which the satellite will be visible.
2979      */
2980     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2981             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
requestTimeForNextSatelliteVisibility(int subId, in ResultReceiver receiver)2982     void requestTimeForNextSatelliteVisibility(int subId, in ResultReceiver receiver);
2983 
2984     /**
2985      * Inform whether the device is aligned with the satellite within in margin for demo mode.
2986      *
2987      * @param isAligned {@true} Device is aligned with the satellite for demo mode
2988      *                  {@false} Device is not aligned with the satellite for demo mode
2989      */
2990     @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
2991             + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
onDeviceAlignedWithSatellite(int subId, in boolean isAligned)2992     void onDeviceAlignedWithSatellite(int subId, in boolean isAligned);
2993 
2994     /**
2995      * This API can be used by only CTS to update satellite vendor service package name.
2996      *
2997      * @param servicePackageName The package name of the satellite vendor service.
2998      * @return {@code true} if the satellite vendor service is set successfully,
2999      * {@code false} otherwise.
3000      */
setSatelliteServicePackageName(in String servicePackageName)3001     boolean setSatelliteServicePackageName(in String servicePackageName);
3002 
3003     /**
3004      * This API can be used by only CTS to update satellite gateway service package name.
3005      *
3006      * @param servicePackageName The package name of the satellite gateway service.
3007      * @return {@code true} if the satellite gateway service is set successfully,
3008      * {@code false} otherwise.
3009      */
setSatelliteGatewayServicePackageName(in String servicePackageName)3010     boolean setSatelliteGatewayServicePackageName(in String servicePackageName);
3011 
3012     /**
3013      * This API can be used by only CTS to update the timeout duration in milliseconds that
3014      * satellite should stay at listening mode to wait for the next incoming page before disabling
3015      * listening mode.
3016      *
3017      * @param timeoutMillis The timeout duration in millisecond.
3018      * @return {@code true} if the timeout duration is set successfully, {@code false} otherwise.
3019      */
setSatelliteListeningTimeoutDuration(in long timeoutMillis)3020     boolean setSatelliteListeningTimeoutDuration(in long timeoutMillis);
3021 
3022     /**
3023      * This API can be used by only CTS to update satellite pointing UI app package and class names.
3024      *
3025      * @param packageName The package name of the satellite pointing UI app.
3026      * @param className The class name of the satellite pointing UI app.
3027      * @return {@code true} if the satellite pointing UI app package and class is set successfully,
3028      * {@code false} otherwise.
3029      */
setSatellitePointingUiClassName(in String packageName, in String className)3030     boolean setSatellitePointingUiClassName(in String packageName, in String className);
3031 
3032     /**
3033      * This API can be used by only CTS to update the timeout duration in milliseconds whether
3034      * the device is aligned with the satellite for demo mode
3035      *
3036      * @param timeoutMillis The timeout duration in millisecond.
3037      * @return {@code true} if the timeout duration is set successfully, {@code false} otherwise.
3038      */
setSatelliteDeviceAlignedTimeoutDuration(long timeoutMillis)3039     boolean setSatelliteDeviceAlignedTimeoutDuration(long timeoutMillis);
3040 
3041     /**
3042      * Test method to confirm the file contents are not altered.
3043      */
3044      @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
3045                  + "android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)")
getShaIdFromAllowList(String pkgName, int carrierId)3046      List<String> getShaIdFromAllowList(String pkgName, int carrierId);
3047 }
3048