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