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