ITelephony.aidl revision c614d7c2d5e37576770e33237612f70b8849bee4
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 17package com.android.internal.telephony; 18 19import android.content.Intent; 20import android.os.Bundle; 21import android.net.Uri; 22import android.telecom.PhoneAccount; 23import android.telecom.PhoneAccountHandle; 24import android.telephony.CellInfo; 25import android.telephony.IccOpenLogicalChannelResponse; 26import android.telephony.ModemActivityInfo; 27import android.telephony.NeighboringCellInfo; 28import android.telephony.RadioAccessFamily; 29import android.telephony.ServiceState; 30import com.android.internal.telephony.CellNetworkScanResult; 31import com.android.internal.telephony.OperatorInfo; 32import java.util.List; 33 34 35/** 36 * Interface used to interact with the phone. Mostly this is used by the 37 * TelephonyManager class. A few places are still using this directly. 38 * Please clean them up if possible and use TelephonyManager instead. 39 * 40 * {@hide} 41 */ 42interface ITelephony { 43 44 /** 45 * Dial a number. This doesn't place the call. It displays 46 * the Dialer screen. 47 * @param number the number to be dialed. If null, this 48 * would display the Dialer screen with no number pre-filled. 49 */ 50 void dial(String number); 51 52 /** 53 * Place a call to the specified number. 54 * @param callingPackage The package making the call. 55 * @param number the number to be called. 56 */ 57 void call(String callingPackage, String number); 58 59 /** 60 * End call if there is a call in progress, otherwise does nothing. 61 * 62 * @return whether it hung up 63 */ 64 boolean endCall(); 65 66 /** 67 * End call on particular subId or go to the Home screen 68 * @param subId user preferred subId. 69 * @return whether it hung up 70 */ 71 boolean endCallForSubscriber(int subId); 72 73 /** 74 * Answer the currently-ringing call. 75 * 76 * If there's already a current active call, that call will be 77 * automatically put on hold. If both lines are currently in use, the 78 * current active call will be ended. 79 * 80 * TODO: provide a flag to let the caller specify what policy to use 81 * if both lines are in use. (The current behavior is hardwired to 82 * "answer incoming, end ongoing", which is how the CALL button 83 * is specced to behave.) 84 * 85 * TODO: this should be a oneway call (especially since it's called 86 * directly from the key queue thread). 87 */ 88 void answerRingingCall(); 89 90 /** 91 * Answer the currently-ringing call on particular subId . 92 * 93 * If there's already a current active call, that call will be 94 * automatically put on hold. If both lines are currently in use, the 95 * current active call will be ended. 96 * 97 * TODO: provide a flag to let the caller specify what policy to use 98 * if both lines are in use. (The current behavior is hardwired to 99 * "answer incoming, end ongoing", which is how the CALL button 100 * is specced to behave.) 101 * 102 * TODO: this should be a oneway call (especially since it's called 103 * directly from the key queue thread). 104 */ 105 void answerRingingCallForSubscriber(int subId); 106 107 /** 108 * Silence the ringer if an incoming call is currently ringing. 109 * (If vibrating, stop the vibrator also.) 110 * 111 * It's safe to call this if the ringer has already been silenced, or 112 * even if there's no incoming call. (If so, this method will do nothing.) 113 * 114 * TODO: this should be a oneway call too (see above). 115 * (Actually *all* the methods here that return void can 116 * probably be oneway.) 117 */ 118 void silenceRinger(); 119 120 /** 121 * Check if we are in either an active or holding call 122 * @param callingPackage the name of the package making the call. 123 * @return true if the phone state is OFFHOOK. 124 */ 125 boolean isOffhook(String callingPackage); 126 127 /** 128 * Check if a particular subId has an active or holding call 129 * 130 * @param subId user preferred subId. 131 * @param callingPackage the name of the package making the call. 132 * @return true if the phone state is OFFHOOK. 133 */ 134 boolean isOffhookForSubscriber(int subId, String callingPackage); 135 136 /** 137 * Check if an incoming phone call is ringing or call waiting 138 * on a particular subId. 139 * 140 * @param subId user preferred subId. 141 * @param callingPackage the name of the package making the call. 142 * @return true if the phone state is RINGING. 143 */ 144 boolean isRingingForSubscriber(int subId, String callingPackage); 145 146 /** 147 * Check if an incoming phone call is ringing or call waiting. 148 * @param callingPackage the name of the package making the call. 149 * @return true if the phone state is RINGING. 150 */ 151 boolean isRinging(String callingPackage); 152 153 /** 154 * Check if the phone is idle. 155 * @param callingPackage the name of the package making the call. 156 * @return true if the phone state is IDLE. 157 */ 158 boolean isIdle(String callingPackage); 159 160 /** 161 * Check if the phone is idle on a particular subId. 162 * 163 * @param subId user preferred subId. 164 * @param callingPackage the name of the package making the call. 165 * @return true if the phone state is IDLE. 166 */ 167 boolean isIdleForSubscriber(int subId, String callingPackage); 168 169 /** 170 * Check to see if the radio is on or not. 171 * @param callingPackage the name of the package making the call. 172 * @return returns true if the radio is on. 173 */ 174 boolean isRadioOn(String callingPackage); 175 176 /** 177 * Check to see if the radio is on or not on particular subId. 178 * @param subId user preferred subId. 179 * @param callingPackage the name of the package making the call. 180 * @return returns true if the radio is on. 181 */ 182 boolean isRadioOnForSubscriber(int subId, String callingPackage); 183 184 /** 185 * Supply a pin to unlock the SIM. Blocks until a result is determined. 186 * @param pin The pin to check. 187 * @return whether the operation was a success. 188 */ 189 boolean supplyPin(String pin); 190 191 /** 192 * Supply a pin to unlock the SIM for particular subId. 193 * Blocks until a result is determined. 194 * @param pin The pin to check. 195 * @param subId user preferred subId. 196 * @return whether the operation was a success. 197 */ 198 boolean supplyPinForSubscriber(int subId, String pin); 199 200 /** 201 * Supply puk to unlock the SIM and set SIM pin to new pin. 202 * Blocks until a result is determined. 203 * @param puk The puk to check. 204 * pin The new pin to be set in SIM 205 * @return whether the operation was a success. 206 */ 207 boolean supplyPuk(String puk, String pin); 208 209 /** 210 * Supply puk to unlock the SIM and set SIM pin to new pin. 211 * Blocks until a result is determined. 212 * @param puk The puk to check. 213 * pin The new pin to be set in SIM 214 * @param subId user preferred subId. 215 * @return whether the operation was a success. 216 */ 217 boolean supplyPukForSubscriber(int subId, String puk, String pin); 218 219 /** 220 * Supply a pin to unlock the SIM. Blocks until a result is determined. 221 * Returns a specific success/error code. 222 * @param pin The pin to check. 223 * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code 224 * retValue[1] = number of attempts remaining if known otherwise -1 225 */ 226 int[] supplyPinReportResult(String pin); 227 228 /** 229 * Supply a pin to unlock the SIM. Blocks until a result is determined. 230 * Returns a specific success/error code. 231 * @param pin The pin to check. 232 * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code 233 * retValue[1] = number of attempts remaining if known otherwise -1 234 */ 235 int[] supplyPinReportResultForSubscriber(int subId, String pin); 236 237 /** 238 * Supply puk to unlock the SIM and set SIM pin to new pin. 239 * Blocks until a result is determined. 240 * Returns a specific success/error code 241 * @param puk The puk to check 242 * pin The pin to check. 243 * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code 244 * retValue[1] = number of attempts remaining if known otherwise -1 245 */ 246 int[] supplyPukReportResult(String puk, String pin); 247 248 /** 249 * Supply puk to unlock the SIM and set SIM pin to new pin. 250 * Blocks until a result is determined. 251 * Returns a specific success/error code 252 * @param puk The puk to check 253 * pin The pin to check. 254 * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code 255 * retValue[1] = number of attempts remaining if known otherwise -1 256 */ 257 int[] supplyPukReportResultForSubscriber(int subId, String puk, String pin); 258 259 /** 260 * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated 261 * without SEND (so <code>dial</code> is not appropriate). 262 * 263 * @param dialString the MMI command to be executed. 264 * @return true if MMI command is executed. 265 */ 266 boolean handlePinMmi(String dialString); 267 268 /** 269 * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated 270 * without SEND (so <code>dial</code> is not appropriate) for 271 * a particular subId. 272 * @param dialString the MMI command to be executed. 273 * @param subId user preferred subId. 274 * @return true if MMI command is executed. 275 */ 276 boolean handlePinMmiForSubscriber(int subId, String dialString); 277 278 /** 279 * Toggles the radio on or off. 280 */ 281 void toggleRadioOnOff(); 282 283 /** 284 * Toggles the radio on or off on particular subId. 285 * @param subId user preferred subId. 286 */ 287 void toggleRadioOnOffForSubscriber(int subId); 288 289 /** 290 * Set the radio to on or off 291 */ 292 boolean setRadio(boolean turnOn); 293 294 /** 295 * Set the radio to on or off on particular subId. 296 * @param subId user preferred subId. 297 */ 298 boolean setRadioForSubscriber(int subId, boolean turnOn); 299 300 /** 301 * Set the radio to on or off unconditionally 302 */ 303 boolean setRadioPower(boolean turnOn); 304 305 /** 306 * Request to update location information in service state 307 */ 308 void updateServiceLocation(); 309 310 /** 311 * Request to update location information for a subscrition in service state 312 * @param subId user preferred subId. 313 */ 314 void updateServiceLocationForSubscriber(int subId); 315 316 /** 317 * Enable location update notifications. 318 */ 319 void enableLocationUpdates(); 320 321 /** 322 * Enable location update notifications. 323 * @param subId user preferred subId. 324 */ 325 void enableLocationUpdatesForSubscriber(int subId); 326 327 /** 328 * Disable location update notifications. 329 */ 330 void disableLocationUpdates(); 331 332 /** 333 * Disable location update notifications. 334 * @param subId user preferred subId. 335 */ 336 void disableLocationUpdatesForSubscriber(int subId); 337 338 /** 339 * Allow mobile data connections. 340 */ 341 boolean enableDataConnectivity(); 342 343 /** 344 * Disallow mobile data connections. 345 */ 346 boolean disableDataConnectivity(); 347 348 /** 349 * Report whether data connectivity is possible. 350 */ 351 boolean isDataConnectivityPossible(); 352 353 Bundle getCellLocation(String callingPkg); 354 355 /** 356 * Returns the neighboring cell information of the device. 357 */ 358 List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg); 359 360 int getCallState(); 361 362 /** 363 * Returns the call state for a subId. 364 */ 365 int getCallStateForSubscriber(int subId); 366 367 int getDataActivity(); 368 int getDataState(); 369 370 /** 371 * Returns the current active phone type as integer. 372 * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE 373 * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE 374 */ 375 int getActivePhoneType(); 376 377 /** 378 * Returns the current active phone type as integer for particular subId. 379 * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE 380 * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE 381 * @param subId user preferred subId. 382 */ 383 int getActivePhoneTypeForSubscriber(int subId); 384 385 /** 386 * Returns the CDMA ERI icon index to display 387 * @param callingPackage package making the call. 388 */ 389 int getCdmaEriIconIndex(String callingPackage); 390 391 /** 392 * Returns the CDMA ERI icon index to display on particular subId. 393 * @param subId user preferred subId. 394 * @param callingPackage package making the call. 395 */ 396 int getCdmaEriIconIndexForSubscriber(int subId, String callingPackage); 397 398 /** 399 * Returns the CDMA ERI icon mode, 400 * 0 - ON 401 * 1 - FLASHING 402 * @param callingPackage package making the call. 403 */ 404 int getCdmaEriIconMode(String callingPackage); 405 406 /** 407 * Returns the CDMA ERI icon mode on particular subId, 408 * 0 - ON 409 * 1 - FLASHING 410 * @param subId user preferred subId. 411 * @param callingPackage package making the call. 412 */ 413 int getCdmaEriIconModeForSubscriber(int subId, String callingPackage); 414 415 /** 416 * Returns the CDMA ERI text, 417 * @param callingPackage package making the call. 418 */ 419 String getCdmaEriText(String callingPackage); 420 421 /** 422 * Returns the CDMA ERI text for particular subId, 423 * @param subId user preferred subId. 424 * @param callingPackage package making the call. 425 */ 426 String getCdmaEriTextForSubscriber(int subId, String callingPackage); 427 428 /** 429 * Returns true if OTA service provisioning needs to run. 430 * Only relevant on some technologies, others will always 431 * return false. 432 */ 433 boolean needsOtaServiceProvisioning(); 434 435 /** 436 * Sets the voicemail number for a particular subscriber. 437 */ 438 boolean setVoiceMailNumber(int subId, String alphaTag, String number); 439 440 /** 441 * Returns the unread count of voicemails 442 */ 443 int getVoiceMessageCount(); 444 445 /** 446 * Returns the unread count of voicemails for a subId. 447 * @param subId user preferred subId. 448 * Returns the unread count of voicemails 449 */ 450 int getVoiceMessageCountForSubscriber(int subId); 451 452 /** 453 * Returns the network type for data transmission 454 * Legacy call, permission-free 455 */ 456 int getNetworkType(); 457 458 /** 459 * Returns the network type of a subId. 460 * @param subId user preferred subId. 461 * @param callingPackage package making the call. 462 */ 463 int getNetworkTypeForSubscriber(int subId, String callingPackage); 464 465 /** 466 * Returns the network type for data transmission 467 * @param callingPackage package making the call. 468 */ 469 int getDataNetworkType(String callingPackage); 470 471 /** 472 * Returns the data network type of a subId 473 * @param subId user preferred subId. 474 * @param callingPackage package making the call. 475 */ 476 int getDataNetworkTypeForSubscriber(int subId, String callingPackage); 477 478 /** 479 * Returns the voice network type of a subId 480 * @param subId user preferred subId. 481 * @param callingPackage package making the call. 482 * Returns the network type 483 */ 484 int getVoiceNetworkTypeForSubscriber(int subId, String callingPackage); 485 486 /** 487 * Return true if an ICC card is present 488 */ 489 boolean hasIccCard(); 490 491 /** 492 * Return true if an ICC card is present for a subId. 493 * @param slotId user preferred slotId. 494 * Return true if an ICC card is present 495 */ 496 boolean hasIccCardUsingSlotId(int slotId); 497 498 /** 499 * Return if the current radio is LTE on CDMA. This 500 * is a tri-state return value as for a period of time 501 * the mode may be unknown. 502 * 503 * @param callingPackage the name of the calling package 504 * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE} 505 * or {@link PHone#LTE_ON_CDMA_TRUE} 506 */ 507 int getLteOnCdmaMode(String callingPackage); 508 509 /** 510 * Return if the current radio is LTE on CDMA. This 511 * is a tri-state return value as for a period of time 512 * the mode may be unknown. 513 * 514 * @param callingPackage the name of the calling package 515 * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE} 516 * or {@link PHone#LTE_ON_CDMA_TRUE} 517 */ 518 int getLteOnCdmaModeForSubscriber(int subId, String callingPackage); 519 520 /** 521 * Returns the all observed cell information of the device. 522 */ 523 List<CellInfo> getAllCellInfo(String callingPkg); 524 525 /** 526 * Sets minimum time in milli-seconds between onCellInfoChanged 527 */ 528 void setCellInfoListRate(int rateInMillis); 529 530 /** 531 * get default sim 532 * @return sim id 533 */ 534 int getDefaultSim(); 535 536 /** 537 * Opens a logical channel to the ICC card. 538 * 539 * Input parameters equivalent to TS 27.007 AT+CCHO command. 540 * 541 * @param AID Application id. See ETSI 102.221 and 101.220. 542 * @return an IccOpenLogicalChannelResponse object. 543 */ 544 IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID); 545 546 /** 547 * Closes a previously opened logical channel to the ICC card. 548 * 549 * Input parameters equivalent to TS 27.007 AT+CCHC command. 550 * 551 * @param channel is the channel id to be closed as retruned by a 552 * successful iccOpenLogicalChannel. 553 * @return true if the channel was closed successfully. 554 */ 555 boolean iccCloseLogicalChannel(int channel); 556 557 /** 558 * Transmit an APDU to the ICC card over a logical channel. 559 * 560 * Input parameters equivalent to TS 27.007 AT+CGLA command. 561 * 562 * @param channel is the channel id to be closed as retruned by a 563 * successful iccOpenLogicalChannel. 564 * @param cla Class of the APDU command. 565 * @param instruction Instruction of the APDU command. 566 * @param p1 P1 value of the APDU command. 567 * @param p2 P2 value of the APDU command. 568 * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU 569 * is sent to the SIM. 570 * @param data Data to be sent with the APDU. 571 * @return The APDU response from the ICC card with the status appended at 572 * the end. 573 */ 574 String iccTransmitApduLogicalChannel(int channel, int cla, int instruction, 575 int p1, int p2, int p3, String data); 576 577 /** 578 * Transmit an APDU to the ICC card over the basic channel. 579 * 580 * Input parameters equivalent to TS 27.007 AT+CSIM command. 581 * 582 * @param cla Class of the APDU command. 583 * @param instruction Instruction of the APDU command. 584 * @param p1 P1 value of the APDU command. 585 * @param p2 P2 value of the APDU command. 586 * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU 587 * is sent to the SIM. 588 * @param data Data to be sent with the APDU. 589 * @return The APDU response from the ICC card with the status appended at 590 * the end. 591 */ 592 String iccTransmitApduBasicChannel(int cla, int instruction, 593 int p1, int p2, int p3, String data); 594 595 /** 596 * Returns the response APDU for a command APDU sent through SIM_IO. 597 * 598 * @param fileID 599 * @param command 600 * @param p1 P1 value of the APDU command. 601 * @param p2 P2 value of the APDU command. 602 * @param p3 P3 value of the APDU command. 603 * @param filePath 604 * @return The APDU response. 605 */ 606 byte[] iccExchangeSimIO(int fileID, int command, int p1, int p2, int p3, 607 String filePath); 608 609 /** 610 * Send ENVELOPE to the SIM and returns the response. 611 * 612 * @param contents String containing SAT/USAT response in hexadecimal 613 * format starting with command tag. See TS 102 223 for 614 * details. 615 * @return The APDU response from the ICC card, with the last 4 bytes 616 * being the status word. If the command fails, returns an empty 617 * string. 618 */ 619 String sendEnvelopeWithStatus(String content); 620 621 /** 622 * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}. 623 * Used for device configuration by some CDMA operators. 624 * 625 * @param itemID the ID of the item to read. 626 * @return the NV item as a String, or null on any failure. 627 */ 628 String nvReadItem(int itemID); 629 630 /** 631 * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}. 632 * Used for device configuration by some CDMA operators. 633 * 634 * @param itemID the ID of the item to read. 635 * @param itemValue the value to write, as a String. 636 * @return true on success; false on any failure. 637 */ 638 boolean nvWriteItem(int itemID, String itemValue); 639 640 /** 641 * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage. 642 * Used for device configuration by some CDMA operators. 643 * 644 * @param preferredRoamingList byte array containing the new PRL. 645 * @return true on success; false on any failure. 646 */ 647 boolean nvWriteCdmaPrl(in byte[] preferredRoamingList); 648 649 /** 650 * Perform the specified type of NV config reset. The radio will be taken offline 651 * and the device must be rebooted after the operation. Used for device 652 * configuration by some CDMA operators. 653 * 654 * @param resetType the type of reset to perform (1 == factory reset; 2 == NV-only reset). 655 * @return true on success; false on any failure. 656 */ 657 boolean nvResetConfig(int resetType); 658 659 /* 660 * Get the calculated preferred network type. 661 * Used for device configuration by some CDMA operators. 662 * @param callingPackage The package making the call. 663 * 664 * @return the calculated preferred network type, defined in RILConstants.java. 665 */ 666 int getCalculatedPreferredNetworkType(String callingPackage); 667 668 /* 669 * Get the preferred network type. 670 * Used for device configuration by some CDMA operators. 671 * 672 * @param subId the id of the subscription to query. 673 * @return the preferred network type, defined in RILConstants.java. 674 */ 675 int getPreferredNetworkType(int subId); 676 677 /** 678 * Check TETHER_DUN_REQUIRED and TETHER_DUN_APN settings, net.tethering.noprovisioning 679 * SystemProperty, and config_tether_apndata to decide whether DUN APN is required for 680 * tethering. 681 * 682 * @return 0: Not required. 1: required. 2: Not set. 683 */ 684 int getTetherApnRequired(); 685 686 /** 687 * Set the network selection mode to automatic. 688 * 689 * @param subId the id of the subscription to update. 690 */ 691 void setNetworkSelectionModeAutomatic(int subId); 692 693 /** 694 * Perform a radio scan and return the list of avialble networks. 695 * 696 * @param subId the id of the subscription. 697 * @return CellNetworkScanResult containing status of scan and networks. 698 */ 699 CellNetworkScanResult getCellNetworkScanResults(int subId); 700 701 /** 702 * Ask the radio to connect to the input network and change selection mode to manual. 703 * 704 * @param subId the id of the subscription. 705 * @param operatorInfo the operator to attach to. 706 * @param persistSelection should the selection persist till reboot or its 707 * turned off? Will also result in notification being not shown to 708 * the user if the signal is lost. 709 * @return true if the request suceeded. 710 */ 711 boolean setNetworkSelectionModeManual(int subId, in OperatorInfo operator, 712 boolean persistSelection); 713 714 /** 715 * Set the preferred network type. 716 * Used for device configuration by some CDMA operators. 717 * 718 * @param subId the id of the subscription to update. 719 * @param networkType the preferred network type, defined in RILConstants.java. 720 * @return true on success; false on any failure. 721 */ 722 boolean setPreferredNetworkType(int subId, int networkType); 723 724 /** 725 * User enable/disable Mobile Data. 726 * 727 * @param enable true to turn on, else false 728 */ 729 void setDataEnabled(int subId, boolean enable); 730 731 /** 732 * Get the user enabled state of Mobile Data. 733 * 734 * @return true on enabled 735 */ 736 boolean getDataEnabled(int subId); 737 738 /** 739 * Get P-CSCF address from PCO after data connection is established or modified. 740 * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN 741 * @param callingPackage The package making the call. 742 */ 743 String[] getPcscfAddress(String apnType, String callingPackage); 744 745 /** 746 * Set IMS registration state 747 */ 748 void setImsRegistrationState(boolean registered); 749 750 /** 751 * Return MDN string for CDMA phone. 752 * @param subId user preferred subId. 753 */ 754 String getCdmaMdn(int subId); 755 756 /** 757 * Return MIN string for CDMA phone. 758 * @param subId user preferred subId. 759 */ 760 String getCdmaMin(int subId); 761 762 /** 763 * Has the calling application been granted special privileges by the carrier. 764 * 765 * If any of the packages in the calling UID has carrier privileges, the 766 * call will return true. This access is granted by the owner of the UICC 767 * card and does not depend on the registered carrier. 768 * 769 * TODO: Add a link to documentation. 770 * 771 * @return carrier privilege status defined in TelephonyManager. 772 */ 773 int getCarrierPrivilegeStatus(); 774 775 /** 776 * Similar to above, but check for the package whose name is pkgName. 777 */ 778 int checkCarrierPrivilegesForPackage(String pkgName); 779 780 /** 781 * Similar to above, but check across all phones. 782 */ 783 int checkCarrierPrivilegesForPackageAnyPhone(String pkgName); 784 785 /** 786 * Returns list of the package names of the carrier apps that should handle the input intent 787 * and have carrier privileges for the given phoneId. 788 * 789 * @param intent Intent that will be sent. 790 * @param phoneId The phoneId on which the carrier app has carrier privileges. 791 * @return list of carrier app package names that can handle the intent on phoneId. 792 * Returns null if there is an error and an empty list if there 793 * are no matching packages. 794 */ 795 List<String> getCarrierPackageNamesForIntentAndPhone(in Intent intent, int phoneId); 796 797 /** 798 * Set the line 1 phone number string and its alphatag for the current ICCID 799 * for display purpose only, for example, displayed in Phone Status. It won't 800 * change the actual MSISDN/MDN. To unset alphatag or number, pass in a null 801 * value. 802 * 803 * @param subId the subscriber that the alphatag and dialing number belongs to. 804 * @param alphaTag alpha-tagging of the dailing nubmer 805 * @param number The dialing number 806 * @return true if the operation was executed correctly. 807 */ 808 boolean setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number); 809 810 /** 811 * Returns the displayed dialing number string if it was set previously via 812 * {@link #setLine1NumberForDisplay}. Otherwise returns null. 813 * 814 * @param subId whose dialing number for line 1 is returned. 815 * @param callingPackage The package making the call. 816 * @return the displayed dialing number if set, or null if not set. 817 */ 818 String getLine1NumberForDisplay(int subId, String callingPackage); 819 820 /** 821 * Returns the displayed alphatag of the dialing number if it was set 822 * previously via {@link #setLine1NumberForDisplay}. Otherwise returns null. 823 * 824 * @param subId whose alphatag associated with line 1 is returned. 825 * @param callingPackage The package making the call. 826 * @return the displayed alphatag of the dialing number if set, or null if 827 * not set. 828 */ 829 String getLine1AlphaTagForDisplay(int subId, String callingPackage); 830 831 String[] getMergedSubscriberIds(String callingPackage); 832 833 /** 834 * Override the operator branding for the current ICCID. 835 * 836 * Once set, whenever the SIM is present in the device, the service 837 * provider name (SPN) and the operator name will both be replaced by the 838 * brand value input. To unset the value, the same function should be 839 * called with a null brand value. 840 * 841 * <p>Requires Permission: 842 * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} 843 * or has to be carrier app - see #hasCarrierPrivileges. 844 * 845 * @param brand The brand name to display/set. 846 * @return true if the operation was executed correctly. 847 */ 848 boolean setOperatorBrandOverride(String brand); 849 850 /** 851 * Override the roaming indicator for the current ICCID. 852 * 853 * Using this call, the carrier app (see #hasCarrierPrivileges) can override 854 * the platform's notion of a network operator being considered roaming or not. 855 * The change only affects the ICCID that was active when this call was made. 856 * 857 * If null is passed as any of the input, the corresponding value is deleted. 858 * 859 * <p>Requires that the caller have carrier privilege. See #hasCarrierPrivileges. 860 * 861 * @param gsmRoamingList - List of MCCMNCs to be considered roaming for 3GPP RATs. 862 * @param gsmNonRoamingList - List of MCCMNCs to be considered not roaming for 3GPP RATs. 863 * @param cdmaRoamingList - List of SIDs to be considered roaming for 3GPP2 RATs. 864 * @param cdmaNonRoamingList - List of SIDs to be considered not roaming for 3GPP2 RATs. 865 * @return true if the operation was executed correctly. 866 */ 867 boolean setRoamingOverride(in List<String> gsmRoamingList, 868 in List<String> gsmNonRoamingList, in List<String> cdmaRoamingList, 869 in List<String> cdmaNonRoamingList); 870 871 /** 872 * Returns the result and response from RIL for oem request 873 * 874 * @param oemReq the data is sent to ril. 875 * @param oemResp the respose data from RIL. 876 * @return negative value request was not handled or get error 877 * 0 request was handled succesfully, but no response data 878 * positive value success, data length of response 879 */ 880 int invokeOemRilRequestRaw(in byte[] oemReq, out byte[] oemResp); 881 882 /** 883 * Check if any mobile Radios need to be shutdown. 884 * 885 * @return true is any mobile radio needs to be shutdown 886 */ 887 boolean needMobileRadioShutdown(); 888 889 /** 890 * Shutdown Mobile Radios 891 */ 892 void shutdownMobileRadios(); 893 894 /** 895 * Set phone radio type and access technology. 896 * 897 * @param rafs an RadioAccessFamily array to indicate all phone's 898 * new radio access family. The length of RadioAccessFamily 899 * must equ]]al to phone count. 900 */ 901 void setRadioCapability(in RadioAccessFamily[] rafs); 902 903 /** 904 * Get phone radio type and access technology. 905 * 906 * @param phoneId which phone you want to get 907 * @param callingPackage the name of the package making the call 908 * @return phone radio type and access technology 909 */ 910 int getRadioAccessFamily(in int phoneId, String callingPackage); 911 912 /** 913 * Enables or disables video calling. 914 * 915 * @param enable Whether to enable video calling. 916 */ 917 void enableVideoCalling(boolean enable); 918 919 /** 920 * Whether video calling has been enabled by the user. 921 * 922 * @param callingPackage The package making the call. 923 * @return {@code true} if the user has enabled video calling, {@code false} otherwise. 924 */ 925 boolean isVideoCallingEnabled(String callingPackage); 926 927 /** 928 * Whether the DTMF tone length can be changed. 929 * 930 * @return {@code true} if the DTMF tone length can be changed. 931 */ 932 boolean canChangeDtmfToneLength(); 933 934 /** 935 * Whether the device is a world phone. 936 * 937 * @return {@code true} if the devices is a world phone. 938 */ 939 boolean isWorldPhone(); 940 941 /** 942 * Whether the phone supports TTY mode. 943 * 944 * @return {@code true} if the device supports TTY mode. 945 */ 946 boolean isTtyModeSupported(); 947 948 /** 949 * Whether the phone supports hearing aid compatibility. 950 * 951 * @return {@code true} if the device supports hearing aid compatibility. 952 */ 953 boolean isHearingAidCompatibilitySupported(); 954 955 /** 956 * Get IMS Registration Status 957 */ 958 boolean isImsRegistered(); 959 960 /** 961 * Returns the Status of Wi-Fi Calling 962 */ 963 boolean isWifiCallingAvailable(); 964 965 /** 966 * Returns the Status of Volte 967 */ 968 boolean isVolteAvailable(); 969 970 /** 971 * Returns the Status of VT (video telephony) 972 */ 973 boolean isVideoTelephonyAvailable(); 974 975 /** 976 * Returns the unique device ID of phone, for example, the IMEI for 977 * GSM and the MEID for CDMA phones. Return null if device ID is not available. 978 * 979 * @param callingPackage The package making the call. 980 * <p>Requires Permission: 981 * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} 982 */ 983 String getDeviceId(String callingPackage); 984 985 /** 986 * Returns the subscription ID associated with the specified PhoneAccount. 987 */ 988 int getSubIdForPhoneAccount(in PhoneAccount phoneAccount); 989 990 void factoryReset(int subId); 991 992 /** 993 * An estimate of the users's current locale based on the default SIM. 994 * 995 * The returned string will be a well formed BCP-47 language tag, or {@code null} 996 * if no locale could be derived. 997 */ 998 String getLocaleFromDefaultSim(); 999 1000 /** 1001 * Return the modem activity info. 1002 */ 1003 ModemActivityInfo getModemActivityInfo(); 1004 1005 /** 1006 * Get the service state on specified subscription 1007 * @param subId Subscription id 1008 * @param callingPackage The package making the call 1009 * @return Service state on specified subscription. 1010 */ 1011 ServiceState getServiceStateForSubscriber(int subId, String callingPackage); 1012 1013 /** 1014 * Returns the URI for the per-account voicemail ringtone set in Phone settings. 1015 * 1016 * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the 1017 * voicemail ringtone. 1018 * @return The URI for the ringtone to play when receiving a voicemail from a specific 1019 * PhoneAccount. 1020 */ 1021 Uri getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle); 1022 1023 /** 1024 * Returns whether vibration is set for voicemail notification in Phone settings. 1025 * 1026 * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the 1027 * voicemail vibration setting. 1028 * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise. 1029 */ 1030 boolean isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle); 1031} 1032