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