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 17 package com.android.internal.telephony; 18 19 import android.content.Context; 20 import android.net.LinkProperties; 21 import android.net.NetworkCapabilities; 22 import android.os.Handler; 23 import android.os.Message; 24 import android.telephony.CellInfo; 25 import android.telephony.CellLocation; 26 import android.telephony.PhoneStateListener; 27 import android.telephony.ServiceState; 28 import android.telephony.SignalStrength; 29 30 import com.android.internal.telephony.imsphone.ImsPhone; 31 import com.android.internal.telephony.RadioCapability; 32 import com.android.internal.telephony.test.SimulatedRadioControl; 33 import com.android.internal.telephony.uicc.IsimRecords; 34 import com.android.internal.telephony.uicc.UiccCard; 35 import com.android.internal.telephony.uicc.UsimServiceTable; 36 37 import com.android.internal.telephony.PhoneConstants.*; // ???? 38 39 import java.util.List; 40 41 /** 42 * Internal interface used to control the phone; SDK developers cannot 43 * obtain this interface. 44 * 45 * {@hide} 46 * 47 */ 48 public interface Phone { 49 50 /** used to enable additional debug messages */ 51 static final boolean DEBUG_PHONE = true; 52 53 public enum DataActivityState { 54 /** 55 * The state of a data activity. 56 * <ul> 57 * <li>NONE = No traffic</li> 58 * <li>DATAIN = Receiving IP ppp traffic</li> 59 * <li>DATAOUT = Sending IP ppp traffic</li> 60 * <li>DATAINANDOUT = Both receiving and sending IP ppp traffic</li> 61 * <li>DORMANT = The data connection is still active, 62 but physical link is down</li> 63 * </ul> 64 */ 65 NONE, DATAIN, DATAOUT, DATAINANDOUT, DORMANT; 66 } 67 68 enum SuppService { 69 UNKNOWN, SWITCH, SEPARATE, TRANSFER, CONFERENCE, REJECT, HANGUP, RESUME; 70 } 71 72 // "Features" accessible through the connectivity manager 73 static final String FEATURE_ENABLE_MMS = "enableMMS"; 74 static final String FEATURE_ENABLE_SUPL = "enableSUPL"; 75 static final String FEATURE_ENABLE_DUN = "enableDUN"; 76 static final String FEATURE_ENABLE_HIPRI = "enableHIPRI"; 77 static final String FEATURE_ENABLE_DUN_ALWAYS = "enableDUNAlways"; 78 static final String FEATURE_ENABLE_FOTA = "enableFOTA"; 79 static final String FEATURE_ENABLE_IMS = "enableIMS"; 80 static final String FEATURE_ENABLE_CBS = "enableCBS"; 81 static final String FEATURE_ENABLE_EMERGENCY = "enableEmergency"; 82 83 /** 84 * Optional reasons for disconnect and connect 85 */ 86 static final String REASON_ROAMING_ON = "roamingOn"; 87 static final String REASON_ROAMING_OFF = "roamingOff"; 88 static final String REASON_DATA_DISABLED = "dataDisabled"; 89 static final String REASON_DATA_ENABLED = "dataEnabled"; 90 static final String REASON_DATA_ATTACHED = "dataAttached"; 91 static final String REASON_DATA_DETACHED = "dataDetached"; 92 static final String REASON_CDMA_DATA_ATTACHED = "cdmaDataAttached"; 93 static final String REASON_CDMA_DATA_DETACHED = "cdmaDataDetached"; 94 static final String REASON_APN_CHANGED = "apnChanged"; 95 static final String REASON_APN_SWITCHED = "apnSwitched"; 96 static final String REASON_APN_FAILED = "apnFailed"; 97 static final String REASON_RESTORE_DEFAULT_APN = "restoreDefaultApn"; 98 static final String REASON_RADIO_TURNED_OFF = "radioTurnedOff"; 99 static final String REASON_PDP_RESET = "pdpReset"; 100 static final String REASON_VOICE_CALL_ENDED = "2GVoiceCallEnded"; 101 static final String REASON_VOICE_CALL_STARTED = "2GVoiceCallStarted"; 102 static final String REASON_PS_RESTRICT_ENABLED = "psRestrictEnabled"; 103 static final String REASON_PS_RESTRICT_DISABLED = "psRestrictDisabled"; 104 static final String REASON_SIM_LOADED = "simLoaded"; 105 static final String REASON_NW_TYPE_CHANGED = "nwTypeChanged"; 106 static final String REASON_DATA_DEPENDENCY_MET = "dependencyMet"; 107 static final String REASON_DATA_DEPENDENCY_UNMET = "dependencyUnmet"; 108 static final String REASON_LOST_DATA_CONNECTION = "lostDataConnection"; 109 static final String REASON_CONNECTED = "connected"; 110 static final String REASON_SINGLE_PDN_ARBITRATION = "SinglePdnArbitration"; 111 static final String REASON_DATA_SPECIFIC_DISABLED = "specificDisabled"; 112 113 // Used for band mode selection methods 114 static final int BM_UNSPECIFIED = 0; // selected by baseband automatically 115 static final int BM_EURO_BAND = 1; // GSM-900 / DCS-1800 / WCDMA-IMT-2000 116 static final int BM_US_BAND = 2; // GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900 117 static final int BM_JPN_BAND = 3; // WCDMA-800 / WCDMA-IMT-2000 118 static final int BM_AUS_BAND = 4; // GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000 119 static final int BM_AUS2_BAND = 5; // GSM-900 / DCS-1800 / WCDMA-850 120 static final int BM_BOUNDARY = 6; // upper band boundary 121 122 // Used for preferred network type 123 // Note NT_* substitute RILConstants.NETWORK_MODE_* above the Phone 124 int NT_MODE_WCDMA_PREF = RILConstants.NETWORK_MODE_WCDMA_PREF; 125 int NT_MODE_GSM_ONLY = RILConstants.NETWORK_MODE_GSM_ONLY; 126 int NT_MODE_WCDMA_ONLY = RILConstants.NETWORK_MODE_WCDMA_ONLY; 127 int NT_MODE_GSM_UMTS = RILConstants.NETWORK_MODE_GSM_UMTS; 128 129 int NT_MODE_CDMA = RILConstants.NETWORK_MODE_CDMA; 130 131 int NT_MODE_CDMA_NO_EVDO = RILConstants.NETWORK_MODE_CDMA_NO_EVDO; 132 int NT_MODE_EVDO_NO_CDMA = RILConstants.NETWORK_MODE_EVDO_NO_CDMA; 133 int NT_MODE_GLOBAL = RILConstants.NETWORK_MODE_GLOBAL; 134 135 int NT_MODE_LTE_CDMA_AND_EVDO = RILConstants.NETWORK_MODE_LTE_CDMA_EVDO; 136 int NT_MODE_LTE_GSM_WCDMA = RILConstants.NETWORK_MODE_LTE_GSM_WCDMA; 137 int NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA = RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA; 138 int NT_MODE_LTE_ONLY = RILConstants.NETWORK_MODE_LTE_ONLY; 139 int NT_MODE_LTE_WCDMA = RILConstants.NETWORK_MODE_LTE_WCDMA; 140 int PREFERRED_NT_MODE = RILConstants.PREFERRED_NETWORK_MODE; 141 142 // Used for CDMA roaming mode 143 static final int CDMA_RM_HOME = 0; // Home Networks only, as defined in PRL 144 static final int CDMA_RM_AFFILIATED = 1; // Roaming an Affiliated networks, as defined in PRL 145 static final int CDMA_RM_ANY = 2; // Roaming on Any Network, as defined in PRL 146 147 // Used for CDMA subscription mode 148 static final int CDMA_SUBSCRIPTION_UNKNOWN =-1; // Unknown 149 static final int CDMA_SUBSCRIPTION_RUIM_SIM = 0; // RUIM/SIM (default) 150 static final int CDMA_SUBSCRIPTION_NV = 1; // NV -> non-volatile memory 151 152 static final int PREFERRED_CDMA_SUBSCRIPTION = CDMA_SUBSCRIPTION_NV; 153 154 static final int TTY_MODE_OFF = 0; 155 static final int TTY_MODE_FULL = 1; 156 static final int TTY_MODE_HCO = 2; 157 static final int TTY_MODE_VCO = 3; 158 159 /** 160 * CDMA OTA PROVISION STATUS, the same as RIL_CDMA_OTA_Status in ril.h 161 */ 162 163 public static final int CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED = 0; 164 public static final int CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED = 1; 165 public static final int CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED = 2; 166 public static final int CDMA_OTA_PROVISION_STATUS_SSD_UPDATED = 3; 167 public static final int CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED = 4; 168 public static final int CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED = 5; 169 public static final int CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED = 6; 170 public static final int CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED = 7; 171 public static final int CDMA_OTA_PROVISION_STATUS_COMMITTED = 8; 172 public static final int CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED = 9; 173 public static final int CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED = 10; 174 public static final int CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED = 11; 175 176 177 /** 178 * Get the current ServiceState. Use 179 * <code>registerForServiceStateChanged</code> to be informed of 180 * updates. 181 */ 182 ServiceState getServiceState(); 183 184 /** 185 * Get the current CellLocation. 186 */ 187 CellLocation getCellLocation(); 188 189 /** 190 * @return all available cell information or null if none. 191 */ 192 public List<CellInfo> getAllCellInfo(); 193 194 /** 195 * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged 196 * PhoneStateListener.onCellInfoChanged} will be invoked. 197 * 198 * The default, 0, means invoke onCellInfoChanged when any of the reported 199 * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue 200 * A onCellInfoChanged. 201 * 202 * @param rateInMillis the rate 203 */ 204 public void setCellInfoListRate(int rateInMillis); 205 206 /** 207 * Get the current for the default apn DataState. No change notification 208 * exists at this interface -- use 209 * {@link android.telephony.PhoneStateListener} instead. 210 */ 211 DataState getDataConnectionState(); 212 213 /** 214 * Get the current DataState. No change notification exists at this 215 * interface -- use 216 * {@link android.telephony.PhoneStateListener} instead. 217 * @param apnType specify for which apn to get connection state info. 218 */ 219 DataState getDataConnectionState(String apnType); 220 221 /** 222 * Get the current DataActivityState. No change notification exists at this 223 * interface -- use 224 * {@link android.telephony.TelephonyManager} instead. 225 */ 226 DataActivityState getDataActivityState(); 227 228 /** 229 * Gets the context for the phone, as set at initialization time. 230 */ 231 Context getContext(); 232 233 /** 234 * Disables the DNS check (i.e., allows "0.0.0.0"). 235 * Useful for lab testing environment. 236 * @param b true disables the check, false enables. 237 */ 238 void disableDnsCheck(boolean b); 239 240 /** 241 * Returns true if the DNS check is currently disabled. 242 */ 243 boolean isDnsCheckDisabled(); 244 245 /** 246 * Get current coarse-grained voice call state. 247 * Use {@link #registerForPreciseCallStateChanged(Handler, int, Object) 248 * registerForPreciseCallStateChanged()} for change notification. <p> 249 * If the phone has an active call and call waiting occurs, 250 * then the phone state is RINGING not OFFHOOK 251 * <strong>Note:</strong> 252 * This registration point provides notification of finer-grained 253 * changes.<p> 254 * 255 */ 256 State getState(); 257 258 /** 259 * Returns a string identifier for this phone interface for parties 260 * outside the phone app process. 261 * @return The string name. 262 */ 263 String getPhoneName(); 264 265 /** 266 * Return a numerical identifier for the phone radio interface. 267 * @return PHONE_TYPE_XXX as defined above. 268 */ 269 int getPhoneType(); 270 271 /** 272 * Returns an array of string identifiers for the APN types serviced by the 273 * currently active. 274 * @return The string array will always return at least one entry, Phone.APN_TYPE_DEFAULT. 275 * TODO: Revisit if we always should return at least one entry. 276 */ 277 String[] getActiveApnTypes(); 278 279 /** 280 * Check if TETHER_DUN_APN setting or config_tether_apndata includes APN that matches 281 * current operator. 282 * @return true if there is a matching DUN APN. 283 */ 284 boolean hasMatchedTetherApnSetting(); 285 286 /** 287 * Returns string for the active APN host. 288 * @return type as a string or null if none. 289 */ 290 String getActiveApnHost(String apnType); 291 292 /** 293 * Return the LinkProperties for the named apn or null if not available 294 */ 295 LinkProperties getLinkProperties(String apnType); 296 297 /** 298 * Return the NetworkCapabilities 299 */ 300 NetworkCapabilities getNetworkCapabilities(String apnType); 301 302 /** 303 * Get current signal strength. No change notification available on this 304 * interface. Use <code>PhoneStateNotifier</code> or an equivalent. 305 * An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu). 306 * The following special values are defined:</p> 307 * <ul><li>0 means "-113 dBm or less".</li> 308 * <li>31 means "-51 dBm or greater".</li></ul> 309 * 310 * @return Current signal strength as SignalStrength 311 */ 312 SignalStrength getSignalStrength(); 313 314 /** 315 * Notifies when a previously untracked non-ringing/waiting connection has appeared. 316 * This is likely due to some other entity (eg, SIM card application) initiating a call. 317 */ 318 void registerForUnknownConnection(Handler h, int what, Object obj); 319 320 /** 321 * Unregisters for unknown connection notifications. 322 */ 323 void unregisterForUnknownConnection(Handler h); 324 325 /** 326 * Notifies when a Handover happens due to SRVCC or Silent Redial 327 */ 328 void registerForHandoverStateChanged(Handler h, int what, Object obj); 329 330 /** 331 * Unregisters for handover state notifications 332 */ 333 void unregisterForHandoverStateChanged(Handler h); 334 335 /** 336 * Register for getting notifications for change in the Call State {@link Call.State} 337 * This is called PreciseCallState because the call state is more precise than the 338 * {@link PhoneConstants.State} which can be obtained using the {@link PhoneStateListener} 339 * 340 * Resulting events will have an AsyncResult in <code>Message.obj</code>. 341 * AsyncResult.userData will be set to the obj argument here. 342 * The <em>h</em> parameter is held only by a weak reference. 343 */ 344 void registerForPreciseCallStateChanged(Handler h, int what, Object obj); 345 346 /** 347 * Unregisters for voice call state change notifications. 348 * Extraneous calls are tolerated silently. 349 */ 350 void unregisterForPreciseCallStateChanged(Handler h); 351 352 /** 353 * Notifies when a new ringing or waiting connection has appeared.<p> 354 * 355 * Messages received from this: 356 * Message.obj will be an AsyncResult 357 * AsyncResult.userObj = obj 358 * AsyncResult.result = a Connection. <p> 359 * Please check Connection.isRinging() to make sure the Connection 360 * has not dropped since this message was posted. 361 * If Connection.isRinging() is true, then 362 * Connection.getCall() == Phone.getRingingCall() 363 */ 364 void registerForNewRingingConnection(Handler h, int what, Object obj); 365 366 /** 367 * Unregisters for new ringing connection notification. 368 * Extraneous calls are tolerated silently 369 */ 370 371 void unregisterForNewRingingConnection(Handler h); 372 373 /** 374 * Notifies when an incoming call rings.<p> 375 * 376 * Messages received from this: 377 * Message.obj will be an AsyncResult 378 * AsyncResult.userObj = obj 379 * AsyncResult.result = a Connection. <p> 380 */ 381 void registerForIncomingRing(Handler h, int what, Object obj); 382 383 /** 384 * Unregisters for ring notification. 385 * Extraneous calls are tolerated silently 386 */ 387 388 void unregisterForIncomingRing(Handler h); 389 390 /** 391 * Notifies when out-band ringback tone is needed.<p> 392 * 393 * Messages received from this: 394 * Message.obj will be an AsyncResult 395 * AsyncResult.userObj = obj 396 * AsyncResult.result = boolean, true to start play ringback tone 397 * and false to stop. <p> 398 */ 399 void registerForRingbackTone(Handler h, int what, Object obj); 400 401 /** 402 * Unregisters for ringback tone notification. 403 */ 404 405 void unregisterForRingbackTone(Handler h); 406 407 /** 408 * Notifies when out-band on-hold tone is needed.<p> 409 * 410 * Messages received from this: 411 * Message.obj will be an AsyncResult 412 * AsyncResult.userObj = obj 413 * AsyncResult.result = boolean, true to start play on-hold tone 414 * and false to stop. <p> 415 */ 416 void registerForOnHoldTone(Handler h, int what, Object obj); 417 418 /** 419 * Unregisters for on-hold tone notification. 420 */ 421 422 void unregisterForOnHoldTone(Handler h); 423 424 /** 425 * Registers the handler to reset the uplink mute state to get 426 * uplink audio. 427 */ 428 void registerForResendIncallMute(Handler h, int what, Object obj); 429 430 /** 431 * Unregisters for resend incall mute notifications. 432 */ 433 void unregisterForResendIncallMute(Handler h); 434 435 /** 436 * Notifies when a voice connection has disconnected, either due to local 437 * or remote hangup or error. 438 * 439 * Messages received from this will have the following members:<p> 440 * <ul><li>Message.obj will be an AsyncResult</li> 441 * <li>AsyncResult.userObj = obj</li> 442 * <li>AsyncResult.result = a Connection object that is 443 * no longer connected.</li></ul> 444 */ 445 void registerForDisconnect(Handler h, int what, Object obj); 446 447 /** 448 * Unregisters for voice disconnection notification. 449 * Extraneous calls are tolerated silently 450 */ 451 void unregisterForDisconnect(Handler h); 452 453 454 /** 455 * Register for notifications of initiation of a new MMI code request. 456 * MMI codes for GSM are discussed in 3GPP TS 22.030.<p> 457 * 458 * Example: If Phone.dial is called with "*#31#", then the app will 459 * be notified here.<p> 460 * 461 * The returned <code>Message.obj</code> will contain an AsyncResult. 462 * 463 * <code>obj.result</code> will be an "MmiCode" object. 464 */ 465 void registerForMmiInitiate(Handler h, int what, Object obj); 466 467 /** 468 * Unregisters for new MMI initiate notification. 469 * Extraneous calls are tolerated silently 470 */ 471 void unregisterForMmiInitiate(Handler h); 472 473 /** 474 * Register for notifications that an MMI request has completed 475 * its network activity and is in its final state. This may mean a state 476 * of COMPLETE, FAILED, or CANCELLED. 477 * 478 * <code>Message.obj</code> will contain an AsyncResult. 479 * <code>obj.result</code> will be an "MmiCode" object 480 */ 481 void registerForMmiComplete(Handler h, int what, Object obj); 482 483 /** 484 * Unregisters for MMI complete notification. 485 * Extraneous calls are tolerated silently 486 */ 487 void unregisterForMmiComplete(Handler h); 488 489 /** 490 * Registration point for Ecm timer reset 491 * @param h handler to notify 492 * @param what user-defined message code 493 * @param obj placed in Message.obj 494 */ 495 public void registerForEcmTimerReset(Handler h, int what, Object obj); 496 497 /** 498 * Unregister for notification for Ecm timer reset 499 * @param h Handler to be removed from the registrant list. 500 */ 501 public void unregisterForEcmTimerReset(Handler h); 502 503 /** 504 * Returns a list of MMI codes that are pending. (They have initiated 505 * but have not yet completed). 506 * Presently there is only ever one. 507 * Use <code>registerForMmiInitiate</code> 508 * and <code>registerForMmiComplete</code> for change notification. 509 */ 510 public List<? extends MmiCode> getPendingMmiCodes(); 511 512 /** 513 * Sends user response to a USSD REQUEST message. An MmiCode instance 514 * representing this response is sent to handlers registered with 515 * registerForMmiInitiate. 516 * 517 * @param ussdMessge Message to send in the response. 518 */ 519 public void sendUssdResponse(String ussdMessge); 520 521 /** 522 * Register for ServiceState changed. 523 * Message.obj will contain an AsyncResult. 524 * AsyncResult.result will be a ServiceState instance 525 */ 526 void registerForServiceStateChanged(Handler h, int what, Object obj); 527 528 /** 529 * Unregisters for ServiceStateChange notification. 530 * Extraneous calls are tolerated silently 531 */ 532 void unregisterForServiceStateChanged(Handler h); 533 534 /** 535 * Register for Supplementary Service notifications from the network. 536 * Message.obj will contain an AsyncResult. 537 * AsyncResult.result will be a SuppServiceNotification instance. 538 * 539 * @param h Handler that receives the notification message. 540 * @param what User-defined message code. 541 * @param obj User object. 542 */ 543 void registerForSuppServiceNotification(Handler h, int what, Object obj); 544 545 /** 546 * Unregisters for Supplementary Service notifications. 547 * Extraneous calls are tolerated silently 548 * 549 * @param h Handler to be removed from the registrant list. 550 */ 551 void unregisterForSuppServiceNotification(Handler h); 552 553 /** 554 * Register for notifications when a supplementary service attempt fails. 555 * Message.obj will contain an AsyncResult. 556 * 557 * @param h Handler that receives the notification message. 558 * @param what User-defined message code. 559 * @param obj User object. 560 */ 561 void registerForSuppServiceFailed(Handler h, int what, Object obj); 562 563 /** 564 * Unregister for notifications when a supplementary service attempt fails. 565 * Extraneous calls are tolerated silently 566 * 567 * @param h Handler to be removed from the registrant list. 568 */ 569 void unregisterForSuppServiceFailed(Handler h); 570 571 /** 572 * Register for notifications when a sInCall VoicePrivacy is enabled 573 * 574 * @param h Handler that receives the notification message. 575 * @param what User-defined message code. 576 * @param obj User object. 577 */ 578 void registerForInCallVoicePrivacyOn(Handler h, int what, Object obj); 579 580 /** 581 * Unegister for notifications when a sInCall VoicePrivacy is enabled 582 * 583 * @param h Handler to be removed from the registrant list. 584 */ 585 void unregisterForInCallVoicePrivacyOn(Handler h); 586 587 /** 588 * Register for notifications when a sInCall VoicePrivacy is disabled 589 * 590 * @param h Handler that receives the notification message. 591 * @param what User-defined message code. 592 * @param obj User object. 593 */ 594 void registerForInCallVoicePrivacyOff(Handler h, int what, Object obj); 595 596 /** 597 * Unregister for notifications when a sInCall VoicePrivacy is disabled 598 * 599 * @param h Handler to be removed from the registrant list. 600 */ 601 void unregisterForInCallVoicePrivacyOff(Handler h); 602 603 /** 604 * Register for notifications when CDMA OTA Provision status change 605 * 606 * @param h Handler that receives the notification message. 607 * @param what User-defined message code. 608 * @param obj User object. 609 */ 610 void registerForCdmaOtaStatusChange(Handler h, int what, Object obj); 611 612 /** 613 * Unregister for notifications when CDMA OTA Provision status change 614 * @param h Handler to be removed from the registrant list. 615 */ 616 void unregisterForCdmaOtaStatusChange(Handler h); 617 618 /** 619 * Registration point for subscription info ready 620 * @param h handler to notify 621 * @param what what code of message when delivered 622 * @param obj placed in Message.obj 623 */ 624 public void registerForSubscriptionInfoReady(Handler h, int what, Object obj); 625 626 /** 627 * Unregister for notifications for subscription info 628 * @param h Handler to be removed from the registrant list. 629 */ 630 public void unregisterForSubscriptionInfoReady(Handler h); 631 632 /** 633 * Registration point for Sim records loaded 634 * @param h handler to notify 635 * @param what what code of message when delivered 636 * @param obj placed in Message.obj 637 */ 638 public void registerForSimRecordsLoaded(Handler h, int what, Object obj); 639 640 /** 641 * Unregister for notifications for Sim records loaded 642 * @param h Handler to be removed from the registrant list. 643 */ 644 public void unregisterForSimRecordsLoaded(Handler h); 645 646 /** 647 * Register for TTY mode change notifications from the network. 648 * Message.obj will contain an AsyncResult. 649 * AsyncResult.result will be an Integer containing new mode. 650 * 651 * @param h Handler that receives the notification message. 652 * @param what User-defined message code. 653 * @param obj User object. 654 */ 655 public void registerForTtyModeReceived(Handler h, int what, Object obj); 656 657 /** 658 * Unregisters for TTY mode change notifications. 659 * Extraneous calls are tolerated silently 660 * 661 * @param h Handler to be removed from the registrant list. 662 */ 663 public void unregisterForTtyModeReceived(Handler h); 664 665 /** 666 * Returns SIM record load state. Use 667 * <code>getSimCard().registerForReady()</code> for change notification. 668 * 669 * @return true if records from the SIM have been loaded and are 670 * available (if applicable). If not applicable to the underlying 671 * technology, returns true as well. 672 */ 673 boolean getIccRecordsLoaded(); 674 675 /** 676 * Returns the ICC card interface for this phone, or null 677 * if not applicable to underlying technology. 678 */ 679 IccCard getIccCard(); 680 681 /** 682 * Answers a ringing or waiting call. Active calls, if any, go on hold. 683 * Answering occurs asynchronously, and final notification occurs via 684 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, 685 * java.lang.Object) registerForPreciseCallStateChanged()}. 686 * 687 * @param videoState The video state in which to answer the call. 688 * @exception CallStateException when no call is ringing or waiting 689 */ 690 void acceptCall(int videoState) throws CallStateException; 691 692 /** 693 * Reject (ignore) a ringing call. In GSM, this means UDUB 694 * (User Determined User Busy). Reject occurs asynchronously, 695 * and final notification occurs via 696 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, 697 * java.lang.Object) registerForPreciseCallStateChanged()}. 698 * 699 * @exception CallStateException when no call is ringing or waiting 700 */ 701 void rejectCall() throws CallStateException; 702 703 /** 704 * Places any active calls on hold, and makes any held calls 705 * active. Switch occurs asynchronously and may fail. 706 * Final notification occurs via 707 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, 708 * java.lang.Object) registerForPreciseCallStateChanged()}. 709 * 710 * @exception CallStateException if a call is ringing, waiting, or 711 * dialing/alerting. In these cases, this operation may not be performed. 712 */ 713 void switchHoldingAndActive() throws CallStateException; 714 715 /** 716 * Whether or not the phone can conference in the current phone 717 * state--that is, one call holding and one call active. 718 * @return true if the phone can conference; false otherwise. 719 */ 720 boolean canConference(); 721 722 /** 723 * Conferences holding and active. Conference occurs asynchronously 724 * and may fail. Final notification occurs via 725 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, 726 * java.lang.Object) registerForPreciseCallStateChanged()}. 727 * 728 * @exception CallStateException if canConference() would return false. 729 * In these cases, this operation may not be performed. 730 */ 731 void conference() throws CallStateException; 732 733 /** 734 * Enable or disable enhanced Voice Privacy (VP). If enhanced VP is 735 * disabled, normal VP is enabled. 736 * 737 * @param enable whether true or false to enable or disable. 738 * @param onComplete a callback message when the action is completed. 739 */ 740 void enableEnhancedVoicePrivacy(boolean enable, Message onComplete); 741 742 /** 743 * Get the currently set Voice Privacy (VP) mode. 744 * 745 * @param onComplete a callback message when the action is completed. 746 */ 747 void getEnhancedVoicePrivacy(Message onComplete); 748 749 /** 750 * Whether or not the phone can do explicit call transfer in the current 751 * phone state--that is, one call holding and one call active. 752 * @return true if the phone can do explicit call transfer; false otherwise. 753 */ 754 boolean canTransfer(); 755 756 /** 757 * Connects the two calls and disconnects the subscriber from both calls 758 * Explicit Call Transfer occurs asynchronously 759 * and may fail. Final notification occurs via 760 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, 761 * java.lang.Object) registerForPreciseCallStateChanged()}. 762 * 763 * @exception CallStateException if canTransfer() would return false. 764 * In these cases, this operation may not be performed. 765 */ 766 void explicitCallTransfer() throws CallStateException; 767 768 /** 769 * Clears all DISCONNECTED connections from Call connection lists. 770 * Calls that were in the DISCONNECTED state become idle. This occurs 771 * synchronously. 772 */ 773 void clearDisconnected(); 774 775 776 /** 777 * Gets the foreground call object, which represents all connections that 778 * are dialing or active (all connections 779 * that have their audio path connected).<p> 780 * 781 * The foreground call is a singleton object. It is constant for the life 782 * of this phone. It is never null.<p> 783 * 784 * The foreground call will only ever be in one of these states: 785 * IDLE, ACTIVE, DIALING, ALERTING, or DISCONNECTED. 786 * 787 * State change notification is available via 788 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, 789 * java.lang.Object) registerForPreciseCallStateChanged()}. 790 */ 791 Call getForegroundCall(); 792 793 /** 794 * Gets the background call object, which represents all connections that 795 * are holding (all connections that have been accepted or connected, but 796 * do not have their audio path connected). <p> 797 * 798 * The background call is a singleton object. It is constant for the life 799 * of this phone object . It is never null.<p> 800 * 801 * The background call will only ever be in one of these states: 802 * IDLE, HOLDING or DISCONNECTED. 803 * 804 * State change notification is available via 805 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, 806 * java.lang.Object) registerForPreciseCallStateChanged()}. 807 */ 808 Call getBackgroundCall(); 809 810 /** 811 * Gets the ringing call object, which represents an incoming 812 * connection (if present) that is pending answer/accept. (This connection 813 * may be RINGING or WAITING, and there may be only one.)<p> 814 815 * The ringing call is a singleton object. It is constant for the life 816 * of this phone. It is never null.<p> 817 * 818 * The ringing call will only ever be in one of these states: 819 * IDLE, INCOMING, WAITING or DISCONNECTED. 820 * 821 * State change notification is available via 822 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, 823 * java.lang.Object) registerForPreciseCallStateChanged()}. 824 */ 825 Call getRingingCall(); 826 827 /** 828 * Initiate a new voice connection. This happens asynchronously, so you 829 * cannot assume the audio path is connected (or a call index has been 830 * assigned) until PhoneStateChanged notification has occurred. 831 * 832 * @param dialString The dial string. 833 * @param videoState The desired video state for the connection. 834 * @exception CallStateException if a new outgoing call is not currently 835 * possible because no more call slots exist or a call exists that is 836 * dialing, alerting, ringing, or waiting. Other errors are 837 * handled asynchronously. 838 */ 839 Connection dial(String dialString, int videoState) throws CallStateException; 840 841 /** 842 * Initiate a new voice connection with supplementary User to User 843 * Information. This happens asynchronously, so you cannot assume the audio 844 * path is connected (or a call index has been assigned) until 845 * PhoneStateChanged notification has occurred. 846 * 847 * @param dialString The dial string. 848 * @param uusInfo The UUSInfo. 849 * @param videoState The desired video state for the connection. 850 * @exception CallStateException if a new outgoing call is not currently 851 * possible because no more call slots exist or a call exists 852 * that is dialing, alerting, ringing, or waiting. Other 853 * errors are handled asynchronously. 854 */ 855 Connection dial(String dialString, UUSInfo uusInfo, int videoState) throws CallStateException; 856 857 /** 858 * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated 859 * without SEND (so <code>dial</code> is not appropriate). 860 * 861 * @param dialString the MMI command to be executed. 862 * @return true if MMI command is executed. 863 */ 864 boolean handlePinMmi(String dialString); 865 866 /** 867 * Handles in-call MMI commands. While in a call, or while receiving a 868 * call, use this to execute MMI commands. 869 * see 3GPP 20.030, section 6.5.5.1 for specs on the allowed MMI commands. 870 * 871 * @param command the MMI command to be executed. 872 * @return true if the MMI command is executed. 873 * @throws CallStateException 874 */ 875 boolean handleInCallMmiCommands(String command) throws CallStateException; 876 877 /** 878 * Play a DTMF tone on the active call. Ignored if there is no active call. 879 * @param c should be one of 0-9, '*' or '#'. Other values will be 880 * silently ignored. 881 */ 882 void sendDtmf(char c); 883 884 /** 885 * Start to paly a DTMF tone on the active call. Ignored if there is no active call 886 * or there is a playing DTMF tone. 887 * @param c should be one of 0-9, '*' or '#'. Other values will be 888 * silently ignored. 889 */ 890 void startDtmf(char c); 891 892 /** 893 * Stop the playing DTMF tone. Ignored if there is no playing DTMF 894 * tone or no active call. 895 */ 896 void stopDtmf(); 897 898 /** 899 * send burst DTMF tone, it can send the string as single character or multiple character 900 * ignore if there is no active call or not valid digits string. 901 * Valid digit means only includes characters ISO-LATIN characters 0-9, *, # 902 * The difference between sendDtmf and sendBurstDtmf is sendDtmf only sends one character, 903 * this api can send single character and multiple character, also, this api has response 904 * back to caller. 905 * 906 * @param dtmfString is string representing the dialing digit(s) in the active call 907 * @param on the DTMF ON length in milliseconds, or 0 for default 908 * @param off the DTMF OFF length in milliseconds, or 0 for default 909 * @param onComplete is the callback message when the action is processed by BP 910 * 911 */ 912 void sendBurstDtmf(String dtmfString, int on, int off, Message onComplete); 913 914 /** 915 * Sets the radio power on/off state (off is sometimes 916 * called "airplane mode"). Current state can be gotten via 917 * {@link #getServiceState()}.{@link 918 * android.telephony.ServiceState#getState() getState()}. 919 * <strong>Note: </strong>This request is asynchronous. 920 * getServiceState().getState() will not change immediately after this call. 921 * registerForServiceStateChanged() to find out when the 922 * request is complete. 923 * 924 * @param power true means "on", false means "off". 925 */ 926 void setRadioPower(boolean power); 927 928 /** 929 * Get voice message waiting indicator status. No change notification 930 * available on this interface. Use PhoneStateNotifier or similar instead. 931 * 932 * @return true if there is a voice message waiting 933 */ 934 boolean getMessageWaitingIndicator(); 935 936 /** 937 * Get voice call forwarding indicator status. No change notification 938 * available on this interface. Use PhoneStateNotifier or similar instead. 939 * 940 * @return true if there is a voice call forwarding 941 */ 942 boolean getCallForwardingIndicator(); 943 944 /** 945 * Get the line 1 phone number (MSISDN). For CDMA phones, the MDN is returned 946 * and {@link #getMsisdn()} will return the MSISDN on CDMA/LTE phones.<p> 947 * 948 * @return phone number. May return null if not 949 * available or the SIM is not ready 950 */ 951 String getLine1Number(); 952 953 /** 954 * Returns the alpha tag associated with the msisdn number. 955 * If there is no alpha tag associated or the record is not yet available, 956 * returns a default localized string. <p> 957 */ 958 String getLine1AlphaTag(); 959 960 /** 961 * Sets the MSISDN phone number in the SIM card. 962 * 963 * @param alphaTag the alpha tag associated with the MSISDN phone number 964 * (see getMsisdnAlphaTag) 965 * @param number the new MSISDN phone number to be set on the SIM. 966 * @param onComplete a callback message when the action is completed. 967 * 968 * @return true if req is sent, false otherwise. If req is not sent there will be no response, 969 * that is, onComplete will never be sent. 970 */ 971 boolean setLine1Number(String alphaTag, String number, Message onComplete); 972 973 /** 974 * Get the voice mail access phone number. Typically dialed when the 975 * user holds the "1" key in the phone app. May return null if not 976 * available or the SIM is not ready.<p> 977 */ 978 String getVoiceMailNumber(); 979 980 /** 981 * Returns unread voicemail count. This count is shown when the voicemail 982 * notification is expanded.<p> 983 */ 984 int getVoiceMessageCount(); 985 986 /** 987 * Returns the alpha tag associated with the voice mail number. 988 * If there is no alpha tag associated or the record is not yet available, 989 * returns a default localized string. <p> 990 * 991 * Please use this value instead of some other localized string when 992 * showing a name for this number in the UI. For example, call log 993 * entries should show this alpha tag. <p> 994 * 995 * Usage of this alpha tag in the UI is a common carrier requirement. 996 */ 997 String getVoiceMailAlphaTag(); 998 999 /** 1000 * setVoiceMailNumber 1001 * sets the voicemail number in the SIM card. 1002 * 1003 * @param alphaTag the alpha tag associated with the voice mail number 1004 * (see getVoiceMailAlphaTag) 1005 * @param voiceMailNumber the new voicemail number to be set on the SIM. 1006 * @param onComplete a callback message when the action is completed. 1007 */ 1008 void setVoiceMailNumber(String alphaTag, 1009 String voiceMailNumber, 1010 Message onComplete); 1011 1012 /** 1013 * getCallForwardingOptions 1014 * gets a call forwarding option. The return value of 1015 * ((AsyncResult)onComplete.obj) is an array of CallForwardInfo. 1016 * 1017 * @param commandInterfaceCFReason is one of the valid call forwarding 1018 * CF_REASONS, as defined in 1019 * <code>com.android.internal.telephony.CommandsInterface.</code> 1020 * @param onComplete a callback message when the action is completed. 1021 * @see com.android.internal.telephony.CallForwardInfo for details. 1022 */ 1023 void getCallForwardingOption(int commandInterfaceCFReason, 1024 Message onComplete); 1025 1026 /** 1027 * setCallForwardingOptions 1028 * sets a call forwarding option. 1029 * 1030 * @param commandInterfaceCFReason is one of the valid call forwarding 1031 * CF_REASONS, as defined in 1032 * <code>com.android.internal.telephony.CommandsInterface.</code> 1033 * @param commandInterfaceCFAction is one of the valid call forwarding 1034 * CF_ACTIONS, as defined in 1035 * <code>com.android.internal.telephony.CommandsInterface.</code> 1036 * @param dialingNumber is the target phone number to forward calls to 1037 * @param timerSeconds is used by CFNRy to indicate the timeout before 1038 * forwarding is attempted. 1039 * @param onComplete a callback message when the action is completed. 1040 */ 1041 void setCallForwardingOption(int commandInterfaceCFReason, 1042 int commandInterfaceCFAction, 1043 String dialingNumber, 1044 int timerSeconds, 1045 Message onComplete); 1046 1047 /** 1048 * getOutgoingCallerIdDisplay 1049 * gets outgoing caller id display. The return value of 1050 * ((AsyncResult)onComplete.obj) is an array of int, with a length of 2. 1051 * 1052 * @param onComplete a callback message when the action is completed. 1053 * @see com.android.internal.telephony.CommandsInterface#getCLIR for details. 1054 */ 1055 void getOutgoingCallerIdDisplay(Message onComplete); 1056 1057 /** 1058 * setOutgoingCallerIdDisplay 1059 * sets a call forwarding option. 1060 * 1061 * @param commandInterfaceCLIRMode is one of the valid call CLIR 1062 * modes, as defined in 1063 * <code>com.android.internal.telephony.CommandsInterface./code> 1064 * @param onComplete a callback message when the action is completed. 1065 */ 1066 void setOutgoingCallerIdDisplay(int commandInterfaceCLIRMode, 1067 Message onComplete); 1068 1069 /** 1070 * getCallWaiting 1071 * gets call waiting activation state. The return value of 1072 * ((AsyncResult)onComplete.obj) is an array of int, with a length of 1. 1073 * 1074 * @param onComplete a callback message when the action is completed. 1075 * @see com.android.internal.telephony.CommandsInterface#queryCallWaiting for details. 1076 */ 1077 void getCallWaiting(Message onComplete); 1078 1079 /** 1080 * setCallWaiting 1081 * sets a call forwarding option. 1082 * 1083 * @param enable is a boolean representing the state that you are 1084 * requesting, true for enabled, false for disabled. 1085 * @param onComplete a callback message when the action is completed. 1086 */ 1087 void setCallWaiting(boolean enable, Message onComplete); 1088 1089 /** 1090 * Scan available networks. This method is asynchronous; . 1091 * On completion, <code>response.obj</code> is set to an AsyncResult with 1092 * one of the following members:.<p> 1093 *<ul> 1094 * <li><code>response.obj.result</code> will be a <code>List</code> of 1095 * <code>OperatorInfo</code> objects, or</li> 1096 * <li><code>response.obj.exception</code> will be set with an exception 1097 * on failure.</li> 1098 * </ul> 1099 */ 1100 void getAvailableNetworks(Message response); 1101 1102 /** 1103 * Switches network selection mode to "automatic", re-scanning and 1104 * re-selecting a network if appropriate. 1105 * 1106 * @param response The message to dispatch when the network selection 1107 * is complete. 1108 * 1109 * @see #selectNetworkManually(OperatorInfo, android.os.Message ) 1110 */ 1111 void setNetworkSelectionModeAutomatic(Message response); 1112 1113 /** 1114 * Manually selects a network. <code>response</code> is 1115 * dispatched when this is complete. <code>response.obj</code> will be 1116 * an AsyncResult, and <code>response.obj.exception</code> will be non-null 1117 * on failure. 1118 * 1119 * @see #setNetworkSelectionModeAutomatic(Message) 1120 */ 1121 void selectNetworkManually(OperatorInfo network, 1122 Message response); 1123 1124 /** 1125 * Query the radio for the current network selection mode. 1126 * 1127 * Return values: 1128 * 0 - automatic. 1129 * 1 - manual. 1130 */ 1131 void getNetworkSelectionMode(Message response); 1132 1133 /** 1134 * Requests to set the preferred network type for searching and registering 1135 * (CS/PS domain, RAT, and operation mode) 1136 * @param networkType one of NT_*_TYPE 1137 * @param response is callback message 1138 */ 1139 void setPreferredNetworkType(int networkType, Message response); 1140 1141 /** 1142 * Query the preferred network type setting 1143 * 1144 * @param response is callback message to report one of NT_*_TYPE 1145 */ 1146 void getPreferredNetworkType(Message response); 1147 1148 /** 1149 * Gets the default SMSC address. 1150 * 1151 * @param result Callback message contains the SMSC address. 1152 */ 1153 void getSmscAddress(Message result); 1154 1155 /** 1156 * Sets the default SMSC address. 1157 * 1158 * @param address new SMSC address 1159 * @param result Callback message is empty on completion 1160 */ 1161 void setSmscAddress(String address, Message result); 1162 1163 /** 1164 * Query neighboring cell IDs. <code>response</code> is dispatched when 1165 * this is complete. <code>response.obj</code> will be an AsyncResult, 1166 * and <code>response.obj.exception</code> will be non-null on failure. 1167 * On success, <code>AsyncResult.result</code> will be a <code>String[]</code> 1168 * containing the neighboring cell IDs. Index 0 will contain the count 1169 * of available cell IDs. Cell IDs are in hexadecimal format. 1170 * 1171 * @param response callback message that is dispatched when the query 1172 * completes. 1173 */ 1174 void getNeighboringCids(Message response); 1175 1176 /** 1177 * Sets an event to be fired when the telephony system processes 1178 * a post-dial character on an outgoing call.<p> 1179 * 1180 * Messages of type <code>what</code> will be sent to <code>h</code>. 1181 * The <code>obj</code> field of these Message's will be instances of 1182 * <code>AsyncResult</code>. <code>Message.obj.result</code> will be 1183 * a Connection object.<p> 1184 * 1185 * Message.arg1 will be the post dial character being processed, 1186 * or 0 ('\0') if end of string.<p> 1187 * 1188 * If Connection.getPostDialState() == WAIT, 1189 * the application must call 1190 * {@link com.android.internal.telephony.Connection#proceedAfterWaitChar() 1191 * Connection.proceedAfterWaitChar()} or 1192 * {@link com.android.internal.telephony.Connection#cancelPostDial() 1193 * Connection.cancelPostDial()} 1194 * for the telephony system to continue playing the post-dial 1195 * DTMF sequence.<p> 1196 * 1197 * If Connection.getPostDialState() == WILD, 1198 * the application must call 1199 * {@link com.android.internal.telephony.Connection#proceedAfterWildChar 1200 * Connection.proceedAfterWildChar()} 1201 * or 1202 * {@link com.android.internal.telephony.Connection#cancelPostDial() 1203 * Connection.cancelPostDial()} 1204 * for the telephony system to continue playing the 1205 * post-dial DTMF sequence.<p> 1206 * 1207 * Only one post dial character handler may be set. <p> 1208 * Calling this method with "h" equal to null unsets this handler.<p> 1209 */ 1210 void setOnPostDialCharacter(Handler h, int what, Object obj); 1211 1212 1213 /** 1214 * Mutes or unmutes the microphone for the active call. The microphone 1215 * is automatically unmuted if a call is answered, dialed, or resumed 1216 * from a holding state. 1217 * 1218 * @param muted true to mute the microphone, 1219 * false to activate the microphone. 1220 */ 1221 1222 void setMute(boolean muted); 1223 1224 /** 1225 * Gets current mute status. Use 1226 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, 1227 * java.lang.Object) registerForPreciseCallStateChanged()} 1228 * as a change notifcation, although presently phone state changed is not 1229 * fired when setMute() is called. 1230 * 1231 * @return true is muting, false is unmuting 1232 */ 1233 boolean getMute(); 1234 1235 /** 1236 * Enables or disables echo suppression. 1237 */ 1238 void setEchoSuppressionEnabled(); 1239 1240 /** 1241 * Invokes RIL_REQUEST_OEM_HOOK_RAW on RIL implementation. 1242 * 1243 * @param data The data for the request. 1244 * @param response <strong>On success</strong>, 1245 * (byte[])(((AsyncResult)response.obj).result) 1246 * <strong>On failure</strong>, 1247 * (((AsyncResult)response.obj).result) == null and 1248 * (((AsyncResult)response.obj).exception) being an instance of 1249 * com.android.internal.telephony.gsm.CommandException 1250 * 1251 * @see #invokeOemRilRequestRaw(byte[], android.os.Message) 1252 */ 1253 void invokeOemRilRequestRaw(byte[] data, Message response); 1254 1255 /** 1256 * Invokes RIL_REQUEST_OEM_HOOK_Strings on RIL implementation. 1257 * 1258 * @param strings The strings to make available as the request data. 1259 * @param response <strong>On success</strong>, "response" bytes is 1260 * made available as: 1261 * (String[])(((AsyncResult)response.obj).result). 1262 * <strong>On failure</strong>, 1263 * (((AsyncResult)response.obj).result) == null and 1264 * (((AsyncResult)response.obj).exception) being an instance of 1265 * com.android.internal.telephony.gsm.CommandException 1266 * 1267 * @see #invokeOemRilRequestStrings(java.lang.String[], android.os.Message) 1268 */ 1269 void invokeOemRilRequestStrings(String[] strings, Message response); 1270 1271 /** 1272 * Get the current active Data Call list 1273 * 1274 * @param response <strong>On success</strong>, "response" bytes is 1275 * made available as: 1276 * (String[])(((AsyncResult)response.obj).result). 1277 * <strong>On failure</strong>, 1278 * (((AsyncResult)response.obj).result) == null and 1279 * (((AsyncResult)response.obj).exception) being an instance of 1280 * com.android.internal.telephony.gsm.CommandException 1281 */ 1282 void getDataCallList(Message response); 1283 1284 /** 1285 * Update the ServiceState CellLocation for current network registration. 1286 */ 1287 void updateServiceLocation(); 1288 1289 /** 1290 * Enable location update notifications. 1291 */ 1292 void enableLocationUpdates(); 1293 1294 /** 1295 * Disable location update notifications. 1296 */ 1297 void disableLocationUpdates(); 1298 1299 /** 1300 * For unit tests; don't send notifications to "Phone" 1301 * mailbox registrants if true. 1302 */ 1303 void setUnitTestMode(boolean f); 1304 1305 /** 1306 * @return true If unit test mode is enabled 1307 */ 1308 boolean getUnitTestMode(); 1309 1310 /** 1311 * Assign a specified band for RF configuration. 1312 * 1313 * @param bandMode one of BM_*_BAND 1314 * @param response is callback message 1315 */ 1316 void setBandMode(int bandMode, Message response); 1317 1318 /** 1319 * Query the list of band mode supported by RF. 1320 * 1321 * @param response is callback message 1322 * ((AsyncResult)response.obj).result is an int[] where int[0] is 1323 * the size of the array and the rest of each element representing 1324 * one available BM_*_BAND 1325 */ 1326 void queryAvailableBandMode(Message response); 1327 1328 /** 1329 * @return true if enable data connection on roaming 1330 */ 1331 boolean getDataRoamingEnabled(); 1332 1333 /** 1334 * @param enable set true if enable data connection on roaming 1335 */ 1336 void setDataRoamingEnabled(boolean enable); 1337 1338 /** 1339 * @return true if user has enabled data 1340 */ 1341 boolean getDataEnabled(); 1342 1343 /** 1344 * @param @enable set {@code true} if enable data connection 1345 */ 1346 void setDataEnabled(boolean enable); 1347 1348 /** 1349 * Query the CDMA roaming preference setting 1350 * 1351 * @param response is callback message to report one of CDMA_RM_* 1352 */ 1353 void queryCdmaRoamingPreference(Message response); 1354 1355 /** 1356 * Requests to set the CDMA roaming preference 1357 * @param cdmaRoamingType one of CDMA_RM_* 1358 * @param response is callback message 1359 */ 1360 void setCdmaRoamingPreference(int cdmaRoamingType, Message response); 1361 1362 /** 1363 * Requests to set the CDMA subscription mode 1364 * @param cdmaSubscriptionType one of CDMA_SUBSCRIPTION_* 1365 * @param response is callback message 1366 */ 1367 void setCdmaSubscription(int cdmaSubscriptionType, Message response); 1368 1369 /** 1370 * If this is a simulated phone interface, returns a SimulatedRadioControl. 1371 * @return SimulatedRadioControl if this is a simulated interface; 1372 * otherwise, null. 1373 */ 1374 SimulatedRadioControl getSimulatedRadioControl(); 1375 1376 /** 1377 * Report on whether data connectivity is allowed. 1378 */ 1379 boolean isDataConnectivityPossible(); 1380 1381 /** 1382 * Report on whether data connectivity is allowed for an APN. 1383 */ 1384 boolean isDataConnectivityPossible(String apnType); 1385 1386 /** 1387 * Retrieves the unique device ID, e.g., IMEI for GSM phones and MEID for CDMA phones. 1388 */ 1389 String getDeviceId(); 1390 1391 /** 1392 * Retrieves the software version number for the device, e.g., IMEI/SV 1393 * for GSM phones. 1394 */ 1395 String getDeviceSvn(); 1396 1397 /** 1398 * Retrieves the unique subscriber ID, e.g., IMSI for GSM phones. 1399 */ 1400 String getSubscriberId(); 1401 1402 /** 1403 * Retrieves the Group Identifier Level1 for GSM phones. 1404 */ 1405 String getGroupIdLevel1(); 1406 1407 /** 1408 * Retrieves the serial number of the ICC, if applicable. 1409 */ 1410 String getIccSerialNumber(); 1411 1412 /* CDMA support methods */ 1413 1414 /** 1415 * Retrieves the MIN for CDMA phones. 1416 */ 1417 String getCdmaMin(); 1418 1419 /** 1420 * Check if subscription data has been assigned to mMin 1421 * 1422 * return true if MIN info is ready; false otherwise. 1423 */ 1424 boolean isMinInfoReady(); 1425 1426 /** 1427 * Retrieves PRL Version for CDMA phones 1428 */ 1429 String getCdmaPrlVersion(); 1430 1431 /** 1432 * Retrieves the ESN for CDMA phones. 1433 */ 1434 String getEsn(); 1435 1436 /** 1437 * Retrieves MEID for CDMA phones. 1438 */ 1439 String getMeid(); 1440 1441 /** 1442 * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to 1443 * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns 1444 * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones. 1445 */ 1446 String getMsisdn(); 1447 1448 /** 1449 * Retrieves IMEI for phones. Returns null if IMEI is not set. 1450 */ 1451 String getImei(); 1452 1453 /** 1454 * Retrieves Nai for phones. Returns null if Nai is not set. 1455 */ 1456 String getNai(); 1457 1458 /** 1459 * Retrieves the PhoneSubInfo of the Phone 1460 */ 1461 public PhoneSubInfo getPhoneSubInfo(); 1462 1463 /** 1464 * Retrieves the IccPhoneBookInterfaceManager of the Phone 1465 */ 1466 public IccPhoneBookInterfaceManager getIccPhoneBookInterfaceManager(); 1467 1468 /** 1469 * setTTYMode 1470 * sets a TTY mode option. 1471 * @param ttyMode is a one of the following: 1472 * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF} 1473 * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL} 1474 * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO} 1475 * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO} 1476 * @param onComplete a callback message when the action is completed 1477 */ 1478 void setTTYMode(int ttyMode, Message onComplete); 1479 1480 /** 1481 * setUiTTYMode 1482 * sets a TTY mode option. 1483 * @param ttyMode is a one of the following: 1484 * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF} 1485 * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL} 1486 * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO} 1487 * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO} 1488 * @param onComplete a callback message when the action is completed 1489 */ 1490 void setUiTTYMode(int uiTtyMode, Message onComplete); 1491 1492 /** 1493 * queryTTYMode 1494 * query the status of the TTY mode 1495 * 1496 * @param onComplete a callback message when the action is completed. 1497 */ 1498 void queryTTYMode(Message onComplete); 1499 1500 /** 1501 * Activate or deactivate cell broadcast SMS. 1502 * 1503 * @param activate 1504 * 0 = activate, 1 = deactivate 1505 * @param response 1506 * Callback message is empty on completion 1507 */ 1508 void activateCellBroadcastSms(int activate, Message response); 1509 1510 /** 1511 * Query the current configuration of cdma cell broadcast SMS. 1512 * 1513 * @param response 1514 * Callback message is empty on completion 1515 */ 1516 void getCellBroadcastSmsConfig(Message response); 1517 1518 /** 1519 * Configure cell broadcast SMS. 1520 * 1521 * TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig 1522 * 1523 * @param response 1524 * Callback message is empty on completion 1525 */ 1526 public void setCellBroadcastSmsConfig(int[] configValuesArray, Message response); 1527 1528 public void notifyDataActivity(); 1529 1530 /** 1531 * Returns the CDMA ERI icon index to display 1532 */ 1533 public int getCdmaEriIconIndex(); 1534 1535 /** 1536 * Returns the CDMA ERI icon mode, 1537 * 0 - ON 1538 * 1 - FLASHING 1539 */ 1540 public int getCdmaEriIconMode(); 1541 1542 /** 1543 * Returns the CDMA ERI text, 1544 */ 1545 public String getCdmaEriText(); 1546 1547 /** 1548 * request to exit emergency call back mode 1549 * the caller should use setOnECMModeExitResponse 1550 * to receive the emergency callback mode exit response 1551 */ 1552 void exitEmergencyCallbackMode(); 1553 1554 /** 1555 * this decides if the dial number is OTA(Over the air provision) number or not 1556 * @param dialStr is string representing the dialing digit(s) 1557 * @return true means the dialStr is OTA number, and false means the dialStr is not OTA number 1558 */ 1559 boolean isOtaSpNumber(String dialStr); 1560 1561 /** 1562 * Returns true if OTA Service Provisioning needs to be performed. 1563 */ 1564 boolean needsOtaServiceProvisioning(); 1565 1566 /** 1567 * Register for notifications when CDMA call waiting comes 1568 * 1569 * @param h Handler that receives the notification message. 1570 * @param what User-defined message code. 1571 * @param obj User object. 1572 */ 1573 void registerForCallWaiting(Handler h, int what, Object obj); 1574 1575 /** 1576 * Unegister for notifications when CDMA Call waiting comes 1577 * @param h Handler to be removed from the registrant list. 1578 */ 1579 void unregisterForCallWaiting(Handler h); 1580 1581 1582 /** 1583 * Register for signal information notifications from the network. 1584 * Message.obj will contain an AsyncResult. 1585 * AsyncResult.result will be a SuppServiceNotification instance. 1586 * 1587 * @param h Handler that receives the notification message. 1588 * @param what User-defined message code. 1589 * @param obj User object. 1590 */ 1591 1592 void registerForSignalInfo(Handler h, int what, Object obj) ; 1593 /** 1594 * Unregisters for signal information notifications. 1595 * Extraneous calls are tolerated silently 1596 * 1597 * @param h Handler to be removed from the registrant list. 1598 */ 1599 void unregisterForSignalInfo(Handler h); 1600 1601 /** 1602 * Register for display information notifications from the network. 1603 * Message.obj will contain an AsyncResult. 1604 * AsyncResult.result will be a SuppServiceNotification instance. 1605 * 1606 * @param h Handler that receives the notification message. 1607 * @param what User-defined message code. 1608 * @param obj User object. 1609 */ 1610 void registerForDisplayInfo(Handler h, int what, Object obj); 1611 1612 /** 1613 * Unregisters for display information notifications. 1614 * Extraneous calls are tolerated silently 1615 * 1616 * @param h Handler to be removed from the registrant list. 1617 */ 1618 void unregisterForDisplayInfo(Handler h) ; 1619 1620 /** 1621 * Register for CDMA number information record notification from the network. 1622 * Message.obj will contain an AsyncResult. 1623 * AsyncResult.result will be a CdmaInformationRecords.CdmaNumberInfoRec 1624 * instance. 1625 * 1626 * @param h Handler that receives the notification message. 1627 * @param what User-defined message code. 1628 * @param obj User object. 1629 */ 1630 void registerForNumberInfo(Handler h, int what, Object obj); 1631 1632 /** 1633 * Unregisters for number information record notifications. 1634 * Extraneous calls are tolerated silently 1635 * 1636 * @param h Handler to be removed from the registrant list. 1637 */ 1638 void unregisterForNumberInfo(Handler h); 1639 1640 /** 1641 * Register for CDMA redirected number information record notification 1642 * from the network. 1643 * Message.obj will contain an AsyncResult. 1644 * AsyncResult.result will be a CdmaInformationRecords.CdmaRedirectingNumberInfoRec 1645 * instance. 1646 * 1647 * @param h Handler that receives the notification message. 1648 * @param what User-defined message code. 1649 * @param obj User object. 1650 */ 1651 void registerForRedirectedNumberInfo(Handler h, int what, Object obj); 1652 1653 /** 1654 * Unregisters for redirected number information record notification. 1655 * Extraneous calls are tolerated silently 1656 * 1657 * @param h Handler to be removed from the registrant list. 1658 */ 1659 void unregisterForRedirectedNumberInfo(Handler h); 1660 1661 /** 1662 * Register for CDMA line control information record notification 1663 * from the network. 1664 * Message.obj will contain an AsyncResult. 1665 * AsyncResult.result will be a CdmaInformationRecords.CdmaLineControlInfoRec 1666 * instance. 1667 * 1668 * @param h Handler that receives the notification message. 1669 * @param what User-defined message code. 1670 * @param obj User object. 1671 */ 1672 void registerForLineControlInfo(Handler h, int what, Object obj); 1673 1674 /** 1675 * Unregisters for line control information notifications. 1676 * Extraneous calls are tolerated silently 1677 * 1678 * @param h Handler to be removed from the registrant list. 1679 */ 1680 void unregisterForLineControlInfo(Handler h); 1681 1682 /** 1683 * Register for CDMA T53 CLIR information record notifications 1684 * from the network. 1685 * Message.obj will contain an AsyncResult. 1686 * AsyncResult.result will be a CdmaInformationRecords.CdmaT53ClirInfoRec 1687 * instance. 1688 * 1689 * @param h Handler that receives the notification message. 1690 * @param what User-defined message code. 1691 * @param obj User object. 1692 */ 1693 void registerFoT53ClirlInfo(Handler h, int what, Object obj); 1694 1695 /** 1696 * Unregisters for T53 CLIR information record notification 1697 * Extraneous calls are tolerated silently 1698 * 1699 * @param h Handler to be removed from the registrant list. 1700 */ 1701 void unregisterForT53ClirInfo(Handler h); 1702 1703 /** 1704 * Register for CDMA T53 audio control information record notifications 1705 * from the network. 1706 * Message.obj will contain an AsyncResult. 1707 * AsyncResult.result will be a CdmaInformationRecords.CdmaT53AudioControlInfoRec 1708 * instance. 1709 * 1710 * @param h Handler that receives the notification message. 1711 * @param what User-defined message code. 1712 * @param obj User object. 1713 */ 1714 void registerForT53AudioControlInfo(Handler h, int what, Object obj); 1715 1716 /** 1717 * Unregisters for T53 audio control information record notifications. 1718 * Extraneous calls are tolerated silently 1719 * 1720 * @param h Handler to be removed from the registrant list. 1721 */ 1722 void unregisterForT53AudioControlInfo(Handler h); 1723 1724 /** 1725 * Register for radio off or not available 1726 * 1727 * @param h Handler that receives the notification message. 1728 * @param what User-defined message code. 1729 * @param obj User object. 1730 */ 1731 public void registerForRadioOffOrNotAvailable(Handler h, int what, Object obj); 1732 1733 /** 1734 * Unregisters for radio off or not available 1735 * 1736 * @param h Handler to be removed from the registrant list. 1737 */ 1738 public void unregisterForRadioOffOrNotAvailable(Handler h); 1739 1740 /** 1741 * registers for exit emergency call back mode request response 1742 * 1743 * @param h Handler that receives the notification message. 1744 * @param what User-defined message code. 1745 * @param obj User object. 1746 */ 1747 1748 void setOnEcbModeExitResponse(Handler h, int what, Object obj); 1749 1750 /** 1751 * Unregisters for exit emergency call back mode request response 1752 * 1753 * @param h Handler to be removed from the registrant list. 1754 */ 1755 void unsetOnEcbModeExitResponse(Handler h); 1756 1757 /** 1758 * Return if the current radio is LTE on CDMA. This 1759 * is a tri-state return value as for a period of time 1760 * the mode may be unknown. 1761 * 1762 * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE} 1763 * or {@link PhoneConstants#LTE_ON_CDMA_TRUE} 1764 */ 1765 public int getLteOnCdmaMode(); 1766 1767 /** 1768 * TODO: Adding a function for each property is not good. 1769 * A fucntion of type getPhoneProp(propType) where propType is an 1770 * enum of GSM+CDMA+LTE props would be a better approach. 1771 * 1772 * Get "Restriction of menu options for manual PLMN selection" bit 1773 * status from EF_CSP data, this belongs to "Value Added Services Group". 1774 * @return true if this bit is set or EF_CSP data is unavailable, 1775 * false otherwise 1776 */ 1777 boolean isCspPlmnEnabled(); 1778 1779 /** 1780 * Return an interface to retrieve the ISIM records for IMS, if available. 1781 * @return the interface to retrieve the ISIM records, or null if not supported 1782 */ 1783 IsimRecords getIsimRecords(); 1784 1785 /** 1786 * Sets the SIM voice message waiting indicator records. 1787 * @param line GSM Subscriber Profile Number, one-based. Only '1' is supported 1788 * @param countWaiting The number of messages waiting, if known. Use 1789 * -1 to indicate that an unknown number of 1790 * messages are waiting 1791 */ 1792 void setVoiceMessageWaiting(int line, int countWaiting); 1793 1794 /** 1795 * Gets the USIM service table from the UICC, if present and available. 1796 * @return an interface to the UsimServiceTable record, or null if not available 1797 */ 1798 UsimServiceTable getUsimServiceTable(); 1799 1800 /** 1801 * Gets the Uicc card corresponding to this phone. 1802 * @return the UiccCard object corresponding to the phone ID. 1803 */ 1804 UiccCard getUiccCard(); 1805 1806 /** 1807 * Unregister from all events it registered for and dispose objects 1808 * created by this object. 1809 */ 1810 void dispose(); 1811 1812 /** 1813 * Remove references to external object stored in this object. 1814 */ 1815 void removeReferences(); 1816 1817 /** 1818 * Update the phone object if the voice radio technology has changed 1819 * 1820 * @param voiceRadioTech The new voice radio technology 1821 */ 1822 void updatePhoneObject(int voiceRadioTech); 1823 1824 /** 1825 * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}. 1826 * Used for device configuration by some CDMA operators. 1827 * 1828 * @param itemID the ID of the item to read 1829 * @param response callback message with the String response in the obj field 1830 */ 1831 void nvReadItem(int itemID, Message response); 1832 1833 /** 1834 * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}. 1835 * Used for device configuration by some CDMA operators. 1836 * 1837 * @param itemID the ID of the item to read 1838 * @param itemValue the value to write, as a String 1839 * @param response Callback message. 1840 */ 1841 void nvWriteItem(int itemID, String itemValue, Message response); 1842 1843 /** 1844 * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage. 1845 * Used for device configuration by some CDMA operators. 1846 * 1847 * @param preferredRoamingList byte array containing the new PRL 1848 * @param response Callback message. 1849 */ 1850 void nvWriteCdmaPrl(byte[] preferredRoamingList, Message response); 1851 1852 /** 1853 * Perform the specified type of NV config reset. The radio will be taken offline 1854 * and the device must be rebooted after erasing the NV. Used for device 1855 * configuration by some CDMA operators. 1856 * 1857 * @param resetType reset type: 1: reload NV reset, 2: erase NV reset, 3: factory NV reset 1858 * @param response Callback message. 1859 */ 1860 void nvResetConfig(int resetType, Message response); 1861 1862 /* 1863 * Returns the subscription id. 1864 */ 1865 public int getSubId(); 1866 1867 /* 1868 * Returns the phone id. 1869 */ 1870 public int getPhoneId(); 1871 1872 /** 1873 * Get P-CSCF address from PCO after data connection is established or modified. 1874 * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN 1875 */ 1876 public String[] getPcscfAddress(String apnType); 1877 1878 /** 1879 * Set IMS registration state 1880 */ 1881 public void setImsRegistrationState(boolean registered); 1882 1883 /** 1884 * Return the ImsPhone phone co-managed with this phone 1885 * @return an instance of an ImsPhone phone 1886 */ 1887 public Phone getImsPhone(); 1888 1889 /** 1890 * Release the local instance of the ImsPhone and disconnect from 1891 * the phone. 1892 * @return the instance of the ImsPhone phone previously owned 1893 */ 1894 public ImsPhone relinquishOwnershipOfImsPhone(); 1895 1896 /** 1897 * Take ownership and wire-up the input ImsPhone 1898 * @param imsPhone ImsPhone to be used. 1899 */ 1900 public void acquireOwnershipOfImsPhone(ImsPhone imsPhone); 1901 1902 /** 1903 * Return the service state of mImsPhone if it is STATE_IN_SERVICE 1904 * otherwise return the current voice service state 1905 */ 1906 int getVoicePhoneServiceState(); 1907 1908 /** 1909 * Override the service provider name and the operator name for the current ICCID. 1910 */ 1911 public boolean setOperatorBrandOverride(String brand); 1912 1913 /** 1914 * Override the roaming indicator for the current ICCID. 1915 */ 1916 public boolean setRoamingOverride(List<String> gsmRoamingList, 1917 List<String> gsmNonRoamingList, List<String> cdmaRoamingList, 1918 List<String> cdmaNonRoamingList); 1919 1920 /** 1921 * Is Radio Present on the device and is it accessible 1922 */ 1923 public boolean isRadioAvailable(); 1924 1925 /** 1926 * shutdown Radio gracefully 1927 */ 1928 public void shutdownRadio(); 1929 1930 /** 1931 * Set phone radio capability 1932 * 1933 * @param rc the phone radio capability defined in 1934 * RadioCapability. It's a input object used to transfer parameter to logic modem 1935 * @param response Callback message. 1936 */ 1937 public void setRadioCapability(RadioCapability rc, Message response); 1938 1939 /** 1940 * Get phone radio access family 1941 * 1942 * @return a bit mask to identify the radio access family. 1943 */ 1944 public int getRadioAccessFamily(); 1945 1946 /** 1947 * Get supported phone radio access family 1948 * 1949 * @return a bit mask to identify the radio access family. 1950 */ 1951 public int getSupportedRadioAccessFamily(); 1952 1953 /** 1954 * Registers the handler when phone radio capability is changed. 1955 * 1956 * @param h Handler for notification message. 1957 * @param what User-defined message code. 1958 * @param obj User object. 1959 */ 1960 public void registerForRadioCapabilityChanged(Handler h, int what, Object obj); 1961 1962 /** 1963 * Unregister for notifications when phone radio type and access technology is changed. 1964 * 1965 * @param h Handler to be removed from the registrant list. 1966 */ 1967 public void unregisterForRadioCapabilityChanged(Handler h); 1968 1969 /** 1970 * Query the IMS Registration Status. 1971 * 1972 * @return true if IMS is Registered 1973 */ 1974 public boolean isImsRegistered(); 1975 } 1976