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