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