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.gsm.SmsBroadcastConfigInfo; 20 21 import android.os.Message; 22 import android.os.Handler; 23 24 25 /** 26 * {@hide} 27 */ 28 public interface CommandsInterface { 29 enum RadioState { 30 RADIO_OFF, /* Radio explictly powered off (eg CFUN=0) */ 31 RADIO_UNAVAILABLE, /* Radio unavailable (eg, resetting or not booted) */ 32 SIM_NOT_READY, /* Radio is on, but the SIM interface is not ready */ 33 SIM_LOCKED_OR_ABSENT, /* SIM PIN locked, PUK required, network 34 personalization, or SIM absent */ 35 SIM_READY, /* Radio is on and SIM interface is available */ 36 RUIM_NOT_READY, /* Radio is on, but the RUIM interface is not ready */ 37 RUIM_READY, /* Radio is on and the RUIM interface is available */ 38 RUIM_LOCKED_OR_ABSENT, /* RUIM PIN locked, PUK required, network 39 personalization locked, or RUIM absent */ 40 NV_NOT_READY, /* Radio is on, but the NV interface is not available */ 41 NV_READY; /* Radio is on and the NV interface is available */ 42 isOn()43 public boolean isOn() /* and available...*/ { 44 return this == SIM_NOT_READY 45 || this == SIM_LOCKED_OR_ABSENT 46 || this == SIM_READY 47 || this == RUIM_NOT_READY 48 || this == RUIM_READY 49 || this == RUIM_LOCKED_OR_ABSENT 50 || this == NV_NOT_READY 51 || this == NV_READY; 52 } 53 isAvailable()54 public boolean isAvailable() { 55 return this != RADIO_UNAVAILABLE; 56 } 57 isSIMReady()58 public boolean isSIMReady() { 59 return this == SIM_READY; 60 } 61 isRUIMReady()62 public boolean isRUIMReady() { 63 return this == RUIM_READY; 64 } 65 isNVReady()66 public boolean isNVReady() { 67 return this == NV_READY; 68 } 69 isGsm()70 public boolean isGsm() { 71 return this == SIM_NOT_READY 72 || this == SIM_LOCKED_OR_ABSENT 73 || this == SIM_READY; 74 } 75 isCdma()76 public boolean isCdma() { 77 return this == RUIM_NOT_READY 78 || this == RUIM_READY 79 || this == RUIM_LOCKED_OR_ABSENT 80 || this == NV_NOT_READY 81 || this == NV_READY; 82 } 83 } 84 85 //***** Constants 86 87 // Used as parameter to dial() and setCLIR() below 88 static final int CLIR_DEFAULT = 0; // "use subscription default value" 89 static final int CLIR_INVOCATION = 1; // (restrict CLI presentation) 90 static final int CLIR_SUPPRESSION = 2; // (allow CLI presentation) 91 92 93 // Used as parameters for call forward methods below 94 static final int CF_ACTION_DISABLE = 0; 95 static final int CF_ACTION_ENABLE = 1; 96 // static final int CF_ACTION_UNUSED = 2; 97 static final int CF_ACTION_REGISTRATION = 3; 98 static final int CF_ACTION_ERASURE = 4; 99 100 static final int CF_REASON_UNCONDITIONAL = 0; 101 static final int CF_REASON_BUSY = 1; 102 static final int CF_REASON_NO_REPLY = 2; 103 static final int CF_REASON_NOT_REACHABLE = 3; 104 static final int CF_REASON_ALL = 4; 105 static final int CF_REASON_ALL_CONDITIONAL = 5; 106 107 // Used for call barring methods below 108 static final String CB_FACILITY_BAOC = "AO"; 109 static final String CB_FACILITY_BAOIC = "OI"; 110 static final String CB_FACILITY_BAOICxH = "OX"; 111 static final String CB_FACILITY_BAIC = "AI"; 112 static final String CB_FACILITY_BAICr = "IR"; 113 static final String CB_FACILITY_BA_ALL = "AB"; 114 static final String CB_FACILITY_BA_MO = "AG"; 115 static final String CB_FACILITY_BA_MT = "AC"; 116 static final String CB_FACILITY_BA_SIM = "SC"; 117 static final String CB_FACILITY_BA_FD = "FD"; 118 119 120 // Used for various supp services apis 121 // See 27.007 +CCFC or +CLCK 122 static final int SERVICE_CLASS_NONE = 0; // no user input 123 static final int SERVICE_CLASS_VOICE = (1 << 0); 124 static final int SERVICE_CLASS_DATA = (1 << 1); //synoym for 16+32+64+128 125 static final int SERVICE_CLASS_FAX = (1 << 2); 126 static final int SERVICE_CLASS_SMS = (1 << 3); 127 static final int SERVICE_CLASS_DATA_SYNC = (1 << 4); 128 static final int SERVICE_CLASS_DATA_ASYNC = (1 << 5); 129 static final int SERVICE_CLASS_PACKET = (1 << 6); 130 static final int SERVICE_CLASS_PAD = (1 << 7); 131 static final int SERVICE_CLASS_MAX = (1 << 7); // Max SERVICE_CLASS value 132 133 // Numeric representation of string values returned 134 // by messages sent to setOnUSSD handler 135 static final int USSD_MODE_NOTIFY = 0; 136 static final int USSD_MODE_REQUEST = 1; 137 138 // SIM Refresh results, passed up from RIL. 139 static final int SIM_REFRESH_FILE_UPDATED = 0; // Single file updated 140 static final int SIM_REFRESH_INIT = 1; // SIM initialized; reload all 141 static final int SIM_REFRESH_RESET = 2; // SIM reset; may be locked 142 143 // GSM SMS fail cause for acknowledgeLastIncomingSMS. From TS 23.040, 9.2.3.22. 144 static final int GSM_SMS_FAIL_CAUSE_MEMORY_CAPACITY_EXCEEDED = 0xD3; 145 static final int GSM_SMS_FAIL_CAUSE_UNSPECIFIED_ERROR = 0xFF; 146 147 // CDMA SMS fail cause for acknowledgeLastIncomingCdmaSms. From TS N.S0005, 6.5.2.125. 148 static final int CDMA_SMS_FAIL_CAUSE_INVALID_TELESERVICE_ID = 4; 149 static final int CDMA_SMS_FAIL_CAUSE_RESOURCE_SHORTAGE = 35; 150 static final int CDMA_SMS_FAIL_CAUSE_OTHER_TERMINAL_PROBLEM = 39; 151 static final int CDMA_SMS_FAIL_CAUSE_ENCODING_PROBLEM = 96; 152 153 //***** Methods 154 getRadioState()155 RadioState getRadioState(); 156 157 /** 158 * Fires on any RadioState transition 159 * Always fires immediately as well 160 * 161 * do not attempt to calculate transitions by storing getRadioState() values 162 * on previous invocations of this notification. Instead, use the other 163 * registration methods 164 */ registerForRadioStateChanged(Handler h, int what, Object obj)165 void registerForRadioStateChanged(Handler h, int what, Object obj); unregisterForRadioStateChanged(Handler h)166 void unregisterForRadioStateChanged(Handler h); 167 168 /** 169 * Fires on any transition into RadioState.isOn() 170 * Fires immediately if currently in that state 171 * In general, actions should be idempotent. State may change 172 * before event is received. 173 */ registerForOn(Handler h, int what, Object obj)174 void registerForOn(Handler h, int what, Object obj); unregisterForOn(Handler h)175 void unregisterForOn(Handler h); 176 177 /** 178 * Fires on any transition out of RadioState.isAvailable() 179 * Fires immediately if currently in that state 180 * In general, actions should be idempotent. State may change 181 * before event is received. 182 */ registerForAvailable(Handler h, int what, Object obj)183 void registerForAvailable(Handler h, int what, Object obj); unregisterForAvailable(Handler h)184 void unregisterForAvailable(Handler h); 185 186 /** 187 * Fires on any transition into !RadioState.isAvailable() 188 * Fires immediately if currently in that state 189 * In general, actions should be idempotent. State may change 190 * before event is received. 191 */ registerForNotAvailable(Handler h, int what, Object obj)192 void registerForNotAvailable(Handler h, int what, Object obj); unregisterForNotAvailable(Handler h)193 void unregisterForNotAvailable(Handler h); 194 195 /** 196 * Fires on any transition into RADIO_OFF or !RadioState.isAvailable() 197 * Fires immediately if currently in that state 198 * In general, actions should be idempotent. State may change 199 * before event is received. 200 */ registerForOffOrNotAvailable(Handler h, int what, Object obj)201 void registerForOffOrNotAvailable(Handler h, int what, Object obj); unregisterForOffOrNotAvailable(Handler h)202 void unregisterForOffOrNotAvailable(Handler h); 203 204 /** 205 * Fires on any transition into SIM_READY 206 * Fires immediately if if currently in that state 207 * In general, actions should be idempotent. State may change 208 * before event is received. 209 */ registerForSIMReady(Handler h, int what, Object obj)210 void registerForSIMReady(Handler h, int what, Object obj); unregisterForSIMReady(Handler h)211 void unregisterForSIMReady(Handler h); 212 213 /** Any transition into SIM_LOCKED_OR_ABSENT */ registerForSIMLockedOrAbsent(Handler h, int what, Object obj)214 void registerForSIMLockedOrAbsent(Handler h, int what, Object obj); unregisterForSIMLockedOrAbsent(Handler h)215 void unregisterForSIMLockedOrAbsent(Handler h); 216 registerForCallStateChanged(Handler h, int what, Object obj)217 void registerForCallStateChanged(Handler h, int what, Object obj); unregisterForCallStateChanged(Handler h)218 void unregisterForCallStateChanged(Handler h); registerForNetworkStateChanged(Handler h, int what, Object obj)219 void registerForNetworkStateChanged(Handler h, int what, Object obj); unregisterForNetworkStateChanged(Handler h)220 void unregisterForNetworkStateChanged(Handler h); registerForDataStateChanged(Handler h, int what, Object obj)221 void registerForDataStateChanged(Handler h, int what, Object obj); unregisterForDataStateChanged(Handler h)222 void unregisterForDataStateChanged(Handler h); 223 registerForRadioTechnologyChanged(Handler h, int what, Object obj)224 void registerForRadioTechnologyChanged(Handler h, int what, Object obj); unregisterForRadioTechnologyChanged(Handler h)225 void unregisterForRadioTechnologyChanged(Handler h); registerForNVReady(Handler h, int what, Object obj)226 void registerForNVReady(Handler h, int what, Object obj); unregisterForNVReady(Handler h)227 void unregisterForNVReady(Handler h); registerForRUIMLockedOrAbsent(Handler h, int what, Object obj)228 void registerForRUIMLockedOrAbsent(Handler h, int what, Object obj); unregisterForRUIMLockedOrAbsent(Handler h)229 void unregisterForRUIMLockedOrAbsent(Handler h); 230 231 /** InCall voice privacy notifications */ registerForInCallVoicePrivacyOn(Handler h, int what, Object obj)232 void registerForInCallVoicePrivacyOn(Handler h, int what, Object obj); unregisterForInCallVoicePrivacyOn(Handler h)233 void unregisterForInCallVoicePrivacyOn(Handler h); registerForInCallVoicePrivacyOff(Handler h, int what, Object obj)234 void registerForInCallVoicePrivacyOff(Handler h, int what, Object obj); unregisterForInCallVoicePrivacyOff(Handler h)235 void unregisterForInCallVoicePrivacyOff(Handler h); 236 237 /** 238 * Fires on any transition into RUIM_READY 239 * Fires immediately if if currently in that state 240 * In general, actions should be idempotent. State may change 241 * before event is received. 242 */ registerForRUIMReady(Handler h, int what, Object obj)243 void registerForRUIMReady(Handler h, int what, Object obj); unregisterForRUIMReady(Handler h)244 void unregisterForRUIMReady(Handler h); 245 246 /** 247 * unlike the register* methods, there's only one new SMS handler 248 * if you need to unregister, you should also tell the radio to stop 249 * sending SMS's to you (via AT+CNMI) 250 * 251 * AsyncResult.result is a String containing the SMS PDU 252 */ setOnNewSMS(Handler h, int what, Object obj)253 void setOnNewSMS(Handler h, int what, Object obj); unSetOnNewSMS(Handler h)254 void unSetOnNewSMS(Handler h); 255 256 /** 257 * Register for NEW_SMS_ON_SIM unsolicited message 258 * 259 * AsyncResult.result is an int array containing the index of new SMS 260 */ setOnSmsOnSim(Handler h, int what, Object obj)261 void setOnSmsOnSim(Handler h, int what, Object obj); unSetOnSmsOnSim(Handler h)262 void unSetOnSmsOnSim(Handler h); 263 264 /** 265 * Register for NEW_SMS_STATUS_REPORT unsolicited message 266 * 267 * AsyncResult.result is a String containing the status report PDU 268 */ setOnSmsStatus(Handler h, int what, Object obj)269 void setOnSmsStatus(Handler h, int what, Object obj); unSetOnSmsStatus(Handler h)270 void unSetOnSmsStatus(Handler h); 271 272 /** 273 * unlike the register* methods, there's only one NITZ time handler 274 * 275 * AsyncResult.result is an Object[] 276 * ((Object[])AsyncResult.result)[0] is a String containing the NITZ time string 277 * ((Object[])AsyncResult.result)[1] is a Long containing the milliseconds since boot as 278 * returned by elapsedRealtime() when this NITZ time 279 * was posted. 280 * 281 * Please note that the delivery of this message may be delayed several 282 * seconds on system startup 283 */ setOnNITZTime(Handler h, int what, Object obj)284 void setOnNITZTime(Handler h, int what, Object obj); unSetOnNITZTime(Handler h)285 void unSetOnNITZTime(Handler h); 286 287 /** 288 * unlike the register* methods, there's only one USSD notify handler 289 * 290 * Represents the arrival of a USSD "notify" message, which may 291 * or may not have been triggered by a previous USSD send 292 * 293 * AsyncResult.result is a String[] 294 * ((String[])(AsyncResult.result))[0] contains status code 295 * "0" USSD-Notify -- text in ((const char **)data)[1] 296 * "1" USSD-Request -- text in ((const char **)data)[1] 297 * "2" Session terminated by network 298 * "3" other local client (eg, SIM Toolkit) has responded 299 * "4" Operation not supported 300 * "5" Network timeout 301 * 302 * ((String[])(AsyncResult.result))[1] contains the USSD message 303 * The numeric representations of these are in USSD_MODE_* 304 */ 305 setOnUSSD(Handler h, int what, Object obj)306 void setOnUSSD(Handler h, int what, Object obj); unSetOnUSSD(Handler h)307 void unSetOnUSSD(Handler h); 308 309 /** 310 * unlike the register* methods, there's only one signal strength handler 311 * AsyncResult.result is an int[2] 312 * response.obj.result[0] is received signal strength (0-31, 99) 313 * response.obj.result[1] is bit error rate (0-7, 99) 314 * as defined in TS 27.007 8.5 315 */ 316 setOnSignalStrengthUpdate(Handler h, int what, Object obj)317 void setOnSignalStrengthUpdate(Handler h, int what, Object obj); unSetOnSignalStrengthUpdate(Handler h)318 void unSetOnSignalStrengthUpdate(Handler h); 319 320 /** 321 * Sets the handler for SIM/RUIM SMS storage full unsolicited message. 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 */ setOnIccSmsFull(Handler h, int what, Object obj)328 void setOnIccSmsFull(Handler h, int what, Object obj); unSetOnIccSmsFull(Handler h)329 void unSetOnIccSmsFull(Handler h); 330 331 /** 332 * Sets the handler for SIM Refresh 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 */ setOnIccRefresh(Handler h, int what, Object obj)339 void setOnIccRefresh(Handler h, int what, Object obj); unSetOnIccRefresh(Handler h)340 void unSetOnIccRefresh(Handler h); 341 342 /** 343 * Sets the handler for RING notifications. 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 */ setOnCallRing(Handler h, int what, Object obj)350 void setOnCallRing(Handler h, int what, Object obj); unSetOnCallRing(Handler h)351 void unSetOnCallRing(Handler h); 352 353 /** 354 * Sets the handler for RESTRICTED_STATE changed notification, 355 * eg, for Domain Specific Access Control 356 * unlike the register* methods, there's only one signal strength handler 357 * 358 * AsyncResult.result is an int[1] 359 * response.obj.result[0] is a bitmask of RIL_RESTRICTED_STATE_* values 360 */ 361 setOnRestrictedStateChanged(Handler h, int what, Object obj)362 void setOnRestrictedStateChanged(Handler h, int what, Object obj); unSetOnRestrictedStateChanged(Handler h)363 void unSetOnRestrictedStateChanged(Handler h); 364 365 /** 366 * Sets the handler for Supplementary Service Notifications. 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 */ setOnSuppServiceNotification(Handler h, int what, Object obj)373 void setOnSuppServiceNotification(Handler h, int what, Object obj); unSetOnSuppServiceNotification(Handler h)374 void unSetOnSuppServiceNotification(Handler h); 375 376 /** 377 * Sets the handler for Session End Notifications for STK. 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 */ setOnStkSessionEnd(Handler h, int what, Object obj)384 void setOnStkSessionEnd(Handler h, int what, Object obj); unSetOnStkSessionEnd(Handler h)385 void unSetOnStkSessionEnd(Handler h); 386 387 /** 388 * Sets the handler for Proactive Commands for STK. 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 */ setOnStkProactiveCmd(Handler h, int what, Object obj)395 void setOnStkProactiveCmd(Handler h, int what, Object obj); unSetOnStkProactiveCmd(Handler h)396 void unSetOnStkProactiveCmd(Handler h); 397 398 /** 399 * Sets the handler for Event Notifications for STK. 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 */ setOnStkEvent(Handler h, int what, Object obj)406 void setOnStkEvent(Handler h, int what, Object obj); unSetOnStkEvent(Handler h)407 void unSetOnStkEvent(Handler h); 408 409 /** 410 * Sets the handler for Call Set Up Notifications for STK. 411 * Unlike the register* methods, there's only one notification handler 412 * 413 * @param h Handler for notification message. 414 * @param what User-defined message code. 415 * @param obj User object. 416 */ setOnStkCallSetUp(Handler h, int what, Object obj)417 void setOnStkCallSetUp(Handler h, int what, Object obj); unSetOnStkCallSetUp(Handler h)418 void unSetOnStkCallSetUp(Handler h); 419 420 /** 421 * Enables/disbables supplementary service related notifications from 422 * the network. 423 * 424 * @param enable true to enable notifications, false to disable. 425 * @param result Message to be posted when command completes. 426 */ setSuppServiceNotifications(boolean enable, Message result)427 void setSuppServiceNotifications(boolean enable, Message result); 428 //void unSetSuppServiceNotifications(Handler h); 429 430 /** 431 * Sets the handler for Event Notifications for CDMA Display 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 */ registerForDisplayInfo(Handler h, int what, Object obj)438 void registerForDisplayInfo(Handler h, int what, Object obj); unregisterForDisplayInfo(Handler h)439 void unregisterForDisplayInfo(Handler h); 440 441 /** 442 * Sets the handler for Event Notifications for CallWaiting 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 */ registerForCallWaitingInfo(Handler h, int what, Object obj)449 void registerForCallWaitingInfo(Handler h, int what, Object obj); unregisterForCallWaitingInfo(Handler h)450 void unregisterForCallWaitingInfo(Handler h); 451 452 /** 453 * Sets the handler for Event Notifications for Signal Info. 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 */ registerForSignalInfo(Handler h, int what, Object obj)460 void registerForSignalInfo(Handler h, int what, Object obj); unregisterForSignalInfo(Handler h)461 void unregisterForSignalInfo(Handler h); 462 463 /** 464 * Registers the handler for CDMA 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 */ registerForNumberInfo(Handler h, int what, Object obj)471 void registerForNumberInfo(Handler h, int what, Object obj); unregisterForNumberInfo(Handler h)472 void unregisterForNumberInfo(Handler h); 473 474 /** 475 * Registers the handler for CDMA redirected number 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 */ registerForRedirectedNumberInfo(Handler h, int what, Object obj)482 void registerForRedirectedNumberInfo(Handler h, int what, Object obj); unregisterForRedirectedNumberInfo(Handler h)483 void unregisterForRedirectedNumberInfo(Handler h); 484 485 /** 486 * Registers the handler for CDMA line control 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 */ registerForLineControlInfo(Handler h, int what, Object obj)493 void registerForLineControlInfo(Handler h, int what, Object obj); unregisterForLineControlInfo(Handler h)494 void unregisterForLineControlInfo(Handler h); 495 496 /** 497 * Registers the handler for CDMA T53 CLIR 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 */ registerFoT53ClirlInfo(Handler h, int what, Object obj)504 void registerFoT53ClirlInfo(Handler h, int what, Object obj); unregisterForT53ClirInfo(Handler h)505 void unregisterForT53ClirInfo(Handler h); 506 507 /** 508 * Registers the handler for CDMA T53 audio control information record 509 * Unlike the register* methods, there's only one notification handler 510 * 511 * @param h Handler for notification message. 512 * @param what User-defined message code. 513 * @param obj User object. 514 */ registerForT53AudioControlInfo(Handler h, int what, Object obj)515 void registerForT53AudioControlInfo(Handler h, int what, Object obj); unregisterForT53AudioControlInfo(Handler h)516 void unregisterForT53AudioControlInfo(Handler h); 517 518 /** 519 * Fires on if Modem enters Emergency Callback mode 520 */ setEmergencyCallbackMode(Handler h, int what, Object obj)521 void setEmergencyCallbackMode(Handler h, int what, Object obj); 522 523 /** 524 * Fires on any CDMA OTA provision status change 525 */ registerForCdmaOtaProvision(Handler h,int what, Object obj)526 void registerForCdmaOtaProvision(Handler h,int what, Object obj); unregisterForCdmaOtaProvision(Handler h)527 void unregisterForCdmaOtaProvision(Handler h); 528 529 /** 530 * Registers the handler when out-band ringback tone is needed.<p> 531 * 532 * Messages received from this: 533 * Message.obj will be an AsyncResult 534 * AsyncResult.userObj = obj 535 * AsyncResult.result = boolean. <p> 536 */ registerForRingbackTone(Handler h, int what, Object obj)537 void registerForRingbackTone(Handler h, int what, Object obj); unregisterForRingbackTone(Handler h)538 void unregisterForRingbackTone(Handler h); 539 540 /** 541 * Supply the ICC PIN to the ICC card 542 * 543 * returned message 544 * retMsg.obj = AsyncResult ar 545 * ar.exception carries exception on failure 546 * This exception is CommandException with an error of PASSWORD_INCORRECT 547 * if the password is incorrect 548 * 549 * ar.exception and ar.result are null on success 550 */ 551 supplyIccPin(String pin, Message result)552 void supplyIccPin(String pin, Message result); 553 554 /** 555 * Supply the ICC PUK 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 supplyIccPuk(String puk, String newPin, Message result)566 void supplyIccPuk(String puk, String newPin, Message result); 567 568 /** 569 * Supply the ICC PIN2 to the ICC card 570 * Only called following operation where ICC_PIN2 was 571 * returned as a a failure from a previous operation 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 supplyIccPin2(String pin2, Message result)582 void supplyIccPin2(String pin2, Message result); 583 584 /** 585 * Supply the SIM PUK2 to the SIM card 586 * Only called following operation where SIM_PUK2 was 587 * returned as a a failure from a previous operation 588 * 589 * returned message 590 * retMsg.obj = AsyncResult ar 591 * ar.exception carries exception on failure 592 * This exception is CommandException with an error of PASSWORD_INCORRECT 593 * if the password is incorrect 594 * 595 * ar.exception and ar.result are null on success 596 */ 597 supplyIccPuk2(String puk2, String newPin2, Message result)598 void supplyIccPuk2(String puk2, String newPin2, Message result); 599 changeIccPin(String oldPin, String newPin, Message result)600 void changeIccPin(String oldPin, String newPin, Message result); changeIccPin2(String oldPin2, String newPin2, Message result)601 void changeIccPin2(String oldPin2, String newPin2, Message result); 602 changeBarringPassword(String facility, String oldPwd, String newPwd, Message result)603 void changeBarringPassword(String facility, String oldPwd, String newPwd, Message result); 604 supplyNetworkDepersonalization(String netpin, Message result)605 void supplyNetworkDepersonalization(String netpin, Message result); 606 607 /** 608 * returned message 609 * retMsg.obj = AsyncResult ar 610 * ar.exception carries exception on failure 611 * ar.userObject contains the orignal value of result.obj 612 * ar.result contains a List of DriverCall 613 * The ar.result List is sorted by DriverCall.index 614 */ getCurrentCalls(Message result)615 void getCurrentCalls (Message result); 616 617 /** 618 * returned message 619 * retMsg.obj = AsyncResult ar 620 * ar.exception carries exception on failure 621 * ar.userObject contains the orignal value of result.obj 622 * ar.result contains a List of DataCallState 623 * @deprecated Do not use. 624 */ 625 @Deprecated getPDPContextList(Message result)626 void getPDPContextList(Message result); 627 628 /** 629 * returned message 630 * retMsg.obj = AsyncResult ar 631 * ar.exception carries exception on failure 632 * ar.userObject contains the orignal value of result.obj 633 * ar.result contains a List of DataCallState 634 */ getDataCallList(Message result)635 void getDataCallList(Message result); 636 637 /** 638 * returned message 639 * retMsg.obj = AsyncResult ar 640 * ar.exception carries exception on failure 641 * ar.userObject contains the orignal value of result.obj 642 * ar.result is null on success and failure 643 * 644 * CLIR_DEFAULT == on "use subscription default value" 645 * CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation) 646 * CLIR_INVOCATION == on "CLIR invocation" (restrict CLI presentation) 647 */ dial(String address, int clirMode, Message result)648 void dial (String address, int clirMode, Message result); 649 650 /** 651 * returned message 652 * retMsg.obj = AsyncResult ar 653 * ar.exception carries exception on failure 654 * ar.userObject contains the orignal value of result.obj 655 * ar.result is String containing IMSI on success 656 */ getIMSI(Message result)657 void getIMSI(Message result); 658 659 /** 660 * returned message 661 * retMsg.obj = AsyncResult ar 662 * ar.exception carries exception on failure 663 * ar.userObject contains the orignal value of result.obj 664 * ar.result is String containing IMEI on success 665 */ getIMEI(Message result)666 void getIMEI(Message result); 667 668 /** 669 * returned message 670 * retMsg.obj = AsyncResult ar 671 * ar.exception carries exception on failure 672 * ar.userObject contains the orignal value of result.obj 673 * ar.result is String containing IMEISV on success 674 */ getIMEISV(Message result)675 void getIMEISV(Message result); 676 677 /** 678 * Hang up one individual connection. 679 * returned message 680 * retMsg.obj = AsyncResult ar 681 * ar.exception carries exception on failure 682 * ar.userObject contains the orignal value of result.obj 683 * ar.result is null on success and failure 684 * 685 * 3GPP 22.030 6.5.5 686 * "Releases a specific active call X" 687 */ hangupConnection(int gsmIndex, Message result)688 void hangupConnection (int gsmIndex, Message result); 689 690 /** 691 * 3GPP 22.030 6.5.5 692 * "Releases all held calls or sets User Determined User Busy (UDUB) 693 * for a waiting call." 694 * ar.exception carries exception on failure 695 * ar.userObject contains the orignal value of result.obj 696 * ar.result is null on success and failure 697 */ hangupWaitingOrBackground(Message result)698 void hangupWaitingOrBackground (Message result); 699 700 /** 701 * 3GPP 22.030 6.5.5 702 * "Releases all active calls (if any exist) and accepts 703 * the other (held or waiting) call." 704 * 705 * ar.exception carries exception on failure 706 * ar.userObject contains the orignal value of result.obj 707 * ar.result is null on success and failure 708 */ hangupForegroundResumeBackground(Message result)709 void hangupForegroundResumeBackground (Message result); 710 711 /** 712 * 3GPP 22.030 6.5.5 713 * "Places all active calls (if any exist) on hold and accepts 714 * the other (held or waiting) call." 715 * 716 * ar.exception carries exception on failure 717 * ar.userObject contains the orignal value of result.obj 718 * ar.result is null on success and failure 719 */ switchWaitingOrHoldingAndActive(Message result)720 void switchWaitingOrHoldingAndActive (Message result); 721 722 /** 723 * 3GPP 22.030 6.5.5 724 * "Adds a held call to the conversation" 725 * 726 * ar.exception carries exception on failure 727 * ar.userObject contains the orignal value of result.obj 728 * ar.result is null on success and failure 729 */ conference(Message result)730 void conference (Message result); 731 732 /** 733 * Set preferred Voice Privacy (VP). 734 * 735 * @param enable true is enhanced and false is normal VP 736 * @param result is a callback message 737 */ setPreferredVoicePrivacy(boolean enable, Message result)738 void setPreferredVoicePrivacy(boolean enable, Message result); 739 740 /** 741 * Get currently set preferred Voice Privacy (VP) mode. 742 * 743 * @param result is a callback message 744 */ getPreferredVoicePrivacy(Message result)745 void getPreferredVoicePrivacy(Message result); 746 747 /** 748 * 3GPP 22.030 6.5.5 749 * "Places all active calls on hold except call X with which 750 * communication shall be supported." 751 */ separateConnection(int gsmIndex, Message result)752 void separateConnection (int gsmIndex, Message result); 753 754 /** 755 * 756 * ar.exception carries exception on failure 757 * ar.userObject contains the orignal value of result.obj 758 * ar.result is null on success and failure 759 */ acceptCall(Message result)760 void acceptCall (Message result); 761 762 /** 763 * also known as UDUB 764 * ar.exception carries exception on failure 765 * ar.userObject contains the orignal value of result.obj 766 * ar.result is null on success and failure 767 */ rejectCall(Message result)768 void rejectCall (Message result); 769 770 /** 771 * 3GPP 22.030 6.5.5 772 * "Connects the two calls and disconnects the subscriber from both calls" 773 * 774 * ar.exception carries exception on failure 775 * ar.userObject contains the orignal value of result.obj 776 * ar.result is null on success and failure 777 */ explicitCallTransfer(Message result)778 void explicitCallTransfer (Message result); 779 780 /** 781 * cause code returned as int[0] in Message.obj.response 782 * Returns integer cause code defined in TS 24.008 783 * Annex H or closest approximation. 784 * Most significant codes: 785 * - Any defined in 22.001 F.4 (for generating busy/congestion) 786 * - Cause 68: ACM >= ACMMax 787 */ getLastCallFailCause(Message result)788 void getLastCallFailCause (Message result); 789 790 791 /** 792 * Reason for last PDP context deactivate or failure to activate 793 * cause code returned as int[0] in Message.obj.response 794 * returns an integer cause code defined in TS 24.008 795 * section 6.1.3.1.3 or close approximation 796 * @deprecated Do not use. 797 */ 798 @Deprecated getLastPdpFailCause(Message result)799 void getLastPdpFailCause (Message result); 800 801 /** 802 * The preferred new alternative to getLastPdpFailCause 803 * that is also CDMA-compatible. 804 */ getLastDataCallFailCause(Message result)805 void getLastDataCallFailCause (Message result); 806 setMute(boolean enableMute, Message response)807 void setMute (boolean enableMute, Message response); 808 getMute(Message response)809 void getMute (Message response); 810 811 /** 812 * response.obj is an AsyncResult 813 * response.obj.result is an int[2] 814 * response.obj.result[0] is received signal strength (0-31, 99) 815 * response.obj.result[1] is bit error rate (0-7, 99) 816 * as defined in TS 27.007 8.5 817 */ getSignalStrength(Message response)818 void getSignalStrength (Message response); 819 820 821 /** 822 * response.obj.result is an int[3] 823 * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2 824 * response.obj.result[1] is LAC if registered or -1 if not 825 * response.obj.result[2] is CID if registered or -1 if not 826 * valid LAC and CIDs are 0x0000 - 0xffff 827 * 828 * Please note that registration state 4 ("unknown") is treated 829 * as "out of service" above 830 */ getRegistrationState(Message response)831 void getRegistrationState (Message response); 832 833 /** 834 * response.obj.result is an int[3] 835 * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2 836 * response.obj.result[1] is LAC if registered or -1 if not 837 * response.obj.result[2] is CID if registered or -1 if not 838 * valid LAC and CIDs are 0x0000 - 0xffff 839 * 840 * Please note that registration state 4 ("unknown") is treated 841 * as "out of service" above 842 */ getGPRSRegistrationState(Message response)843 void getGPRSRegistrationState (Message response); 844 845 /** 846 * response.obj.result is a String[3] 847 * response.obj.result[0] is long alpha or null if unregistered 848 * response.obj.result[1] is short alpha or null if unregistered 849 * response.obj.result[2] is numeric or null if unregistered 850 */ getOperator(Message response)851 void getOperator(Message response); 852 853 /** 854 * ar.exception carries exception on failure 855 * ar.userObject contains the orignal value of result.obj 856 * ar.result is null on success and failure 857 */ sendDtmf(char c, Message result)858 void sendDtmf(char c, 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 */ startDtmf(char c, Message result)866 void startDtmf(char c, Message result); 867 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 */ stopDtmf(Message result)873 void stopDtmf(Message result); 874 875 /** 876 * ar.exception carries exception on failure 877 * ar.userObject contains the orignal value of result.obj 878 * ar.result is null on success and failure 879 */ sendBurstDtmf(String dtmfString, int on, int off, Message result)880 void sendBurstDtmf(String dtmfString, int on, int off, Message result); 881 882 /** 883 * smscPDU is smsc address in PDU form GSM BCD format prefixed 884 * by a length byte (as expected by TS 27.005) or NULL for default SMSC 885 * pdu is SMS in PDU format as an ASCII hex string 886 * less the SMSC address 887 */ sendSMS(String smscPDU, String pdu, Message response)888 void sendSMS (String smscPDU, String pdu, Message response); 889 890 /** 891 * @param pdu is CDMA-SMS in internal pseudo-PDU format 892 * @param response sent when operation completes 893 */ sendCdmaSms(byte[] pdu, Message response)894 void sendCdmaSms(byte[] pdu, Message response); 895 896 /** 897 * Deletes the specified SMS record from SIM memory (EF_SMS). 898 * 899 * @param index index of the SMS record to delete 900 * @param response sent when operation completes 901 */ deleteSmsOnSim(int index, Message response)902 void deleteSmsOnSim(int index, Message response); 903 904 /** 905 * Deletes the specified SMS record from RUIM memory (EF_SMS in DF_CDMA). 906 * 907 * @param index index of the SMS record to delete 908 * @param response sent when operation completes 909 */ deleteSmsOnRuim(int index, Message response)910 void deleteSmsOnRuim(int index, Message response); 911 912 /** 913 * Writes an SMS message to SIM memory (EF_SMS). 914 * 915 * @param status status of message on SIM. One of: 916 * SmsManger.STATUS_ON_ICC_READ 917 * SmsManger.STATUS_ON_ICC_UNREAD 918 * SmsManger.STATUS_ON_ICC_SENT 919 * SmsManger.STATUS_ON_ICC_UNSENT 920 * @param pdu message PDU, as hex string 921 * @param response sent when operation completes. 922 * response.obj will be an AsyncResult, and will indicate 923 * any error that may have occurred (eg, out of memory). 924 */ writeSmsToSim(int status, String smsc, String pdu, Message response)925 void writeSmsToSim(int status, String smsc, String pdu, Message response); 926 writeSmsToRuim(int status, String pdu, Message response)927 void writeSmsToRuim(int status, String pdu, Message response); 928 929 /** 930 * @deprecated 931 * @param apn 932 * @param user 933 * @param password 934 * @param response 935 */ setupDefaultPDP(String apn, String user, String password, Message response)936 void setupDefaultPDP(String apn, String user, String password, Message response); 937 938 /** 939 * @deprecated 940 * @param cid 941 * @param response 942 */ deactivateDefaultPDP(int cid, Message response)943 void deactivateDefaultPDP(int cid, Message response); 944 setRadioPower(boolean on, Message response)945 void setRadioPower(boolean on, Message response); 946 acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response)947 void acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response); 948 acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response)949 void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response); 950 951 /** 952 * parameters equivilient to 27.007 AT+CRSM command 953 * response.obj will be an AsyncResult 954 * response.obj.userObj will be a IccIoResult on success 955 */ iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, Message response)956 void iccIO (int command, int fileid, String path, int p1, int p2, int p3, 957 String data, String pin2, Message response); 958 959 /** 960 * (AsyncResult)response.obj).result is an int[] with element [0] set to 961 * 1 for "CLIP is provisioned", and 0 for "CLIP is not provisioned". 962 * 963 * @param response is callback message 964 */ 965 queryCLIP(Message response)966 void queryCLIP(Message response); 967 968 /** 969 * response.obj will be a an int[2] 970 * 971 * response.obj[0] will be TS 27.007 +CLIR parameter 'n' 972 * 0 presentation indicator is used according to the subscription of the CLIR service 973 * 1 CLIR invocation 974 * 2 CLIR suppression 975 * 976 * response.obj[1] will be TS 27.007 +CLIR parameter 'm' 977 * 0 CLIR not provisioned 978 * 1 CLIR provisioned in permanent mode 979 * 2 unknown (e.g. no network, etc.) 980 * 3 CLIR temporary mode presentation restricted 981 * 4 CLIR temporary mode presentation allowed 982 */ 983 getCLIR(Message response)984 void getCLIR(Message response); 985 986 /** 987 * clirMode is one of the CLIR_* constants above 988 * 989 * response.obj is null 990 */ 991 setCLIR(int clirMode, Message response)992 void setCLIR(int clirMode, Message response); 993 994 /** 995 * (AsyncResult)response.obj).result is an int[] with element [0] set to 996 * 0 for disabled, 1 for enabled. 997 * 998 * @param serviceClass is a sum of SERVICE_CLASS_* 999 * @param response is callback message 1000 */ 1001 queryCallWaiting(int serviceClass, Message response)1002 void queryCallWaiting(int serviceClass, Message response); 1003 1004 /** 1005 * @param enable is true to enable, false to disable 1006 * @param serviceClass is a sum of SERVICE_CLASS_* 1007 * @param response is callback message 1008 */ 1009 setCallWaiting(boolean enable, int serviceClass, Message response)1010 void setCallWaiting(boolean enable, int serviceClass, Message response); 1011 1012 /** 1013 * @param action is one of CF_ACTION_* 1014 * @param cfReason is one of CF_REASON_* 1015 * @param serviceClass is a sum of SERVICE_CLASSS_* 1016 */ setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds, Message response)1017 void setCallForward(int action, int cfReason, int serviceClass, 1018 String number, int timeSeconds, Message response); 1019 1020 /** 1021 * cfReason is one of CF_REASON_* 1022 * 1023 * ((AsyncResult)response.obj).result will be an array of 1024 * CallForwardInfo's 1025 * 1026 * An array of length 0 means "disabled for all codes" 1027 */ queryCallForwardStatus(int cfReason, int serviceClass, String number, Message response)1028 void queryCallForwardStatus(int cfReason, int serviceClass, 1029 String number, Message response); 1030 setNetworkSelectionModeAutomatic(Message response)1031 void setNetworkSelectionModeAutomatic(Message response); 1032 setNetworkSelectionModeManual(String operatorNumeric, Message response)1033 void setNetworkSelectionModeManual(String operatorNumeric, Message response); 1034 1035 /** 1036 * Queries whether the current network selection mode is automatic 1037 * or manual 1038 * 1039 * ((AsyncResult)response.obj).result is an int[] with element [0] being 1040 * a 0 for automatic selection and a 1 for manual selection 1041 */ 1042 getNetworkSelectionMode(Message response)1043 void getNetworkSelectionMode(Message response); 1044 1045 /** 1046 * Queries the currently available networks 1047 * 1048 * ((AsyncResult)response.obj).result is a List of NetworkInfo objects 1049 */ getAvailableNetworks(Message response)1050 void getAvailableNetworks(Message response); 1051 getBasebandVersion(Message response)1052 void getBasebandVersion (Message response); 1053 1054 1055 /** 1056 * (AsyncResult)response.obj).result will be an Integer representing 1057 * the sum of enabled serivice classes (sum of SERVICE_CLASS_*) 1058 * 1059 * @param facility one of CB_FACILTY_* 1060 * @param password password or "" if not required 1061 * @param serviceClass is a sum of SERVICE_CLASS_* 1062 * @param response is callback message 1063 */ 1064 queryFacilityLock(String facility, String password, int serviceClass, Message response)1065 void queryFacilityLock (String facility, String password, int serviceClass, 1066 Message response); 1067 1068 /** 1069 * @param facility one of CB_FACILTY_* 1070 * @param lockState true means lock, false means unlock 1071 * @param password password or "" if not required 1072 * @param serviceClass is a sum of SERVICE_CLASS_* 1073 * @param response is callback message 1074 */ setFacilityLock(String facility, boolean lockState, String password, int serviceClass, Message response)1075 void setFacilityLock (String facility, boolean lockState, String password, 1076 int serviceClass, Message response); 1077 1078 sendUSSD(String ussdString, Message response)1079 void sendUSSD (String ussdString, Message response); 1080 1081 /** 1082 * Cancels a pending USSD session if one exists. 1083 * @param response callback message 1084 */ cancelPendingUssd(Message response)1085 void cancelPendingUssd (Message response); 1086 resetRadio(Message result)1087 void resetRadio(Message result); 1088 1089 /** 1090 * Assign a specified band for RF configuration. 1091 * 1092 * @param bandMode one of BM_*_BAND 1093 * @param response is callback message 1094 */ setBandMode(int bandMode, Message response)1095 void setBandMode (int bandMode, Message response); 1096 1097 /** 1098 * Query the list of band mode supported by RF. 1099 * 1100 * @param response is callback message 1101 * ((AsyncResult)response.obj).result is an int[] with every 1102 * element representing one avialable BM_*_BAND 1103 */ queryAvailableBandMode(Message response)1104 void queryAvailableBandMode (Message response); 1105 1106 /** 1107 * Requests to set the preferred network type for searching and registering 1108 * (CS/PS domain, RAT, and operation mode) 1109 * @param networkType one of NT_*_TYPE 1110 * @param response is callback message 1111 */ setPreferredNetworkType(int networkType , Message response)1112 void setPreferredNetworkType(int networkType , Message response); 1113 1114 /** 1115 * Query the preferred network type setting 1116 * 1117 * @param response is callback message to report one of NT_*_TYPE 1118 */ getPreferredNetworkType(Message response)1119 void getPreferredNetworkType(Message response); 1120 1121 /** 1122 * Query neighboring cell ids 1123 * 1124 * @param response s callback message to cell ids 1125 */ getNeighboringCids(Message response)1126 void getNeighboringCids(Message response); 1127 1128 /** 1129 * Request to enable/disable network state change notifications when 1130 * location informateion (lac and/or cid) has changed. 1131 * 1132 * @param enable true to enable, false to disable 1133 * @param response callback message 1134 */ setLocationUpdates(boolean enable, Message response)1135 void setLocationUpdates(boolean enable, Message response); 1136 1137 /** 1138 * Gets the default SMSC address. 1139 * 1140 * @param result Callback message contains the SMSC address. 1141 */ getSmscAddress(Message result)1142 void getSmscAddress(Message result); 1143 1144 /** 1145 * Sets the default SMSC address. 1146 * 1147 * @param address new SMSC address 1148 * @param result Callback message is empty on completion 1149 */ setSmscAddress(String address, Message result)1150 void setSmscAddress(String address, Message result); 1151 1152 /** 1153 * Indicates whether there is storage available for new SMS messages. 1154 * @param available true if storage is available 1155 * @param result callback message 1156 */ reportSmsMemoryStatus(boolean available, Message result)1157 void reportSmsMemoryStatus(boolean available, Message result); 1158 1159 /** 1160 * Indicates to the vendor ril that StkService is running 1161 * rand is eady to receive RIL_UNSOL_STK_XXXX commands. 1162 * 1163 * @param result callback message 1164 */ reportStkServiceIsRunning(Message result)1165 void reportStkServiceIsRunning(Message result); 1166 invokeOemRilRequestRaw(byte[] data, Message response)1167 void invokeOemRilRequestRaw(byte[] data, Message response); 1168 invokeOemRilRequestStrings(String[] strings, Message response)1169 void invokeOemRilRequestStrings(String[] strings, Message response); 1170 1171 1172 /** 1173 * Send TERMINAL RESPONSE to the SIM, after processing a proactive command 1174 * sent by the SIM. 1175 * 1176 * @param contents String containing SAT/USAT response in hexadecimal 1177 * format starting with first byte of response data. See 1178 * TS 102 223 for details. 1179 * @param response Callback message 1180 */ sendTerminalResponse(String contents, Message response)1181 public void sendTerminalResponse(String contents, Message response); 1182 1183 /** 1184 * Send ENVELOPE to the SIM, after processing a proactive command sent by 1185 * the SIM. 1186 * 1187 * @param contents String containing SAT/USAT response in hexadecimal 1188 * format starting with command tag. See TS 102 223 for 1189 * details. 1190 * @param response Callback message 1191 */ sendEnvelope(String contents, Message response)1192 public void sendEnvelope(String contents, Message response); 1193 1194 /** 1195 * Accept or reject the call setup request from SIM. 1196 * 1197 * @param accept true if the call is to be accepted, false otherwise. 1198 * @param response Callback message 1199 */ handleCallSetupRequestFromSim(boolean accept, Message response)1200 public void handleCallSetupRequestFromSim(boolean accept, Message response); 1201 1202 /** 1203 * Activate or deactivate cell broadcast SMS for GSM. 1204 * 1205 * @param activate 1206 * true = activate, false = deactivate 1207 * @param result Callback message is empty on completion 1208 */ setGsmBroadcastActivation(boolean activate, Message result)1209 public void setGsmBroadcastActivation(boolean activate, Message result); 1210 1211 /** 1212 * Configure cell broadcast SMS for GSM. 1213 * 1214 * @param response Callback message is empty on completion 1215 */ setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response)1216 public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response); 1217 1218 /** 1219 * Query the current configuration of cell broadcast SMS of GSM. 1220 * 1221 * @param response 1222 * Callback message contains the configuration from the modem 1223 * on completion 1224 */ getGsmBroadcastConfig(Message response)1225 public void getGsmBroadcastConfig(Message response); 1226 1227 //***** new Methods for CDMA support 1228 1229 /** 1230 * Request the device ESN / MEID / IMEI / IMEISV. 1231 * "response" is const char ** 1232 * [0] is IMEI if GSM subscription is available 1233 * [1] is IMEISV if GSM subscription is available 1234 * [2] is ESN if CDMA subscription is available 1235 * [3] is MEID if CDMA subscription is available 1236 */ getDeviceIdentity(Message response)1237 public void getDeviceIdentity(Message response); 1238 1239 /** 1240 * Request the device MDN / H_SID / H_NID / MIN. 1241 * "response" is const char ** 1242 * [0] is MDN if CDMA subscription is available 1243 * [1] is a comma separated list of H_SID (Home SID) in decimal format 1244 * if CDMA subscription is available 1245 * [2] is a comma separated list of H_NID (Home NID) in decimal format 1246 * if CDMA subscription is available 1247 * [3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available 1248 */ getCDMASubscription(Message response)1249 public void getCDMASubscription(Message response); 1250 1251 /** 1252 * Send Flash Code. 1253 * "response" is is NULL 1254 * [0] is a FLASH string 1255 */ sendCDMAFeatureCode(String FeatureCode, Message response)1256 public void sendCDMAFeatureCode(String FeatureCode, Message response); 1257 1258 /** Set the Phone type created */ setPhoneType(int phoneType)1259 void setPhoneType(int phoneType); 1260 1261 /** 1262 * Query the CDMA roaming preference setting 1263 * 1264 * @param response is callback message to report one of CDMA_RM_* 1265 */ queryCdmaRoamingPreference(Message response)1266 void queryCdmaRoamingPreference(Message response); 1267 1268 /** 1269 * Requests to set the CDMA roaming preference 1270 * @param cdmaRoamingType one of CDMA_RM_* 1271 * @param response is callback message 1272 */ setCdmaRoamingPreference(int cdmaRoamingType, Message response)1273 void setCdmaRoamingPreference(int cdmaRoamingType, Message response); 1274 1275 /** 1276 * Requests to set the CDMA subscription mode 1277 * @param cdmaSubscriptionType one of CDMA_SUBSCRIPTION_* 1278 * @param response is callback message 1279 */ setCdmaSubscription(int cdmaSubscriptionType, Message response)1280 void setCdmaSubscription(int cdmaSubscriptionType, Message response); 1281 1282 /** 1283 * Set the TTY mode for the CDMA phone 1284 * 1285 * @param enable is true to enable, false to disable 1286 * @param response is callback message 1287 */ setTTYMode(int ttyMode, Message response)1288 void setTTYMode(int ttyMode, Message response); 1289 1290 /** 1291 * Query the TTY mode for the CDMA phone 1292 * (AsyncResult)response.obj).result is an int[] with element [0] set to 1293 * 0 for disabled, 1 for enabled. 1294 * 1295 * @param response is callback message 1296 */ queryTTYMode(Message response)1297 void queryTTYMode(Message response); 1298 1299 /** 1300 * Setup a packet data connection On successful completion, the result 1301 * message will return the following: [0] indicating PDP CID, which is 1302 * generated by RIL. This Connection ID is used in both GSM/UMTS and CDMA 1303 * modes [1] indicating the network interface name for GSM/UMTS or CDMA [2] 1304 * indicating the IP address for this interface for GSM/UMTS and NULL in the 1305 * case of CDMA 1306 * 1307 * @param radioTechnology 1308 * indicates whether to setup connection on radio technology CDMA 1309 * (0) or GSM/UMTS (1) 1310 * @param profile 1311 * Profile Number or NULL to indicate default profile 1312 * @param apn 1313 * the APN to connect to if radio technology is GSM/UMTS. 1314 * Otherwise null for CDMA. 1315 * @param user 1316 * the username for APN, or NULL 1317 * @param password 1318 * the password for APN, or NULL 1319 * @param authType 1320 * the PAP / CHAP auth type. Values is one of SETUP_DATA_AUTH_* 1321 * @param result 1322 * Callback message 1323 */ setupDataCall(String radioTechnology, String profile, String apn, String user, String password, String authType, Message result)1324 public void setupDataCall(String radioTechnology, String profile, String apn, 1325 String user, String password, String authType, Message result); 1326 1327 /** 1328 * Deactivate packet data connection 1329 * 1330 * @param cid 1331 * The connection ID 1332 * @param result 1333 * Callback message is empty on completion 1334 */ deactivateDataCall(int cid, Message result)1335 public void deactivateDataCall(int cid, Message result); 1336 1337 /** 1338 * Activate or deactivate cell broadcast SMS for CDMA. 1339 * 1340 * @param activate 1341 * true = activate, false = deactivate 1342 * @param result 1343 * Callback message is empty on completion 1344 */ setCdmaBroadcastActivation(boolean activate, Message result)1345 public void setCdmaBroadcastActivation(boolean activate, Message result); 1346 1347 /** 1348 * Configure cdma cell broadcast SMS. 1349 * 1350 * @param result 1351 * Callback message is empty on completion 1352 */ 1353 // TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig setCdmaBroadcastConfig(int[] configValuesArray, Message result)1354 public void setCdmaBroadcastConfig(int[] configValuesArray, Message result); 1355 1356 /** 1357 * Query the current configuration of cdma cell broadcast SMS. 1358 * 1359 * @param result 1360 * Callback message contains the configuration from the modem on completion 1361 */ getCdmaBroadcastConfig(Message result)1362 public void getCdmaBroadcastConfig(Message result); 1363 1364 /** 1365 * Requests the radio's system selection module to exit emergency callback mode. 1366 * This function should only be called from CDMAPHone.java. 1367 * 1368 * @param response callback message 1369 */ exitEmergencyCallbackMode(Message response)1370 public void exitEmergencyCallbackMode(Message response); 1371 1372 /** 1373 * Request the status of the ICC and UICC cards. 1374 * 1375 * @param response 1376 * Callback message containing {@link IccCardStatus} structure for the card. 1377 */ getIccCardStatus(Message result)1378 public void getIccCardStatus(Message result); 1379 } 1380