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