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