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