1 /* 2 * Copyright (C) 2006 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 com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo; 20 import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; 21 import com.android.internal.telephony.uicc.IccCardStatus; 22 23 import android.os.Message; 24 import android.os.Handler; 25 26 /** 27 * {@hide} 28 */ 29 public interface CommandsInterface { 30 enum RadioState { 31 RADIO_OFF, /* Radio explicitly powered off (eg CFUN=0) */ 32 RADIO_UNAVAILABLE, /* Radio unavailable (eg, resetting or not booted) */ 33 RADIO_ON; /* Radio is on */ 34 isOn()35 public boolean isOn() /* and available...*/ { 36 return this == RADIO_ON; 37 } 38 isAvailable()39 public boolean isAvailable() { 40 return this != RADIO_UNAVAILABLE; 41 } 42 } 43 44 //***** Constants 45 46 // Used as parameter to dial() and setCLIR() below 47 static final int CLIR_DEFAULT = 0; // "use subscription default value" 48 static final int CLIR_INVOCATION = 1; // (restrict CLI presentation) 49 static final int CLIR_SUPPRESSION = 2; // (allow CLI presentation) 50 51 52 // Used as parameters for call forward methods below 53 static final int CF_ACTION_DISABLE = 0; 54 static final int CF_ACTION_ENABLE = 1; 55 // static final int CF_ACTION_UNUSED = 2; 56 static final int CF_ACTION_REGISTRATION = 3; 57 static final int CF_ACTION_ERASURE = 4; 58 59 static final int CF_REASON_UNCONDITIONAL = 0; 60 static final int CF_REASON_BUSY = 1; 61 static final int CF_REASON_NO_REPLY = 2; 62 static final int CF_REASON_NOT_REACHABLE = 3; 63 static final int CF_REASON_ALL = 4; 64 static final int CF_REASON_ALL_CONDITIONAL = 5; 65 66 // Used for call barring methods below 67 static final String CB_FACILITY_BAOC = "AO"; 68 static final String CB_FACILITY_BAOIC = "OI"; 69 static final String CB_FACILITY_BAOICxH = "OX"; 70 static final String CB_FACILITY_BAIC = "AI"; 71 static final String CB_FACILITY_BAICr = "IR"; 72 static final String CB_FACILITY_BA_ALL = "AB"; 73 static final String CB_FACILITY_BA_MO = "AG"; 74 static final String CB_FACILITY_BA_MT = "AC"; 75 static final String CB_FACILITY_BA_SIM = "SC"; 76 static final String CB_FACILITY_BA_FD = "FD"; 77 78 79 // Used for various supp services apis 80 // See 27.007 +CCFC or +CLCK 81 static final int SERVICE_CLASS_NONE = 0; // no user input 82 static final int SERVICE_CLASS_VOICE = (1 << 0); 83 static final int SERVICE_CLASS_DATA = (1 << 1); //synonym for 16+32+64+128 84 static final int SERVICE_CLASS_FAX = (1 << 2); 85 static final int SERVICE_CLASS_SMS = (1 << 3); 86 static final int SERVICE_CLASS_DATA_SYNC = (1 << 4); 87 static final int SERVICE_CLASS_DATA_ASYNC = (1 << 5); 88 static final int SERVICE_CLASS_PACKET = (1 << 6); 89 static final int SERVICE_CLASS_PAD = (1 << 7); 90 static final int SERVICE_CLASS_MAX = (1 << 7); // Max SERVICE_CLASS value 91 92 // Numeric representation of string values returned 93 // by messages sent to setOnUSSD handler 94 static final int USSD_MODE_NOTIFY = 0; 95 static final int USSD_MODE_REQUEST = 1; 96 97 // GSM SMS fail cause for acknowledgeLastIncomingSMS. From TS 23.040, 9.2.3.22. 98 static final int GSM_SMS_FAIL_CAUSE_MEMORY_CAPACITY_EXCEEDED = 0xD3; 99 static final int GSM_SMS_FAIL_CAUSE_USIM_APP_TOOLKIT_BUSY = 0xD4; 100 static final int GSM_SMS_FAIL_CAUSE_USIM_DATA_DOWNLOAD_ERROR = 0xD5; 101 static final int GSM_SMS_FAIL_CAUSE_UNSPECIFIED_ERROR = 0xFF; 102 103 // CDMA SMS fail cause for acknowledgeLastIncomingCdmaSms. From TS N.S0005, 6.5.2.125. 104 static final int CDMA_SMS_FAIL_CAUSE_INVALID_TELESERVICE_ID = 4; 105 static final int CDMA_SMS_FAIL_CAUSE_RESOURCE_SHORTAGE = 35; 106 static final int CDMA_SMS_FAIL_CAUSE_OTHER_TERMINAL_PROBLEM = 39; 107 static final int CDMA_SMS_FAIL_CAUSE_ENCODING_PROBLEM = 96; 108 109 //***** Methods getRadioState()110 RadioState getRadioState(); 111 112 /** 113 * Fires on any RadioState transition 114 * Always fires immediately as well 115 * 116 * do not attempt to calculate transitions by storing getRadioState() values 117 * on previous invocations of this notification. Instead, use the other 118 * registration methods 119 */ registerForRadioStateChanged(Handler h, int what, Object obj)120 void registerForRadioStateChanged(Handler h, int what, Object obj); unregisterForRadioStateChanged(Handler h)121 void unregisterForRadioStateChanged(Handler h); 122 registerForVoiceRadioTechChanged(Handler h, int what, Object obj)123 void registerForVoiceRadioTechChanged(Handler h, int what, Object obj); unregisterForVoiceRadioTechChanged(Handler h)124 void unregisterForVoiceRadioTechChanged(Handler h); 125 126 /** 127 * Fires on any transition into RadioState.isOn() 128 * Fires immediately if currently in that state 129 * In general, actions should be idempotent. State may change 130 * before event is received. 131 */ registerForOn(Handler h, int what, Object obj)132 void registerForOn(Handler h, int what, Object obj); unregisterForOn(Handler h)133 void unregisterForOn(Handler h); 134 135 /** 136 * Fires on any transition out of RadioState.isAvailable() 137 * Fires immediately if currently in that state 138 * In general, actions should be idempotent. State may change 139 * before event is received. 140 */ registerForAvailable(Handler h, int what, Object obj)141 void registerForAvailable(Handler h, int what, Object obj); unregisterForAvailable(Handler h)142 void unregisterForAvailable(Handler h); 143 144 /** 145 * Fires on any transition into !RadioState.isAvailable() 146 * Fires immediately if currently in that state 147 * In general, actions should be idempotent. State may change 148 * before event is received. 149 */ registerForNotAvailable(Handler h, int what, Object obj)150 void registerForNotAvailable(Handler h, int what, Object obj); unregisterForNotAvailable(Handler h)151 void unregisterForNotAvailable(Handler h); 152 153 /** 154 * Fires on any transition into RADIO_OFF or !RadioState.isAvailable() 155 * Fires immediately if currently in that state 156 * In general, actions should be idempotent. State may change 157 * before event is received. 158 */ registerForOffOrNotAvailable(Handler h, int what, Object obj)159 void registerForOffOrNotAvailable(Handler h, int what, Object obj); unregisterForOffOrNotAvailable(Handler h)160 void unregisterForOffOrNotAvailable(Handler h); 161 162 /** 163 * Fires on any change in ICC status 164 */ registerForIccStatusChanged(Handler h, int what, Object obj)165 void registerForIccStatusChanged(Handler h, int what, Object obj); unregisterForIccStatusChanged(Handler h)166 void unregisterForIccStatusChanged(Handler h); 167 registerForCallStateChanged(Handler h, int what, Object obj)168 void registerForCallStateChanged(Handler h, int what, Object obj); unregisterForCallStateChanged(Handler h)169 void unregisterForCallStateChanged(Handler h); registerForVoiceNetworkStateChanged(Handler h, int what, Object obj)170 void registerForVoiceNetworkStateChanged(Handler h, int what, Object obj); unregisterForVoiceNetworkStateChanged(Handler h)171 void unregisterForVoiceNetworkStateChanged(Handler h); registerForDataNetworkStateChanged(Handler h, int what, Object obj)172 void registerForDataNetworkStateChanged(Handler h, int what, Object obj); unregisterForDataNetworkStateChanged(Handler h)173 void unregisterForDataNetworkStateChanged(Handler h); 174 175 /** InCall voice privacy notifications */ registerForInCallVoicePrivacyOn(Handler h, int what, Object obj)176 void registerForInCallVoicePrivacyOn(Handler h, int what, Object obj); unregisterForInCallVoicePrivacyOn(Handler h)177 void unregisterForInCallVoicePrivacyOn(Handler h); registerForInCallVoicePrivacyOff(Handler h, int what, Object obj)178 void registerForInCallVoicePrivacyOff(Handler h, int what, Object obj); unregisterForInCallVoicePrivacyOff(Handler h)179 void unregisterForInCallVoicePrivacyOff(Handler h); 180 181 /** 182 * unlike the register* methods, there's only one new 3GPP format SMS handler. 183 * if you need to unregister, you should also tell the radio to stop 184 * sending SMS's to you (via AT+CNMI) 185 * 186 * AsyncResult.result is a String containing the SMS PDU 187 */ setOnNewGsmSms(Handler h, int what, Object obj)188 void setOnNewGsmSms(Handler h, int what, Object obj); unSetOnNewGsmSms(Handler h)189 void unSetOnNewGsmSms(Handler h); 190 191 /** 192 * unlike the register* methods, there's only one new 3GPP2 format SMS handler. 193 * if you need to unregister, you should also tell the radio to stop 194 * sending SMS's to you (via AT+CNMI) 195 * 196 * AsyncResult.result is a String containing the SMS PDU 197 */ setOnNewCdmaSms(Handler h, int what, Object obj)198 void setOnNewCdmaSms(Handler h, int what, Object obj); unSetOnNewCdmaSms(Handler h)199 void unSetOnNewCdmaSms(Handler h); 200 201 /** 202 * Set the handler for SMS Cell Broadcast messages. 203 * 204 * AsyncResult.result is a byte array containing the SMS-CB PDU 205 */ setOnNewGsmBroadcastSms(Handler h, int what, Object obj)206 void setOnNewGsmBroadcastSms(Handler h, int what, Object obj); unSetOnNewGsmBroadcastSms(Handler h)207 void unSetOnNewGsmBroadcastSms(Handler h); 208 209 /** 210 * Register for NEW_SMS_ON_SIM unsolicited message 211 * 212 * AsyncResult.result is an int array containing the index of new SMS 213 */ setOnSmsOnSim(Handler h, int what, Object obj)214 void setOnSmsOnSim(Handler h, int what, Object obj); unSetOnSmsOnSim(Handler h)215 void unSetOnSmsOnSim(Handler h); 216 217 /** 218 * Register for NEW_SMS_STATUS_REPORT unsolicited message 219 * 220 * AsyncResult.result is a String containing the status report PDU 221 */ setOnSmsStatus(Handler h, int what, Object obj)222 void setOnSmsStatus(Handler h, int what, Object obj); unSetOnSmsStatus(Handler h)223 void unSetOnSmsStatus(Handler h); 224 225 /** 226 * unlike the register* methods, there's only one NITZ time handler 227 * 228 * AsyncResult.result is an Object[] 229 * ((Object[])AsyncResult.result)[0] is a String containing the NITZ time string 230 * ((Object[])AsyncResult.result)[1] is a Long containing the milliseconds since boot as 231 * returned by elapsedRealtime() when this NITZ time 232 * was posted. 233 * 234 * Please note that the delivery of this message may be delayed several 235 * seconds on system startup 236 */ setOnNITZTime(Handler h, int what, Object obj)237 void setOnNITZTime(Handler h, int what, Object obj); unSetOnNITZTime(Handler h)238 void unSetOnNITZTime(Handler h); 239 240 /** 241 * unlike the register* methods, there's only one USSD notify handler 242 * 243 * Represents the arrival of a USSD "notify" message, which may 244 * or may not have been triggered by a previous USSD send 245 * 246 * AsyncResult.result is a String[] 247 * ((String[])(AsyncResult.result))[0] contains status code 248 * "0" USSD-Notify -- text in ((const char **)data)[1] 249 * "1" USSD-Request -- text in ((const char **)data)[1] 250 * "2" Session terminated by network 251 * "3" other local client (eg, SIM Toolkit) has responded 252 * "4" Operation not supported 253 * "5" Network timeout 254 * 255 * ((String[])(AsyncResult.result))[1] contains the USSD message 256 * The numeric representations of these are in USSD_MODE_* 257 */ 258 setOnUSSD(Handler h, int what, Object obj)259 void setOnUSSD(Handler h, int what, Object obj); unSetOnUSSD(Handler h)260 void unSetOnUSSD(Handler h); 261 262 /** 263 * unlike the register* methods, there's only one signal strength handler 264 * AsyncResult.result is an int[2] 265 * response.obj.result[0] is received signal strength (0-31, 99) 266 * response.obj.result[1] is bit error rate (0-7, 99) 267 * as defined in TS 27.007 8.5 268 */ 269 setOnSignalStrengthUpdate(Handler h, int what, Object obj)270 void setOnSignalStrengthUpdate(Handler h, int what, Object obj); unSetOnSignalStrengthUpdate(Handler h)271 void unSetOnSignalStrengthUpdate(Handler h); 272 273 /** 274 * Sets the handler for SIM/RUIM SMS storage full unsolicited message. 275 * Unlike the register* methods, there's only one notification handler 276 * 277 * @param h Handler for notification message. 278 * @param what User-defined message code. 279 * @param obj User object. 280 */ setOnIccSmsFull(Handler h, int what, Object obj)281 void setOnIccSmsFull(Handler h, int what, Object obj); unSetOnIccSmsFull(Handler h)282 void unSetOnIccSmsFull(Handler h); 283 284 /** 285 * Sets the handler for SIM Refresh notifications. 286 * 287 * @param h Handler for notification message. 288 * @param what User-defined message code. 289 * @param obj User object. 290 */ registerForIccRefresh(Handler h, int what, Object obj)291 void registerForIccRefresh(Handler h, int what, Object obj); unregisterForIccRefresh(Handler h)292 void unregisterForIccRefresh(Handler h); 293 setOnIccRefresh(Handler h, int what, Object obj)294 void setOnIccRefresh(Handler h, int what, Object obj); unsetOnIccRefresh(Handler h)295 void unsetOnIccRefresh(Handler h); 296 297 /** 298 * Sets the handler for RING notifications. 299 * Unlike the register* methods, there's only one notification handler 300 * 301 * @param h Handler for notification message. 302 * @param what User-defined message code. 303 * @param obj User object. 304 */ setOnCallRing(Handler h, int what, Object obj)305 void setOnCallRing(Handler h, int what, Object obj); unSetOnCallRing(Handler h)306 void unSetOnCallRing(Handler h); 307 308 /** 309 * Sets the handler for RESTRICTED_STATE changed notification, 310 * eg, for Domain Specific Access Control 311 * unlike the register* methods, there's only one signal strength handler 312 * 313 * AsyncResult.result is an int[1] 314 * response.obj.result[0] is a bitmask of RIL_RESTRICTED_STATE_* values 315 */ 316 setOnRestrictedStateChanged(Handler h, int what, Object obj)317 void setOnRestrictedStateChanged(Handler h, int what, Object obj); unSetOnRestrictedStateChanged(Handler h)318 void unSetOnRestrictedStateChanged(Handler h); 319 320 /** 321 * Sets the handler for Supplementary Service Notifications. 322 * Unlike the register* methods, there's only one notification handler 323 * 324 * @param h Handler for notification message. 325 * @param what User-defined message code. 326 * @param obj User object. 327 */ setOnSuppServiceNotification(Handler h, int what, Object obj)328 void setOnSuppServiceNotification(Handler h, int what, Object obj); unSetOnSuppServiceNotification(Handler h)329 void unSetOnSuppServiceNotification(Handler h); 330 331 /** 332 * Sets the handler for Session End Notifications for CAT. 333 * Unlike the register* methods, there's only one notification handler 334 * 335 * @param h Handler for notification message. 336 * @param what User-defined message code. 337 * @param obj User object. 338 */ setOnCatSessionEnd(Handler h, int what, Object obj)339 void setOnCatSessionEnd(Handler h, int what, Object obj); unSetOnCatSessionEnd(Handler h)340 void unSetOnCatSessionEnd(Handler h); 341 342 /** 343 * Sets the handler for Proactive Commands for CAT. 344 * Unlike the register* methods, there's only one notification handler 345 * 346 * @param h Handler for notification message. 347 * @param what User-defined message code. 348 * @param obj User object. 349 */ setOnCatProactiveCmd(Handler h, int what, Object obj)350 void setOnCatProactiveCmd(Handler h, int what, Object obj); unSetOnCatProactiveCmd(Handler h)351 void unSetOnCatProactiveCmd(Handler h); 352 353 /** 354 * Sets the handler for Event Notifications for CAT. 355 * Unlike the register* methods, there's only one notification handler 356 * 357 * @param h Handler for notification message. 358 * @param what User-defined message code. 359 * @param obj User object. 360 */ setOnCatEvent(Handler h, int what, Object obj)361 void setOnCatEvent(Handler h, int what, Object obj); unSetOnCatEvent(Handler h)362 void unSetOnCatEvent(Handler h); 363 364 /** 365 * Sets the handler for Call Set Up Notifications for CAT. 366 * Unlike the register* methods, there's only one notification handler 367 * 368 * @param h Handler for notification message. 369 * @param what User-defined message code. 370 * @param obj User object. 371 */ setOnCatCallSetUp(Handler h, int what, Object obj)372 void setOnCatCallSetUp(Handler h, int what, Object obj); unSetOnCatCallSetUp(Handler h)373 void unSetOnCatCallSetUp(Handler h); 374 375 /** 376 * Enables/disbables supplementary service related notifications from 377 * the network. 378 * 379 * @param enable true to enable notifications, false to disable. 380 * @param result Message to be posted when command completes. 381 */ setSuppServiceNotifications(boolean enable, Message result)382 void setSuppServiceNotifications(boolean enable, Message result); 383 //void unSetSuppServiceNotifications(Handler h); 384 385 /** 386 * Sets the handler for Event Notifications for CDMA Display Info. 387 * Unlike the register* methods, there's only one notification handler 388 * 389 * @param h Handler for notification message. 390 * @param what User-defined message code. 391 * @param obj User object. 392 */ registerForDisplayInfo(Handler h, int what, Object obj)393 void registerForDisplayInfo(Handler h, int what, Object obj); unregisterForDisplayInfo(Handler h)394 void unregisterForDisplayInfo(Handler h); 395 396 /** 397 * Sets the handler for Event Notifications for CallWaiting Info. 398 * Unlike the register* methods, there's only one notification handler 399 * 400 * @param h Handler for notification message. 401 * @param what User-defined message code. 402 * @param obj User object. 403 */ registerForCallWaitingInfo(Handler h, int what, Object obj)404 void registerForCallWaitingInfo(Handler h, int what, Object obj); unregisterForCallWaitingInfo(Handler h)405 void unregisterForCallWaitingInfo(Handler h); 406 407 /** 408 * Sets the handler for Event Notifications for Signal Info. 409 * Unlike the register* methods, there's only one notification handler 410 * 411 * @param h Handler for notification message. 412 * @param what User-defined message code. 413 * @param obj User object. 414 */ registerForSignalInfo(Handler h, int what, Object obj)415 void registerForSignalInfo(Handler h, int what, Object obj); unregisterForSignalInfo(Handler h)416 void unregisterForSignalInfo(Handler h); 417 418 /** 419 * Registers the handler for CDMA number information record 420 * Unlike the register* methods, there's only one notification handler 421 * 422 * @param h Handler for notification message. 423 * @param what User-defined message code. 424 * @param obj User object. 425 */ registerForNumberInfo(Handler h, int what, Object obj)426 void registerForNumberInfo(Handler h, int what, Object obj); unregisterForNumberInfo(Handler h)427 void unregisterForNumberInfo(Handler h); 428 429 /** 430 * Registers the handler for CDMA redirected number Information record 431 * Unlike the register* methods, there's only one notification handler 432 * 433 * @param h Handler for notification message. 434 * @param what User-defined message code. 435 * @param obj User object. 436 */ registerForRedirectedNumberInfo(Handler h, int what, Object obj)437 void registerForRedirectedNumberInfo(Handler h, int what, Object obj); unregisterForRedirectedNumberInfo(Handler h)438 void unregisterForRedirectedNumberInfo(Handler h); 439 440 /** 441 * Registers the handler for CDMA line control information record 442 * Unlike the register* methods, there's only one notification handler 443 * 444 * @param h Handler for notification message. 445 * @param what User-defined message code. 446 * @param obj User object. 447 */ registerForLineControlInfo(Handler h, int what, Object obj)448 void registerForLineControlInfo(Handler h, int what, Object obj); unregisterForLineControlInfo(Handler h)449 void unregisterForLineControlInfo(Handler h); 450 451 /** 452 * Registers the handler for CDMA T53 CLIR information record 453 * Unlike the register* methods, there's only one notification handler 454 * 455 * @param h Handler for notification message. 456 * @param what User-defined message code. 457 * @param obj User object. 458 */ registerFoT53ClirlInfo(Handler h, int what, Object obj)459 void registerFoT53ClirlInfo(Handler h, int what, Object obj); unregisterForT53ClirInfo(Handler h)460 void unregisterForT53ClirInfo(Handler h); 461 462 /** 463 * Registers the handler for CDMA T53 audio control information record 464 * Unlike the register* methods, there's only one notification handler 465 * 466 * @param h Handler for notification message. 467 * @param what User-defined message code. 468 * @param obj User object. 469 */ registerForT53AudioControlInfo(Handler h, int what, Object obj)470 void registerForT53AudioControlInfo(Handler h, int what, Object obj); unregisterForT53AudioControlInfo(Handler h)471 void unregisterForT53AudioControlInfo(Handler h); 472 473 /** 474 * Fires on if Modem enters Emergency Callback mode 475 */ setEmergencyCallbackMode(Handler h, int what, Object obj)476 void setEmergencyCallbackMode(Handler h, int what, Object obj); 477 478 /** 479 * Fires on any CDMA OTA provision status change 480 */ registerForCdmaOtaProvision(Handler h,int what, Object obj)481 void registerForCdmaOtaProvision(Handler h,int what, Object obj); unregisterForCdmaOtaProvision(Handler h)482 void unregisterForCdmaOtaProvision(Handler h); 483 484 /** 485 * Registers the handler when out-band ringback tone is needed.<p> 486 * 487 * Messages received from this: 488 * Message.obj will be an AsyncResult 489 * AsyncResult.userObj = obj 490 * AsyncResult.result = boolean. <p> 491 */ registerForRingbackTone(Handler h, int what, Object obj)492 void registerForRingbackTone(Handler h, int what, Object obj); unregisterForRingbackTone(Handler h)493 void unregisterForRingbackTone(Handler h); 494 495 /** 496 * Registers the handler when mute/unmute need to be resent to get 497 * uplink audio during a call.<p> 498 * 499 * @param h Handler for notification message. 500 * @param what User-defined message code. 501 * @param obj User object. 502 * 503 */ registerForResendIncallMute(Handler h, int what, Object obj)504 void registerForResendIncallMute(Handler h, int what, Object obj); unregisterForResendIncallMute(Handler h)505 void unregisterForResendIncallMute(Handler h); 506 507 /** 508 * Registers the handler for when Cdma subscription changed events 509 * 510 * @param h Handler for notification message. 511 * @param what User-defined message code. 512 * @param obj User object. 513 * 514 */ registerForCdmaSubscriptionChanged(Handler h, int what, Object obj)515 void registerForCdmaSubscriptionChanged(Handler h, int what, Object obj); unregisterForCdmaSubscriptionChanged(Handler h)516 void unregisterForCdmaSubscriptionChanged(Handler h); 517 518 /** 519 * Registers the handler for when Cdma prl changed events 520 * 521 * @param h Handler for notification message. 522 * @param what User-defined message code. 523 * @param obj User object. 524 * 525 */ registerForCdmaPrlChanged(Handler h, int what, Object obj)526 void registerForCdmaPrlChanged(Handler h, int what, Object obj); unregisterForCdmaPrlChanged(Handler h)527 void unregisterForCdmaPrlChanged(Handler h); 528 529 /** 530 * Registers the handler for when Cdma prl changed events 531 * 532 * @param h Handler for notification message. 533 * @param what User-defined message code. 534 * @param obj User object. 535 * 536 */ registerForExitEmergencyCallbackMode(Handler h, int what, Object obj)537 void registerForExitEmergencyCallbackMode(Handler h, int what, Object obj); unregisterForExitEmergencyCallbackMode(Handler h)538 void unregisterForExitEmergencyCallbackMode(Handler h); 539 540 /** 541 * Registers the handler for RIL_UNSOL_RIL_CONNECT events. 542 * 543 * When ril connects or disconnects a message is sent to the registrant 544 * which contains an AsyncResult, ar, in msg.obj. The ar.result is an 545 * Integer which is the version of the ril or -1 if the ril disconnected. 546 * 547 * @param h Handler for notification message. 548 * @param what User-defined message code. 549 * @param obj User object. 550 */ registerForRilConnected(Handler h, int what, Object obj)551 void registerForRilConnected(Handler h, int what, Object obj); unregisterForRilConnected(Handler h)552 void unregisterForRilConnected(Handler h); 553 554 /** 555 * Supply the ICC PIN to the ICC card 556 * 557 * returned message 558 * retMsg.obj = AsyncResult ar 559 * ar.exception carries exception on failure 560 * This exception is CommandException with an error of PASSWORD_INCORRECT 561 * if the password is incorrect 562 * 563 * ar.exception and ar.result are null on success 564 */ 565 supplyIccPin(String pin, Message result)566 void supplyIccPin(String pin, Message result); 567 568 /** 569 * Supply the PIN for the app with this AID on the ICC card 570 * 571 * AID (Application ID), See ETSI 102.221 8.1 and 101.220 4 572 * 573 * returned message 574 * retMsg.obj = AsyncResult ar 575 * ar.exception carries exception on failure 576 * This exception is CommandException with an error of PASSWORD_INCORRECT 577 * if the password is incorrect 578 * 579 * ar.exception and ar.result are null on success 580 */ 581 supplyIccPinForApp(String pin, String aid, Message result)582 void supplyIccPinForApp(String pin, String aid, Message result); 583 584 /** 585 * Supply the ICC PUK and newPin to the ICC card 586 * 587 * returned message 588 * retMsg.obj = AsyncResult ar 589 * ar.exception carries exception on failure 590 * This exception is CommandException with an error of PASSWORD_INCORRECT 591 * if the password is incorrect 592 * 593 * ar.exception and ar.result are null on success 594 */ 595 supplyIccPuk(String puk, String newPin, Message result)596 void supplyIccPuk(String puk, String newPin, Message result); 597 598 /** 599 * Supply the PUK, new pin for the app with this AID on the ICC card 600 * 601 * AID (Application ID), See ETSI 102.221 8.1 and 101.220 4 602 * 603 * returned message 604 * retMsg.obj = AsyncResult ar 605 * ar.exception carries exception on failure 606 * This exception is CommandException with an error of PASSWORD_INCORRECT 607 * if the password is incorrect 608 * 609 * ar.exception and ar.result are null on success 610 */ 611 supplyIccPukForApp(String puk, String newPin, String aid, Message result)612 void supplyIccPukForApp(String puk, String newPin, String aid, Message result); 613 614 /** 615 * Supply the ICC PIN2 to the ICC card 616 * Only called following operation where ICC_PIN2 was 617 * returned as a a failure from a previous operation 618 * 619 * returned message 620 * retMsg.obj = AsyncResult ar 621 * ar.exception carries exception on failure 622 * This exception is CommandException with an error of PASSWORD_INCORRECT 623 * if the password is incorrect 624 * 625 * ar.exception and ar.result are null on success 626 */ 627 supplyIccPin2(String pin2, Message result)628 void supplyIccPin2(String pin2, Message result); 629 630 /** 631 * Supply the PIN2 for the app with this AID on the ICC card 632 * Only called following operation where ICC_PIN2 was 633 * returned as a a failure from a previous operation 634 * 635 * AID (Application ID), See ETSI 102.221 8.1 and 101.220 4 636 * 637 * returned message 638 * retMsg.obj = AsyncResult ar 639 * ar.exception carries exception on failure 640 * This exception is CommandException with an error of PASSWORD_INCORRECT 641 * if the password is incorrect 642 * 643 * ar.exception and ar.result are null on success 644 */ 645 supplyIccPin2ForApp(String pin2, String aid, Message result)646 void supplyIccPin2ForApp(String pin2, String aid, Message result); 647 648 /** 649 * Supply the SIM PUK2 to the SIM card 650 * Only called following operation where SIM_PUK2 was 651 * returned as a a failure from a previous operation 652 * 653 * returned message 654 * retMsg.obj = AsyncResult ar 655 * ar.exception carries exception on failure 656 * This exception is CommandException with an error of PASSWORD_INCORRECT 657 * if the password is incorrect 658 * 659 * ar.exception and ar.result are null on success 660 */ 661 supplyIccPuk2(String puk2, String newPin2, Message result)662 void supplyIccPuk2(String puk2, String newPin2, Message result); 663 664 /** 665 * Supply the PUK2, newPin2 for the app with this AID on the ICC card 666 * Only called following operation where SIM_PUK2 was 667 * returned as a a failure from a previous operation 668 * 669 * AID (Application ID), See ETSI 102.221 8.1 and 101.220 4 670 * 671 * returned message 672 * retMsg.obj = AsyncResult ar 673 * ar.exception carries exception on failure 674 * This exception is CommandException with an error of PASSWORD_INCORRECT 675 * if the password is incorrect 676 * 677 * ar.exception and ar.result are null on success 678 */ 679 supplyIccPuk2ForApp(String puk2, String newPin2, String aid, Message result)680 void supplyIccPuk2ForApp(String puk2, String newPin2, String aid, Message result); 681 changeIccPin(String oldPin, String newPin, Message result)682 void changeIccPin(String oldPin, String newPin, Message result); changeIccPinForApp(String oldPin, String newPin, String aidPtr, Message result)683 void changeIccPinForApp(String oldPin, String newPin, String aidPtr, Message result); changeIccPin2(String oldPin2, String newPin2, Message result)684 void changeIccPin2(String oldPin2, String newPin2, Message result); changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr, Message result)685 void changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr, Message result); 686 changeBarringPassword(String facility, String oldPwd, String newPwd, Message result)687 void changeBarringPassword(String facility, String oldPwd, String newPwd, Message result); 688 supplyNetworkDepersonalization(String netpin, Message result)689 void supplyNetworkDepersonalization(String netpin, Message result); 690 691 /** 692 * returned message 693 * retMsg.obj = AsyncResult ar 694 * ar.exception carries exception on failure 695 * ar.userObject contains the orignal value of result.obj 696 * ar.result contains a List of DriverCall 697 * The ar.result List is sorted by DriverCall.index 698 */ getCurrentCalls(Message result)699 void getCurrentCalls (Message result); 700 701 /** 702 * returned message 703 * retMsg.obj = AsyncResult ar 704 * ar.exception carries exception on failure 705 * ar.userObject contains the orignal value of result.obj 706 * ar.result contains a List of DataCallResponse 707 * @deprecated Do not use. 708 */ 709 @Deprecated getPDPContextList(Message result)710 void getPDPContextList(Message result); 711 712 /** 713 * returned message 714 * retMsg.obj = AsyncResult ar 715 * ar.exception carries exception on failure 716 * ar.userObject contains the orignal value of result.obj 717 * ar.result contains a List of DataCallResponse 718 */ getDataCallList(Message result)719 void getDataCallList(Message result); 720 721 /** 722 * returned message 723 * retMsg.obj = AsyncResult ar 724 * ar.exception carries exception on failure 725 * ar.userObject contains the orignal value of result.obj 726 * ar.result is null on success and failure 727 * 728 * CLIR_DEFAULT == on "use subscription default value" 729 * CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation) 730 * CLIR_INVOCATION == on "CLIR invocation" (restrict CLI presentation) 731 */ dial(String address, int clirMode, Message result)732 void dial (String address, int clirMode, Message result); 733 734 /** 735 * returned message 736 * retMsg.obj = AsyncResult ar 737 * ar.exception carries exception on failure 738 * ar.userObject contains the orignal value of result.obj 739 * ar.result is null on success and failure 740 * 741 * CLIR_DEFAULT == on "use subscription default value" 742 * CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation) 743 * CLIR_INVOCATION == on "CLIR invocation" (restrict CLI presentation) 744 */ dial(String address, int clirMode, UUSInfo uusInfo, Message result)745 void dial(String address, int clirMode, UUSInfo uusInfo, Message result); 746 747 /** 748 * returned message 749 * retMsg.obj = AsyncResult ar 750 * ar.exception carries exception on failure 751 * ar.userObject contains the orignal value of result.obj 752 * ar.result is String containing IMSI on success 753 */ getIMSI(Message result)754 void getIMSI(Message result); 755 756 /** 757 * returned message 758 * retMsg.obj = AsyncResult ar 759 * ar.exception carries exception on failure 760 * ar.userObject contains the orignal value of result.obj 761 * ar.result is String containing IMSI on success 762 */ getIMSIForApp(String aid, Message result)763 void getIMSIForApp(String aid, Message result); 764 765 /** 766 * returned message 767 * retMsg.obj = AsyncResult ar 768 * ar.exception carries exception on failure 769 * ar.userObject contains the orignal value of result.obj 770 * ar.result is String containing IMEI on success 771 */ getIMEI(Message result)772 void getIMEI(Message result); 773 774 /** 775 * returned message 776 * retMsg.obj = AsyncResult ar 777 * ar.exception carries exception on failure 778 * ar.userObject contains the orignal value of result.obj 779 * ar.result is String containing IMEISV on success 780 */ getIMEISV(Message result)781 void getIMEISV(Message result); 782 783 /** 784 * Hang up one individual connection. 785 * returned message 786 * retMsg.obj = AsyncResult ar 787 * ar.exception carries exception on failure 788 * ar.userObject contains the orignal value of result.obj 789 * ar.result is null on success and failure 790 * 791 * 3GPP 22.030 6.5.5 792 * "Releases a specific active call X" 793 */ hangupConnection(int gsmIndex, Message result)794 void hangupConnection (int gsmIndex, Message result); 795 796 /** 797 * 3GPP 22.030 6.5.5 798 * "Releases all held calls or sets User Determined User Busy (UDUB) 799 * for a waiting call." 800 * ar.exception carries exception on failure 801 * ar.userObject contains the orignal value of result.obj 802 * ar.result is null on success and failure 803 */ hangupWaitingOrBackground(Message result)804 void hangupWaitingOrBackground (Message result); 805 806 /** 807 * 3GPP 22.030 6.5.5 808 * "Releases all active calls (if any exist) and accepts 809 * the other (held or waiting) call." 810 * 811 * ar.exception carries exception on failure 812 * ar.userObject contains the orignal value of result.obj 813 * ar.result is null on success and failure 814 */ hangupForegroundResumeBackground(Message result)815 void hangupForegroundResumeBackground (Message result); 816 817 /** 818 * 3GPP 22.030 6.5.5 819 * "Places all active calls (if any exist) on hold and accepts 820 * the other (held or waiting) call." 821 * 822 * ar.exception carries exception on failure 823 * ar.userObject contains the orignal value of result.obj 824 * ar.result is null on success and failure 825 */ switchWaitingOrHoldingAndActive(Message result)826 void switchWaitingOrHoldingAndActive (Message result); 827 828 /** 829 * 3GPP 22.030 6.5.5 830 * "Adds a held call to the conversation" 831 * 832 * ar.exception carries exception on failure 833 * ar.userObject contains the orignal value of result.obj 834 * ar.result is null on success and failure 835 */ conference(Message result)836 void conference (Message result); 837 838 /** 839 * Set preferred Voice Privacy (VP). 840 * 841 * @param enable true is enhanced and false is normal VP 842 * @param result is a callback message 843 */ setPreferredVoicePrivacy(boolean enable, Message result)844 void setPreferredVoicePrivacy(boolean enable, Message result); 845 846 /** 847 * Get currently set preferred Voice Privacy (VP) mode. 848 * 849 * @param result is a callback message 850 */ getPreferredVoicePrivacy(Message result)851 void getPreferredVoicePrivacy(Message result); 852 853 /** 854 * 3GPP 22.030 6.5.5 855 * "Places all active calls on hold except call X with which 856 * communication shall be supported." 857 */ separateConnection(int gsmIndex, Message result)858 void separateConnection (int gsmIndex, Message result); 859 860 /** 861 * 862 * ar.exception carries exception on failure 863 * ar.userObject contains the orignal value of result.obj 864 * ar.result is null on success and failure 865 */ acceptCall(Message result)866 void acceptCall (Message result); 867 868 /** 869 * also known as UDUB 870 * ar.exception carries exception on failure 871 * ar.userObject contains the orignal value of result.obj 872 * ar.result is null on success and failure 873 */ rejectCall(Message result)874 void rejectCall (Message result); 875 876 /** 877 * 3GPP 22.030 6.5.5 878 * "Connects the two calls and disconnects the subscriber from both calls" 879 * 880 * ar.exception carries exception on failure 881 * ar.userObject contains the orignal value of result.obj 882 * ar.result is null on success and failure 883 */ explicitCallTransfer(Message result)884 void explicitCallTransfer (Message result); 885 886 /** 887 * cause code returned as int[0] in Message.obj.response 888 * Returns integer cause code defined in TS 24.008 889 * Annex H or closest approximation. 890 * Most significant codes: 891 * - Any defined in 22.001 F.4 (for generating busy/congestion) 892 * - Cause 68: ACM >= ACMMax 893 */ getLastCallFailCause(Message result)894 void getLastCallFailCause (Message result); 895 896 897 /** 898 * Reason for last PDP context deactivate or failure to activate 899 * cause code returned as int[0] in Message.obj.response 900 * returns an integer cause code defined in TS 24.008 901 * section 6.1.3.1.3 or close approximation 902 * @deprecated Do not use. 903 */ 904 @Deprecated getLastPdpFailCause(Message result)905 void getLastPdpFailCause (Message result); 906 907 /** 908 * The preferred new alternative to getLastPdpFailCause 909 * that is also CDMA-compatible. 910 */ getLastDataCallFailCause(Message result)911 void getLastDataCallFailCause (Message result); 912 setMute(boolean enableMute, Message response)913 void setMute (boolean enableMute, Message response); 914 getMute(Message response)915 void getMute (Message response); 916 917 /** 918 * response.obj is an AsyncResult 919 * response.obj.result is an int[2] 920 * response.obj.result[0] is received signal strength (0-31, 99) 921 * response.obj.result[1] is bit error rate (0-7, 99) 922 * as defined in TS 27.007 8.5 923 */ getSignalStrength(Message response)924 void getSignalStrength (Message response); 925 926 927 /** 928 * response.obj.result is an int[3] 929 * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2 930 * response.obj.result[1] is LAC if registered or -1 if not 931 * response.obj.result[2] is CID if registered or -1 if not 932 * valid LAC and CIDs are 0x0000 - 0xffff 933 * 934 * Please note that registration state 4 ("unknown") is treated 935 * as "out of service" above 936 */ getVoiceRegistrationState(Message response)937 void getVoiceRegistrationState (Message response); 938 939 /** 940 * response.obj.result is an int[3] 941 * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2 942 * response.obj.result[1] is LAC if registered or -1 if not 943 * response.obj.result[2] is CID if registered or -1 if not 944 * valid LAC and CIDs are 0x0000 - 0xffff 945 * 946 * Please note that registration state 4 ("unknown") is treated 947 * as "out of service" above 948 */ getDataRegistrationState(Message response)949 void getDataRegistrationState (Message response); 950 951 /** 952 * response.obj.result is a String[3] 953 * response.obj.result[0] is long alpha or null if unregistered 954 * response.obj.result[1] is short alpha or null if unregistered 955 * response.obj.result[2] is numeric or null if unregistered 956 */ getOperator(Message response)957 void getOperator(Message response); 958 959 /** 960 * ar.exception carries exception on failure 961 * ar.userObject contains the orignal value of result.obj 962 * ar.result is null on success and failure 963 */ sendDtmf(char c, Message result)964 void sendDtmf(char c, Message result); 965 966 967 /** 968 * ar.exception carries exception on failure 969 * ar.userObject contains the orignal value of result.obj 970 * ar.result is null on success and failure 971 */ startDtmf(char c, Message result)972 void startDtmf(char c, Message result); 973 974 /** 975 * ar.exception carries exception on failure 976 * ar.userObject contains the orignal value of result.obj 977 * ar.result is null on success and failure 978 */ stopDtmf(Message result)979 void stopDtmf(Message result); 980 981 /** 982 * ar.exception carries exception on failure 983 * ar.userObject contains the orignal value of result.obj 984 * ar.result is null on success and failure 985 */ sendBurstDtmf(String dtmfString, int on, int off, Message result)986 void sendBurstDtmf(String dtmfString, int on, int off, Message result); 987 988 /** 989 * smscPDU is smsc address in PDU form GSM BCD format prefixed 990 * by a length byte (as expected by TS 27.005) or NULL for default SMSC 991 * pdu is SMS in PDU format as an ASCII hex string 992 * less the SMSC address 993 */ sendSMS(String smscPDU, String pdu, Message response)994 void sendSMS (String smscPDU, String pdu, Message response); 995 996 /** 997 * @param pdu is CDMA-SMS in internal pseudo-PDU format 998 * @param response sent when operation completes 999 */ sendCdmaSms(byte[] pdu, Message response)1000 void sendCdmaSms(byte[] pdu, Message response); 1001 1002 /** 1003 * Deletes the specified SMS record from SIM memory (EF_SMS). 1004 * 1005 * @param index index of the SMS record to delete 1006 * @param response sent when operation completes 1007 */ deleteSmsOnSim(int index, Message response)1008 void deleteSmsOnSim(int index, Message response); 1009 1010 /** 1011 * Deletes the specified SMS record from RUIM memory (EF_SMS in DF_CDMA). 1012 * 1013 * @param index index of the SMS record to delete 1014 * @param response sent when operation completes 1015 */ deleteSmsOnRuim(int index, Message response)1016 void deleteSmsOnRuim(int index, Message response); 1017 1018 /** 1019 * Writes an SMS message to SIM memory (EF_SMS). 1020 * 1021 * @param status status of message on SIM. One of: 1022 * SmsManger.STATUS_ON_ICC_READ 1023 * SmsManger.STATUS_ON_ICC_UNREAD 1024 * SmsManger.STATUS_ON_ICC_SENT 1025 * SmsManger.STATUS_ON_ICC_UNSENT 1026 * @param pdu message PDU, as hex string 1027 * @param response sent when operation completes. 1028 * response.obj will be an AsyncResult, and will indicate 1029 * any error that may have occurred (eg, out of memory). 1030 */ writeSmsToSim(int status, String smsc, String pdu, Message response)1031 void writeSmsToSim(int status, String smsc, String pdu, Message response); 1032 writeSmsToRuim(int status, String pdu, Message response)1033 void writeSmsToRuim(int status, String pdu, Message response); 1034 setRadioPower(boolean on, Message response)1035 void setRadioPower(boolean on, Message response); 1036 acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response)1037 void acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response); 1038 acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response)1039 void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response); 1040 1041 /** 1042 * Acknowledge successful or failed receipt of last incoming SMS, 1043 * including acknowledgement TPDU to send as the RP-User-Data element 1044 * of the RP-ACK or RP-ERROR PDU. 1045 * 1046 * @param success true to send RP-ACK, false to send RP-ERROR 1047 * @param ackPdu the acknowledgement TPDU in hexadecimal format 1048 * @param response sent when operation completes. 1049 */ acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response)1050 void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response); 1051 1052 /** 1053 * parameters equivalent to 27.007 AT+CRSM command 1054 * response.obj will be an AsyncResult 1055 * response.obj.result will be an IccIoResult on success 1056 */ iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, Message response)1057 void iccIO (int command, int fileid, String path, int p1, int p2, int p3, 1058 String data, String pin2, Message response); 1059 1060 /** 1061 * parameters equivalent to 27.007 AT+CRSM command 1062 * response.obj will be an AsyncResult 1063 * response.obj.userObj will be a IccIoResult on success 1064 */ iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid, Message response)1065 void iccIOForApp (int command, int fileid, String path, int p1, int p2, int p3, 1066 String data, String pin2, String aid, Message response); 1067 1068 /** 1069 * (AsyncResult)response.obj).result is an int[] with element [0] set to 1070 * 1 for "CLIP is provisioned", and 0 for "CLIP is not provisioned". 1071 * 1072 * @param response is callback message 1073 */ 1074 queryCLIP(Message response)1075 void queryCLIP(Message response); 1076 1077 /** 1078 * response.obj will be a an int[2] 1079 * 1080 * response.obj[0] will be TS 27.007 +CLIR parameter 'n' 1081 * 0 presentation indicator is used according to the subscription of the CLIR service 1082 * 1 CLIR invocation 1083 * 2 CLIR suppression 1084 * 1085 * response.obj[1] will be TS 27.007 +CLIR parameter 'm' 1086 * 0 CLIR not provisioned 1087 * 1 CLIR provisioned in permanent mode 1088 * 2 unknown (e.g. no network, etc.) 1089 * 3 CLIR temporary mode presentation restricted 1090 * 4 CLIR temporary mode presentation allowed 1091 */ 1092 getCLIR(Message response)1093 void getCLIR(Message response); 1094 1095 /** 1096 * clirMode is one of the CLIR_* constants above 1097 * 1098 * response.obj is null 1099 */ 1100 setCLIR(int clirMode, Message response)1101 void setCLIR(int clirMode, Message response); 1102 1103 /** 1104 * (AsyncResult)response.obj).result is an int[] with element [0] set to 1105 * 0 for disabled, 1 for enabled. 1106 * 1107 * @param serviceClass is a sum of SERVICE_CLASS_* 1108 * @param response is callback message 1109 */ 1110 queryCallWaiting(int serviceClass, Message response)1111 void queryCallWaiting(int serviceClass, Message response); 1112 1113 /** 1114 * @param enable is true to enable, false to disable 1115 * @param serviceClass is a sum of SERVICE_CLASS_* 1116 * @param response is callback message 1117 */ 1118 setCallWaiting(boolean enable, int serviceClass, Message response)1119 void setCallWaiting(boolean enable, int serviceClass, Message response); 1120 1121 /** 1122 * @param action is one of CF_ACTION_* 1123 * @param cfReason is one of CF_REASON_* 1124 * @param serviceClass is a sum of SERVICE_CLASSS_* 1125 */ setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds, Message response)1126 void setCallForward(int action, int cfReason, int serviceClass, 1127 String number, int timeSeconds, Message response); 1128 1129 /** 1130 * cfReason is one of CF_REASON_* 1131 * 1132 * ((AsyncResult)response.obj).result will be an array of 1133 * CallForwardInfo's 1134 * 1135 * An array of length 0 means "disabled for all codes" 1136 */ queryCallForwardStatus(int cfReason, int serviceClass, String number, Message response)1137 void queryCallForwardStatus(int cfReason, int serviceClass, 1138 String number, Message response); 1139 setNetworkSelectionModeAutomatic(Message response)1140 void setNetworkSelectionModeAutomatic(Message response); 1141 setNetworkSelectionModeManual(String operatorNumeric, Message response)1142 void setNetworkSelectionModeManual(String operatorNumeric, Message response); 1143 1144 /** 1145 * Queries whether the current network selection mode is automatic 1146 * or manual 1147 * 1148 * ((AsyncResult)response.obj).result is an int[] with element [0] being 1149 * a 0 for automatic selection and a 1 for manual selection 1150 */ 1151 getNetworkSelectionMode(Message response)1152 void getNetworkSelectionMode(Message response); 1153 1154 /** 1155 * Queries the currently available networks 1156 * 1157 * ((AsyncResult)response.obj).result is a List of NetworkInfo objects 1158 */ getAvailableNetworks(Message response)1159 void getAvailableNetworks(Message response); 1160 getBasebandVersion(Message response)1161 void getBasebandVersion (Message response); 1162 1163 1164 /** 1165 * (AsyncResult)response.obj).result will be an Integer representing 1166 * the sum of enabled service classes (sum of SERVICE_CLASS_*) 1167 * 1168 * @param facility one of CB_FACILTY_* 1169 * @param password password or "" if not required 1170 * @param serviceClass is a sum of SERVICE_CLASS_* 1171 * @param response is callback message 1172 */ 1173 queryFacilityLock(String facility, String password, int serviceClass, Message response)1174 void queryFacilityLock (String facility, String password, int serviceClass, 1175 Message response); 1176 1177 /** 1178 * (AsyncResult)response.obj).result will be an Integer representing 1179 * the sum of enabled service classes (sum of SERVICE_CLASS_*) for the 1180 * application with appId. 1181 * 1182 * @param facility one of CB_FACILTY_* 1183 * @param password password or "" if not required 1184 * @param serviceClass is a sum of SERVICE_CLASS_* 1185 * @param appId is application Id or null if none 1186 * @param response is callback message 1187 */ 1188 queryFacilityLockForApp(String facility, String password, int serviceClass, String appId, Message response)1189 void queryFacilityLockForApp(String facility, String password, int serviceClass, String appId, 1190 Message response); 1191 1192 /** 1193 * @param facility one of CB_FACILTY_* 1194 * @param lockState true means lock, false means unlock 1195 * @param password password or "" if not required 1196 * @param serviceClass is a sum of SERVICE_CLASS_* 1197 * @param response is callback message 1198 */ setFacilityLock(String facility, boolean lockState, String password, int serviceClass, Message response)1199 void setFacilityLock (String facility, boolean lockState, String password, 1200 int serviceClass, Message response); 1201 1202 /** 1203 * Set the facility lock for the app with this AID on the ICC card. 1204 * 1205 * @param facility one of CB_FACILTY_* 1206 * @param lockState true means lock, false means unlock 1207 * @param password password or "" if not required 1208 * @param serviceClass is a sum of SERVICE_CLASS_* 1209 * @param appId is application Id or null if none 1210 * @param response is callback message 1211 */ setFacilityLockForApp(String facility, boolean lockState, String password, int serviceClass, String appId, Message response)1212 void setFacilityLockForApp(String facility, boolean lockState, String password, 1213 int serviceClass, String appId, Message response); 1214 sendUSSD(String ussdString, Message response)1215 void sendUSSD (String ussdString, Message response); 1216 1217 /** 1218 * Cancels a pending USSD session if one exists. 1219 * @param response callback message 1220 */ cancelPendingUssd(Message response)1221 void cancelPendingUssd (Message response); 1222 resetRadio(Message result)1223 void resetRadio(Message result); 1224 1225 /** 1226 * Assign a specified band for RF configuration. 1227 * 1228 * @param bandMode one of BM_*_BAND 1229 * @param response is callback message 1230 */ setBandMode(int bandMode, Message response)1231 void setBandMode (int bandMode, Message response); 1232 1233 /** 1234 * Query the list of band mode supported by RF. 1235 * 1236 * @param response is callback message 1237 * ((AsyncResult)response.obj).result is an int[] with every 1238 * element representing one avialable BM_*_BAND 1239 */ queryAvailableBandMode(Message response)1240 void queryAvailableBandMode (Message response); 1241 1242 /** 1243 * Set the current preferred network type. This will be the last 1244 * networkType that was passed to setPreferredNetworkType. 1245 */ setCurrentPreferredNetworkType()1246 void setCurrentPreferredNetworkType(); 1247 1248 /** 1249 * Requests to set the preferred network type for searching and registering 1250 * (CS/PS domain, RAT, and operation mode) 1251 * @param networkType one of NT_*_TYPE 1252 * @param response is callback message 1253 */ setPreferredNetworkType(int networkType , Message response)1254 void setPreferredNetworkType(int networkType , Message response); 1255 1256 /** 1257 * Query the preferred network type setting 1258 * 1259 * @param response is callback message to report one of NT_*_TYPE 1260 */ getPreferredNetworkType(Message response)1261 void getPreferredNetworkType(Message response); 1262 1263 /** 1264 * Query neighboring cell ids 1265 * 1266 * @param response s callback message to cell ids 1267 */ getNeighboringCids(Message response)1268 void getNeighboringCids(Message response); 1269 1270 /** 1271 * Request to enable/disable network state change notifications when 1272 * location information (lac and/or cid) has changed. 1273 * 1274 * @param enable true to enable, false to disable 1275 * @param response callback message 1276 */ setLocationUpdates(boolean enable, Message response)1277 void setLocationUpdates(boolean enable, Message response); 1278 1279 /** 1280 * Gets the default SMSC address. 1281 * 1282 * @param result Callback message contains the SMSC address. 1283 */ getSmscAddress(Message result)1284 void getSmscAddress(Message result); 1285 1286 /** 1287 * Sets the default SMSC address. 1288 * 1289 * @param address new SMSC address 1290 * @param result Callback message is empty on completion 1291 */ setSmscAddress(String address, Message result)1292 void setSmscAddress(String address, Message result); 1293 1294 /** 1295 * Indicates whether there is storage available for new SMS messages. 1296 * @param available true if storage is available 1297 * @param result callback message 1298 */ reportSmsMemoryStatus(boolean available, Message result)1299 void reportSmsMemoryStatus(boolean available, Message result); 1300 1301 /** 1302 * Indicates to the vendor ril that StkService is running 1303 * and is ready to receive RIL_UNSOL_STK_XXXX commands. 1304 * 1305 * @param result callback message 1306 */ reportStkServiceIsRunning(Message result)1307 void reportStkServiceIsRunning(Message result); 1308 invokeOemRilRequestRaw(byte[] data, Message response)1309 void invokeOemRilRequestRaw(byte[] data, Message response); 1310 invokeOemRilRequestStrings(String[] strings, Message response)1311 void invokeOemRilRequestStrings(String[] strings, Message response); 1312 1313 1314 /** 1315 * Send TERMINAL RESPONSE to the SIM, after processing a proactive command 1316 * sent by the SIM. 1317 * 1318 * @param contents String containing SAT/USAT response in hexadecimal 1319 * format starting with first byte of response data. See 1320 * TS 102 223 for details. 1321 * @param response Callback message 1322 */ sendTerminalResponse(String contents, Message response)1323 public void sendTerminalResponse(String contents, Message response); 1324 1325 /** 1326 * Send ENVELOPE to the SIM, after processing a proactive command sent by 1327 * the SIM. 1328 * 1329 * @param contents String containing SAT/USAT response in hexadecimal 1330 * format starting with command tag. See TS 102 223 for 1331 * details. 1332 * @param response Callback message 1333 */ sendEnvelope(String contents, Message response)1334 public void sendEnvelope(String contents, Message response); 1335 1336 /** 1337 * Send ENVELOPE to the SIM, such as an SMS-PP data download envelope 1338 * for a SIM data download message. This method has one difference 1339 * from {@link #sendEnvelope}: The SW1 and SW2 status bytes from the UICC response 1340 * are returned along with the response data. 1341 * 1342 * response.obj will be an AsyncResult 1343 * response.obj.result will be an IccIoResult on success 1344 * 1345 * @param contents String containing SAT/USAT response in hexadecimal 1346 * format starting with command tag. See TS 102 223 for 1347 * details. 1348 * @param response Callback message 1349 */ sendEnvelopeWithStatus(String contents, Message response)1350 public void sendEnvelopeWithStatus(String contents, Message response); 1351 1352 /** 1353 * Accept or reject the call setup request from SIM. 1354 * 1355 * @param accept true if the call is to be accepted, false otherwise. 1356 * @param response Callback message 1357 */ handleCallSetupRequestFromSim(boolean accept, Message response)1358 public void handleCallSetupRequestFromSim(boolean accept, Message response); 1359 1360 /** 1361 * Activate or deactivate cell broadcast SMS for GSM. 1362 * 1363 * @param activate 1364 * true = activate, false = deactivate 1365 * @param result Callback message is empty on completion 1366 */ setGsmBroadcastActivation(boolean activate, Message result)1367 public void setGsmBroadcastActivation(boolean activate, Message result); 1368 1369 /** 1370 * Configure cell broadcast SMS for GSM. 1371 * 1372 * @param response Callback message is empty on completion 1373 */ setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response)1374 public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response); 1375 1376 /** 1377 * Query the current configuration of cell broadcast SMS of GSM. 1378 * 1379 * @param response 1380 * Callback message contains the configuration from the modem 1381 * on completion 1382 */ getGsmBroadcastConfig(Message response)1383 public void getGsmBroadcastConfig(Message response); 1384 1385 //***** new Methods for CDMA support 1386 1387 /** 1388 * Request the device ESN / MEID / IMEI / IMEISV. 1389 * "response" is const char ** 1390 * [0] is IMEI if GSM subscription is available 1391 * [1] is IMEISV if GSM subscription is available 1392 * [2] is ESN if CDMA subscription is available 1393 * [3] is MEID if CDMA subscription is available 1394 */ getDeviceIdentity(Message response)1395 public void getDeviceIdentity(Message response); 1396 1397 /** 1398 * Request the device MDN / H_SID / H_NID / MIN. 1399 * "response" is const char ** 1400 * [0] is MDN if CDMA subscription is available 1401 * [1] is a comma separated list of H_SID (Home SID) in decimal format 1402 * if CDMA subscription is available 1403 * [2] is a comma separated list of H_NID (Home NID) in decimal format 1404 * if CDMA subscription is available 1405 * [3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available 1406 */ getCDMASubscription(Message response)1407 public void getCDMASubscription(Message response); 1408 1409 /** 1410 * Send Flash Code. 1411 * "response" is is NULL 1412 * [0] is a FLASH string 1413 */ sendCDMAFeatureCode(String FeatureCode, Message response)1414 public void sendCDMAFeatureCode(String FeatureCode, Message response); 1415 1416 /** Set the Phone type created */ setPhoneType(int phoneType)1417 void setPhoneType(int phoneType); 1418 1419 /** 1420 * Query the CDMA roaming preference setting 1421 * 1422 * @param response is callback message to report one of CDMA_RM_* 1423 */ queryCdmaRoamingPreference(Message response)1424 void queryCdmaRoamingPreference(Message response); 1425 1426 /** 1427 * Requests to set the CDMA roaming preference 1428 * @param cdmaRoamingType one of CDMA_RM_* 1429 * @param response is callback message 1430 */ setCdmaRoamingPreference(int cdmaRoamingType, Message response)1431 void setCdmaRoamingPreference(int cdmaRoamingType, Message response); 1432 1433 /** 1434 * Requests to set the CDMA subscription mode 1435 * @param cdmaSubscriptionType one of CDMA_SUBSCRIPTION_* 1436 * @param response is callback message 1437 */ setCdmaSubscriptionSource(int cdmaSubscriptionType, Message response)1438 void setCdmaSubscriptionSource(int cdmaSubscriptionType, Message response); 1439 1440 /** 1441 * Requests to get the CDMA subscription srouce 1442 * @param response is callback message 1443 */ getCdmaSubscriptionSource(Message response)1444 void getCdmaSubscriptionSource(Message response); 1445 1446 /** 1447 * Set the TTY mode 1448 * 1449 * @param ttyMode one of the following: 1450 * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF} 1451 * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL} 1452 * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO} 1453 * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO} 1454 * @param response is callback message 1455 */ setTTYMode(int ttyMode, Message response)1456 void setTTYMode(int ttyMode, Message response); 1457 1458 /** 1459 * Query the TTY mode 1460 * (AsyncResult)response.obj).result is an int[] with element [0] set to 1461 * tty mode: 1462 * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF} 1463 * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL} 1464 * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO} 1465 * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO} 1466 * @param response is callback message 1467 */ queryTTYMode(Message response)1468 void queryTTYMode(Message response); 1469 1470 /** 1471 * Setup a packet data connection On successful completion, the result 1472 * message will return a {@link com.android.internal.telephony.dataconnection.DataCallResponse} 1473 * object containing the connection information. 1474 * 1475 * @param radioTechnology 1476 * indicates whether to setup connection on radio technology CDMA 1477 * (0) or GSM/UMTS (1) 1478 * @param profile 1479 * Profile Number or NULL to indicate default profile 1480 * @param apn 1481 * the APN to connect to if radio technology is GSM/UMTS. 1482 * Otherwise null for CDMA. 1483 * @param user 1484 * the username for APN, or NULL 1485 * @param password 1486 * the password for APN, or NULL 1487 * @param authType 1488 * the PAP / CHAP auth type. Values is one of SETUP_DATA_AUTH_* 1489 * @param protocol 1490 * one of the PDP_type values in TS 27.007 section 10.1.1. 1491 * For example, "IP", "IPV6", "IPV4V6", or "PPP". 1492 * @param result 1493 * Callback message 1494 */ setupDataCall(String radioTechnology, String profile, String apn, String user, String password, String authType, String protocol, Message result)1495 public void setupDataCall(String radioTechnology, String profile, 1496 String apn, String user, String password, String authType, 1497 String protocol, Message result); 1498 1499 /** 1500 * Deactivate packet data connection 1501 * 1502 * @param cid 1503 * The connection ID 1504 * @param reason 1505 * Data disconnect reason. 1506 * @param result 1507 * Callback message is empty on completion 1508 */ deactivateDataCall(int cid, int reason, Message result)1509 public void deactivateDataCall(int cid, int reason, Message result); 1510 1511 /** 1512 * Activate or deactivate cell broadcast SMS for CDMA. 1513 * 1514 * @param activate 1515 * true = activate, false = deactivate 1516 * @param result 1517 * Callback message is empty on completion 1518 */ setCdmaBroadcastActivation(boolean activate, Message result)1519 public void setCdmaBroadcastActivation(boolean activate, Message result); 1520 1521 /** 1522 * Configure cdma cell broadcast SMS. 1523 * 1524 * @param response 1525 * Callback message is empty on completion 1526 */ setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response)1527 public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response); 1528 1529 /** 1530 * Query the current configuration of cdma cell broadcast SMS. 1531 * 1532 * @param result 1533 * Callback message contains the configuration from the modem on completion 1534 */ getCdmaBroadcastConfig(Message result)1535 public void getCdmaBroadcastConfig(Message result); 1536 1537 /** 1538 * Requests the radio's system selection module to exit emergency callback mode. 1539 * This function should only be called from CDMAPHone.java. 1540 * 1541 * @param response callback message 1542 */ exitEmergencyCallbackMode(Message response)1543 public void exitEmergencyCallbackMode(Message response); 1544 1545 /** 1546 * Request the status of the ICC and UICC cards. 1547 * 1548 * @param result 1549 * Callback message containing {@link IccCardStatus} structure for the card. 1550 */ getIccCardStatus(Message result)1551 public void getIccCardStatus(Message result); 1552 1553 /** 1554 * Return if the current radio is LTE on CDMA. This 1555 * is a tri-state return value as for a period of time 1556 * the mode may be unknown. 1557 * 1558 * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE} 1559 * or {@link PhoneConstants#LTE_ON_CDMA_TRUE} 1560 */ getLteOnCdmaMode()1561 public int getLteOnCdmaMode(); 1562 1563 /** 1564 * Request the ISIM application on the UICC to perform the AKA 1565 * challenge/response algorithm for IMS authentication. The nonce string 1566 * and challenge response are Base64 encoded Strings. 1567 * 1568 * @param nonce the nonce string to pass with the ISIM authentication request 1569 * @param response a callback message with the String response in the obj field 1570 */ requestIsimAuthentication(String nonce, Message response)1571 public void requestIsimAuthentication(String nonce, Message response); 1572 1573 /** 1574 * Get the current Voice Radio Technology. 1575 * 1576 * AsyncResult.result is an int array with the first value 1577 * being one of the ServiceState.RIL_RADIO_TECHNOLOGY_xxx values. 1578 * 1579 * @param result is sent back to handler and result.obj is a AsyncResult 1580 */ getVoiceRadioTechnology(Message result)1581 void getVoiceRadioTechnology(Message result); 1582 1583 /** 1584 * Return the current set of CellInfo records 1585 * 1586 * AsyncResult.result is a of Collection<CellInfo> 1587 * 1588 * @param result is sent back to handler and result.obj is a AsyncResult 1589 */ getCellInfoList(Message result)1590 void getCellInfoList(Message result); 1591 1592 /** 1593 * Sets the minimum time in milli-seconds between when RIL_UNSOL_CELL_INFO_LIST 1594 * should be invoked. 1595 * 1596 * The default, 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported 1597 * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue 1598 * A RIL_UNSOL_CELL_INFO_LIST. 1599 * 1600 * 1601 1602 * @param rateInMillis is sent back to handler and result.obj is a AsyncResult 1603 * @param response.obj is AsyncResult ar when sent to associated handler 1604 * ar.exception carries exception on failure or null on success 1605 * otherwise the error. 1606 */ setCellInfoListRate(int rateInMillis, Message response)1607 void setCellInfoListRate(int rateInMillis, Message response); 1608 1609 /** 1610 * Fires when RIL_UNSOL_CELL_INFO_LIST is received from the RIL. 1611 */ registerForCellInfoList(Handler h, int what, Object obj)1612 void registerForCellInfoList(Handler h, int what, Object obj); unregisterForCellInfoList(Handler h)1613 void unregisterForCellInfoList(Handler h); 1614 1615 /** 1616 * Notifiy that we are testing an emergency call 1617 */ testingEmergencyCall()1618 public void testingEmergencyCall(); 1619 1620 1621 /** 1622 * @return version of the ril. 1623 */ getRilVersion()1624 int getRilVersion(); 1625 } 1626