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