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