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