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