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 android.annotation.NonNull; 20 import android.compat.annotation.UnsupportedAppUsage; 21 import android.net.KeepalivePacketData; 22 import android.net.LinkProperties; 23 import android.os.Build; 24 import android.os.Handler; 25 import android.os.Message; 26 import android.os.WorkSource; 27 import android.telephony.AccessNetworkConstants.AccessNetworkType; 28 import android.telephony.CarrierRestrictionRules; 29 import android.telephony.ClientRequestStats; 30 import android.telephony.ImsiEncryptionInfo; 31 import android.telephony.NetworkScanRequest; 32 import android.telephony.RadioAccessSpecifier; 33 import android.telephony.SignalThresholdInfo; 34 import android.telephony.TelephonyManager; 35 import android.telephony.data.DataCallResponse; 36 import android.telephony.data.DataProfile; 37 import android.telephony.data.NetworkSliceInfo; 38 import android.telephony.data.TrafficDescriptor; 39 import android.telephony.emergency.EmergencyNumber; 40 41 import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo; 42 import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo; 43 import com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubState; 44 import com.android.internal.telephony.uicc.IccCardStatus; 45 import com.android.internal.telephony.uicc.SimPhonebookRecord; 46 47 import java.util.List; 48 49 /** 50 * {@hide} 51 */ 52 public interface CommandsInterface { 53 54 //***** Constants 55 56 // Used as parameter to dial() and setCLIR() below 57 static final int CLIR_DEFAULT = 0; // "use subscription default value" 58 static final int CLIR_INVOCATION = 1; // (restrict CLI presentation) 59 static final int CLIR_SUPPRESSION = 2; // (allow CLI presentation) 60 61 // Used as return value for CDMA SS query 62 static final int SS_STATUS_UNKNOWN = 0xff; 63 64 // Used as parameters for call forward methods below 65 static final int CF_ACTION_DISABLE = 0; 66 static final int CF_ACTION_ENABLE = 1; 67 // static final int CF_ACTION_UNUSED = 2; 68 static final int CF_ACTION_REGISTRATION = 3; 69 static final int CF_ACTION_ERASURE = 4; 70 71 static final int CF_REASON_UNCONDITIONAL = 0; 72 static final int CF_REASON_BUSY = 1; 73 static final int CF_REASON_NO_REPLY = 2; 74 static final int CF_REASON_NOT_REACHABLE = 3; 75 static final int CF_REASON_ALL = 4; 76 static final int CF_REASON_ALL_CONDITIONAL = 5; 77 78 // Used for call barring methods below 79 static final String CB_FACILITY_BAOC = "AO"; 80 static final String CB_FACILITY_BAOIC = "OI"; 81 static final String CB_FACILITY_BAOICxH = "OX"; 82 static final String CB_FACILITY_BAIC = "AI"; 83 static final String CB_FACILITY_BAICr = "IR"; 84 static final String CB_FACILITY_BA_ALL = "AB"; 85 static final String CB_FACILITY_BA_MO = "AG"; 86 static final String CB_FACILITY_BA_MT = "AC"; 87 static final String CB_FACILITY_BA_SIM = "SC"; 88 static final String CB_FACILITY_BA_FD = "FD"; 89 static final String CB_FACILITY_BIC_ACR = "AR"; 90 91 92 // Used for various supp services apis 93 // See 27.007 +CCFC or +CLCK 94 static final int SERVICE_CLASS_NONE = 0; // no user input 95 static final int SERVICE_CLASS_VOICE = (1 << 0); 96 static final int SERVICE_CLASS_DATA = (1 << 1); //synonym for 16+32+64+128 97 static final int SERVICE_CLASS_FAX = (1 << 2); 98 static final int SERVICE_CLASS_SMS = (1 << 3); 99 static final int SERVICE_CLASS_DATA_SYNC = (1 << 4); 100 static final int SERVICE_CLASS_DATA_ASYNC = (1 << 5); 101 static final int SERVICE_CLASS_PACKET = (1 << 6); 102 static final int SERVICE_CLASS_PAD = (1 << 7); 103 static final int SERVICE_CLASS_MAX = (1 << 7); // Max SERVICE_CLASS value 104 105 // Numeric representation of string values returned 106 // by messages sent to setOnUSSD handler 107 static final int USSD_MODE_NOTIFY = 0; 108 static final int USSD_MODE_REQUEST = 1; 109 static final int USSD_MODE_NW_RELEASE = 2; 110 static final int USSD_MODE_LOCAL_CLIENT = 3; 111 static final int USSD_MODE_NOT_SUPPORTED = 4; 112 static final int USSD_MODE_NW_TIMEOUT = 5; 113 114 // GSM SMS fail cause for acknowledgeLastIncomingSMS. From TS 23.040, 9.2.3.22. 115 static final int GSM_SMS_FAIL_CAUSE_MEMORY_CAPACITY_EXCEEDED = 0xD3; 116 static final int GSM_SMS_FAIL_CAUSE_USIM_APP_TOOLKIT_BUSY = 0xD4; 117 static final int GSM_SMS_FAIL_CAUSE_USIM_DATA_DOWNLOAD_ERROR = 0xD5; 118 static final int GSM_SMS_FAIL_CAUSE_UNSPECIFIED_ERROR = 0xFF; 119 120 // CDMA SMS fail cause for acknowledgeLastIncomingCdmaSms. From TS N.S0005, 6.5.2.125. 121 static final int CDMA_SMS_FAIL_CAUSE_INVALID_TELESERVICE_ID = 4; 122 static final int CDMA_SMS_FAIL_CAUSE_RESOURCE_SHORTAGE = 35; 123 static final int CDMA_SMS_FAIL_CAUSE_OTHER_TERMINAL_PROBLEM = 39; 124 static final int CDMA_SMS_FAIL_CAUSE_ENCODING_PROBLEM = 96; 125 126 //***** Methods 127 128 /** 129 * get latest radio power state from modem 130 * @return 131 */ getRadioState()132 int getRadioState(); 133 134 /** 135 * response.obj.result is an int[2] 136 * 137 * response.obj.result[0] is IMS registration state 138 * 0 - Not registered 139 * 1 - Registered 140 * response.obj.result[1] is of type RILConstants.GSM_PHONE or 141 * RILConstants.CDMA_PHONE 142 */ getImsRegistrationState(Message result)143 void getImsRegistrationState(Message result); 144 145 /** 146 * Fires on any RadioState transition 147 * Always fires immediately as well 148 * 149 * do not attempt to calculate transitions by storing getRadioState() values 150 * on previous invocations of this notification. Instead, use the other 151 * registration methods 152 */ 153 @UnsupportedAppUsage registerForRadioStateChanged(Handler h, int what, Object obj)154 void registerForRadioStateChanged(Handler h, int what, Object obj); unregisterForRadioStateChanged(Handler h)155 void unregisterForRadioStateChanged(Handler h); 156 registerForVoiceRadioTechChanged(Handler h, int what, Object obj)157 void registerForVoiceRadioTechChanged(Handler h, int what, Object obj); 158 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) unregisterForVoiceRadioTechChanged(Handler h)159 void unregisterForVoiceRadioTechChanged(Handler h); 160 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) registerForImsNetworkStateChanged(Handler h, int what, Object obj)161 void registerForImsNetworkStateChanged(Handler h, int what, Object obj); unregisterForImsNetworkStateChanged(Handler h)162 void unregisterForImsNetworkStateChanged(Handler h); 163 164 /** 165 * Fires on any transition into RadioState.isOn() 166 * Fires immediately if currently in that state 167 * In general, actions should be idempotent. State may change 168 * before event is received. 169 */ 170 @UnsupportedAppUsage registerForOn(Handler h, int what, Object obj)171 void registerForOn(Handler h, int what, Object obj); 172 @UnsupportedAppUsage unregisterForOn(Handler h)173 void unregisterForOn(Handler h); 174 175 /** 176 * Fires on any transition out of RadioState.isAvailable() 177 * Fires immediately if currently in that state 178 * In general, actions should be idempotent. State may change 179 * before event is received. 180 */ 181 @UnsupportedAppUsage registerForAvailable(Handler h, int what, Object obj)182 void registerForAvailable(Handler h, int what, Object obj); 183 @UnsupportedAppUsage 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 */ 192 @UnsupportedAppUsage registerForNotAvailable(Handler h, int what, Object obj)193 void registerForNotAvailable(Handler h, int what, Object obj); unregisterForNotAvailable(Handler h)194 void unregisterForNotAvailable(Handler h); 195 196 /** 197 * Fires on any transition into RADIO_OFF or !RadioState.isAvailable() 198 * Fires immediately if currently in that state 199 * In general, actions should be idempotent. State may change 200 * before event is received. 201 */ 202 @UnsupportedAppUsage registerForOffOrNotAvailable(Handler h, int what, Object obj)203 void registerForOffOrNotAvailable(Handler h, int what, Object obj); 204 @UnsupportedAppUsage unregisterForOffOrNotAvailable(Handler h)205 void unregisterForOffOrNotAvailable(Handler h); 206 207 /** 208 * Fires on any change in ICC status 209 */ registerForIccStatusChanged(Handler h, int what, Object obj)210 void registerForIccStatusChanged(Handler h, int what, Object obj); unregisterForIccStatusChanged(Handler h)211 void unregisterForIccStatusChanged(Handler h); 212 /** Register for ICC slot status changed event */ registerForIccSlotStatusChanged(Handler h, int what, Object obj)213 void registerForIccSlotStatusChanged(Handler h, int what, Object obj); 214 /** Unregister for ICC slot status changed event */ unregisterForIccSlotStatusChanged(Handler h)215 void unregisterForIccSlotStatusChanged(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); 219 /** Register for network state changed event */ registerForNetworkStateChanged(Handler h, int what, Object obj)220 void registerForNetworkStateChanged(Handler h, int what, Object obj); 221 /** Unregister from network state changed event */ unregisterForNetworkStateChanged(Handler h)222 void unregisterForNetworkStateChanged(Handler h); 223 /** Register for data call list changed event */ registerForDataCallListChanged(Handler h, int what, Object obj)224 void registerForDataCallListChanged(Handler h, int what, Object obj); 225 /** Unregister from data call list changed event */ unregisterForDataCallListChanged(Handler h)226 void unregisterForDataCallListChanged(Handler h); 227 /** Register for the apn unthrottled event */ registerForApnUnthrottled(Handler h, int what, Object obj)228 void registerForApnUnthrottled(Handler h, int what, Object obj); 229 /** Unregister for apn unthrottled event */ unregisterForApnUnthrottled(Handler h)230 void unregisterForApnUnthrottled(Handler h); 231 232 /** InCall voice privacy notifications */ registerForInCallVoicePrivacyOn(Handler h, int what, Object obj)233 void registerForInCallVoicePrivacyOn(Handler h, int what, Object obj); unregisterForInCallVoicePrivacyOn(Handler h)234 void unregisterForInCallVoicePrivacyOn(Handler h); registerForInCallVoicePrivacyOff(Handler h, int what, Object obj)235 void registerForInCallVoicePrivacyOff(Handler h, int what, Object obj); unregisterForInCallVoicePrivacyOff(Handler h)236 void unregisterForInCallVoicePrivacyOff(Handler h); 237 238 /** Single Radio Voice Call State progress notifications */ registerForSrvccStateChanged(Handler h, int what, Object obj)239 void registerForSrvccStateChanged(Handler h, int what, Object obj); unregisterForSrvccStateChanged(Handler h)240 void unregisterForSrvccStateChanged(Handler h); 241 242 /** 243 * Handlers for subscription status change indications. 244 * 245 * @param h Handler for subscription status change messages. 246 * @param what User-defined message code. 247 * @param obj User object. 248 */ registerForSubscriptionStatusChanged(Handler h, int what, Object obj)249 void registerForSubscriptionStatusChanged(Handler h, int what, Object obj); unregisterForSubscriptionStatusChanged(Handler h)250 void unregisterForSubscriptionStatusChanged(Handler h); 251 252 /** 253 * fires on any change in hardware configuration. 254 */ registerForHardwareConfigChanged(Handler h, int what, Object obj)255 void registerForHardwareConfigChanged(Handler h, int what, Object obj); unregisterForHardwareConfigChanged(Handler h)256 void unregisterForHardwareConfigChanged(Handler h); 257 258 /** 259 * unlike the register* methods, there's only one new 3GPP format SMS handler. 260 * if you need to unregister, you should also tell the radio to stop 261 * sending SMS's to you (via AT+CNMI) 262 * 263 * AsyncResult.result is a String containing the SMS PDU 264 */ setOnNewGsmSms(Handler h, int what, Object obj)265 void setOnNewGsmSms(Handler h, int what, Object obj); unSetOnNewGsmSms(Handler h)266 void unSetOnNewGsmSms(Handler h); 267 268 /** 269 * unlike the register* methods, there's only one new 3GPP2 format SMS handler. 270 * if you need to unregister, you should also tell the radio to stop 271 * sending SMS's to you (via AT+CNMI) 272 * 273 * AsyncResult.result is a String containing the SMS PDU 274 */ setOnNewCdmaSms(Handler h, int what, Object obj)275 void setOnNewCdmaSms(Handler h, int what, Object obj); unSetOnNewCdmaSms(Handler h)276 void unSetOnNewCdmaSms(Handler h); 277 278 /** 279 * Set the handler for SMS Cell Broadcast messages. 280 * 281 * AsyncResult.result is a byte array containing the SMS-CB PDU 282 */ 283 @UnsupportedAppUsage setOnNewGsmBroadcastSms(Handler h, int what, Object obj)284 void setOnNewGsmBroadcastSms(Handler h, int what, Object obj); unSetOnNewGsmBroadcastSms(Handler h)285 void unSetOnNewGsmBroadcastSms(Handler h); 286 287 /** 288 * Register for NEW_SMS_ON_SIM unsolicited message 289 * 290 * AsyncResult.result is an int array containing the index of new SMS 291 */ 292 @UnsupportedAppUsage setOnSmsOnSim(Handler h, int what, Object obj)293 void setOnSmsOnSim(Handler h, int what, Object obj); unSetOnSmsOnSim(Handler h)294 void unSetOnSmsOnSim(Handler h); 295 296 /** 297 * Register for NEW_SMS_STATUS_REPORT unsolicited message 298 * 299 * AsyncResult.result is a String containing the status report PDU 300 */ 301 @UnsupportedAppUsage setOnSmsStatus(Handler h, int what, Object obj)302 void setOnSmsStatus(Handler h, int what, Object obj); unSetOnSmsStatus(Handler h)303 void unSetOnSmsStatus(Handler h); 304 305 /** 306 * unlike the register* methods, there's only one NITZ time handler 307 * 308 * AsyncResult.result is an Object[] 309 * ((Object[])AsyncResult.result)[0] is a String containing the NITZ time string 310 * ((Object[])AsyncResult.result)[1] is a Long containing the milliseconds since boot as 311 * returned by elapsedRealtime() when this NITZ time 312 * was posted. 313 * 314 * Please note that the delivery of this message may be delayed several 315 * seconds on system startup 316 */ 317 @UnsupportedAppUsage setOnNITZTime(Handler h, int what, Object obj)318 void setOnNITZTime(Handler h, int what, Object obj); unSetOnNITZTime(Handler h)319 void unSetOnNITZTime(Handler h); 320 321 /** 322 * unlike the register* methods, there's only one USSD notify handler 323 * 324 * Represents the arrival of a USSD "notify" message, which may 325 * or may not have been triggered by a previous USSD send 326 * 327 * AsyncResult.result is a String[] 328 * ((String[])(AsyncResult.result))[0] contains status code 329 * "0" USSD-Notify -- text in ((const char **)data)[1] 330 * "1" USSD-Request -- text in ((const char **)data)[1] 331 * "2" Session terminated by network 332 * "3" other local client (eg, SIM Toolkit) has responded 333 * "4" Operation not supported 334 * "5" Network timeout 335 * 336 * ((String[])(AsyncResult.result))[1] contains the USSD message 337 * The numeric representations of these are in USSD_MODE_* 338 */ 339 setOnUSSD(Handler h, int what, Object obj)340 void setOnUSSD(Handler h, int what, Object obj); unSetOnUSSD(Handler h)341 void unSetOnUSSD(Handler h); 342 343 /** 344 * unlike the register* methods, there's only one signal strength handler 345 * AsyncResult.result is an int[2] 346 * response.obj.result[0] is received signal strength (0-31, 99) 347 * response.obj.result[1] is bit error rate (0-7, 99) 348 * as defined in TS 27.007 8.5 349 */ 350 351 @UnsupportedAppUsage setOnSignalStrengthUpdate(Handler h, int what, Object obj)352 void setOnSignalStrengthUpdate(Handler h, int what, Object obj); unSetOnSignalStrengthUpdate(Handler h)353 void unSetOnSignalStrengthUpdate(Handler h); 354 355 /** 356 * Sets the handler for SIM/RUIM SMS storage full unsolicited message. 357 * Unlike the register* methods, there's only one notification handler 358 * 359 * @param h Handler for notification message. 360 * @param what User-defined message code. 361 * @param obj User object. 362 */ 363 @UnsupportedAppUsage setOnIccSmsFull(Handler h, int what, Object obj)364 void setOnIccSmsFull(Handler h, int what, Object obj); unSetOnIccSmsFull(Handler h)365 void unSetOnIccSmsFull(Handler h); 366 367 /** 368 * Sets the handler for SIM Refresh notifications. 369 * 370 * @param h Handler for notification message. 371 * @param what User-defined message code. 372 * @param obj User object. 373 */ 374 @UnsupportedAppUsage registerForIccRefresh(Handler h, int what, Object obj)375 void registerForIccRefresh(Handler h, int what, Object obj); unregisterForIccRefresh(Handler h)376 void unregisterForIccRefresh(Handler h); 377 378 @UnsupportedAppUsage setOnIccRefresh(Handler h, int what, Object obj)379 void setOnIccRefresh(Handler h, int what, Object obj); unsetOnIccRefresh(Handler h)380 void unsetOnIccRefresh(Handler h); 381 382 /** 383 * Sets the handler for RING notifications. 384 * Unlike the register* methods, there's only one notification handler 385 * 386 * @param h Handler for notification message. 387 * @param what User-defined message code. 388 * @param obj User object. 389 */ 390 @UnsupportedAppUsage setOnCallRing(Handler h, int what, Object obj)391 void setOnCallRing(Handler h, int what, Object obj); unSetOnCallRing(Handler h)392 void unSetOnCallRing(Handler h); 393 394 /** 395 * Sets the handler for RESTRICTED_STATE changed notification, 396 * eg, for Domain Specific Access Control 397 * unlike the register* methods, there's only one signal strength handler 398 * 399 * AsyncResult.result is an int[1] 400 * response.obj.result[0] is a bitmask of RIL_RESTRICTED_STATE_* values 401 */ 402 setOnRestrictedStateChanged(Handler h, int what, Object obj)403 void setOnRestrictedStateChanged(Handler h, int what, Object obj); unSetOnRestrictedStateChanged(Handler h)404 void unSetOnRestrictedStateChanged(Handler h); 405 406 /** 407 * Sets the handler for Supplementary Service Notifications. 408 * Unlike the register* methods, there's only one notification handler 409 * 410 * @param h Handler for notification message. 411 * @param what User-defined message code. 412 * @param obj User object. 413 */ 414 @UnsupportedAppUsage setOnSuppServiceNotification(Handler h, int what, Object obj)415 void setOnSuppServiceNotification(Handler h, int what, Object obj); unSetOnSuppServiceNotification(Handler h)416 void unSetOnSuppServiceNotification(Handler h); 417 418 /** 419 * Sets the handler for Session End Notifications for CAT. 420 * Unlike the register* methods, there's only one notification handler 421 * 422 * @param h Handler for notification message. 423 * @param what User-defined message code. 424 * @param obj User object. 425 */ 426 @UnsupportedAppUsage setOnCatSessionEnd(Handler h, int what, Object obj)427 void setOnCatSessionEnd(Handler h, int what, Object obj); unSetOnCatSessionEnd(Handler h)428 void unSetOnCatSessionEnd(Handler h); 429 430 /** 431 * Sets the handler for Proactive Commands for CAT. 432 * Unlike the register* methods, there's only one notification handler 433 * 434 * @param h Handler for notification message. 435 * @param what User-defined message code. 436 * @param obj User object. 437 */ 438 @UnsupportedAppUsage setOnCatProactiveCmd(Handler h, int what, Object obj)439 void setOnCatProactiveCmd(Handler h, int what, Object obj); unSetOnCatProactiveCmd(Handler h)440 void unSetOnCatProactiveCmd(Handler h); 441 442 /** 443 * Sets the handler for Event Notifications for CAT. 444 * Unlike the register* methods, there's only one notification handler 445 * 446 * @param h Handler for notification message. 447 * @param what User-defined message code. 448 * @param obj User object. 449 */ 450 @UnsupportedAppUsage setOnCatEvent(Handler h, int what, Object obj)451 void setOnCatEvent(Handler h, int what, Object obj); unSetOnCatEvent(Handler h)452 void unSetOnCatEvent(Handler h); 453 454 /** 455 * Sets the handler for Call Set Up Notifications for CAT. 456 * Unlike the register* methods, there's only one notification handler 457 * 458 * @param h Handler for notification message. 459 * @param what User-defined message code. 460 * @param obj User object. 461 */ 462 @UnsupportedAppUsage setOnCatCallSetUp(Handler h, int what, Object obj)463 void setOnCatCallSetUp(Handler h, int what, Object obj); unSetOnCatCallSetUp(Handler h)464 void unSetOnCatCallSetUp(Handler h); 465 466 /** 467 * Enables/disbables supplementary service related notifications from 468 * the network. 469 * 470 * @param enable true to enable notifications, false to disable. 471 * @param result Message to be posted when command completes. 472 */ setSuppServiceNotifications(boolean enable, Message result)473 void setSuppServiceNotifications(boolean enable, Message result); 474 //void unSetSuppServiceNotifications(Handler h); 475 476 /** 477 * Sets the handler for Alpha Notification during STK Call Control. 478 * Unlike the register* methods, there's only one notification handler 479 * 480 * @param h Handler for notification message. 481 * @param what User-defined message code. 482 * @param obj User object. 483 */ 484 @UnsupportedAppUsage setOnCatCcAlphaNotify(Handler h, int what, Object obj)485 void setOnCatCcAlphaNotify(Handler h, int what, Object obj); unSetOnCatCcAlphaNotify(Handler h)486 void unSetOnCatCcAlphaNotify(Handler h); 487 488 /** 489 * Sets the handler for notifying Suplementary Services (SS) 490 * Data during STK Call Control. 491 * Unlike the register* methods, there's only one notification handler 492 * 493 * @param h Handler for notification message. 494 * @param what User-defined message code. 495 * @param obj User object. 496 */ setOnSs(Handler h, int what, Object obj)497 void setOnSs(Handler h, int what, Object obj); unSetOnSs(Handler h)498 void unSetOnSs(Handler h); 499 500 /** 501 * Register for unsolicited NATT Keepalive Status Indications 502 * 503 * @param h Handler for notification message. 504 * @param what User-defined message code. 505 * @param obj User object. 506 */ setOnRegistrationFailed(Handler h, int what, Object obj)507 default void setOnRegistrationFailed(Handler h, int what, Object obj) {} 508 509 /** 510 * @param h Handler for notification message. 511 */ unSetOnRegistrationFailed(Handler h)512 default void unSetOnRegistrationFailed(Handler h) {} 513 514 /** 515 * Sets the handler for Event Notifications for CDMA Display Info. 516 * Unlike the register* methods, there's only one notification handler 517 * 518 * @param h Handler for notification message. 519 * @param what User-defined message code. 520 * @param obj User object. 521 */ registerForDisplayInfo(Handler h, int what, Object obj)522 void registerForDisplayInfo(Handler h, int what, Object obj); unregisterForDisplayInfo(Handler h)523 void unregisterForDisplayInfo(Handler h); 524 525 /** 526 * Sets the handler for Event Notifications for CallWaiting Info. 527 * Unlike the register* methods, there's only one notification handler 528 * 529 * @param h Handler for notification message. 530 * @param what User-defined message code. 531 * @param obj User object. 532 */ registerForCallWaitingInfo(Handler h, int what, Object obj)533 void registerForCallWaitingInfo(Handler h, int what, Object obj); unregisterForCallWaitingInfo(Handler h)534 void unregisterForCallWaitingInfo(Handler h); 535 536 /** 537 * Sets the handler for Event Notifications for Signal Info. 538 * Unlike the register* methods, there's only one notification handler 539 * 540 * @param h Handler for notification message. 541 * @param what User-defined message code. 542 * @param obj User object. 543 */ registerForSignalInfo(Handler h, int what, Object obj)544 void registerForSignalInfo(Handler h, int what, Object obj); unregisterForSignalInfo(Handler h)545 void unregisterForSignalInfo(Handler h); 546 547 /** 548 * Registers the handler for CDMA number information record 549 * Unlike the register* methods, there's only one notification handler 550 * 551 * @param h Handler for notification message. 552 * @param what User-defined message code. 553 * @param obj User object. 554 */ registerForNumberInfo(Handler h, int what, Object obj)555 void registerForNumberInfo(Handler h, int what, Object obj); unregisterForNumberInfo(Handler h)556 void unregisterForNumberInfo(Handler h); 557 558 /** 559 * Registers the handler for CDMA redirected number Information record 560 * Unlike the register* methods, there's only one notification handler 561 * 562 * @param h Handler for notification message. 563 * @param what User-defined message code. 564 * @param obj User object. 565 */ registerForRedirectedNumberInfo(Handler h, int what, Object obj)566 void registerForRedirectedNumberInfo(Handler h, int what, Object obj); unregisterForRedirectedNumberInfo(Handler h)567 void unregisterForRedirectedNumberInfo(Handler h); 568 569 /** 570 * Registers the handler for CDMA line control information record 571 * Unlike the register* methods, there's only one notification handler 572 * 573 * @param h Handler for notification message. 574 * @param what User-defined message code. 575 * @param obj User object. 576 */ registerForLineControlInfo(Handler h, int what, Object obj)577 void registerForLineControlInfo(Handler h, int what, Object obj); unregisterForLineControlInfo(Handler h)578 void unregisterForLineControlInfo(Handler h); 579 580 /** 581 * Registers the handler for CDMA T53 CLIR information record 582 * Unlike the register* methods, there's only one notification handler 583 * 584 * @param h Handler for notification message. 585 * @param what User-defined message code. 586 * @param obj User object. 587 */ registerFoT53ClirlInfo(Handler h, int what, Object obj)588 void registerFoT53ClirlInfo(Handler h, int what, Object obj); unregisterForT53ClirInfo(Handler h)589 void unregisterForT53ClirInfo(Handler h); 590 591 /** 592 * Registers the handler for CDMA T53 audio control information record 593 * Unlike the register* methods, there's only one notification handler 594 * 595 * @param h Handler for notification message. 596 * @param what User-defined message code. 597 * @param obj User object. 598 */ registerForT53AudioControlInfo(Handler h, int what, Object obj)599 void registerForT53AudioControlInfo(Handler h, int what, Object obj); unregisterForT53AudioControlInfo(Handler h)600 void unregisterForT53AudioControlInfo(Handler h); 601 602 /** 603 * Fires on if Modem enters Emergency Callback mode 604 */ 605 @UnsupportedAppUsage setEmergencyCallbackMode(Handler h, int what, Object obj)606 void setEmergencyCallbackMode(Handler h, int what, Object obj); 607 608 /** 609 * Fires on any CDMA OTA provision status change 610 */ 611 @UnsupportedAppUsage registerForCdmaOtaProvision(Handler h,int what, Object obj)612 void registerForCdmaOtaProvision(Handler h,int what, Object obj); 613 @UnsupportedAppUsage unregisterForCdmaOtaProvision(Handler h)614 void unregisterForCdmaOtaProvision(Handler h); 615 616 /** 617 * Registers the handler when out-band ringback tone is needed.<p> 618 * 619 * Messages received from this: 620 * Message.obj will be an AsyncResult 621 * AsyncResult.userObj = obj 622 * AsyncResult.result = boolean. <p> 623 */ registerForRingbackTone(Handler h, int what, Object obj)624 void registerForRingbackTone(Handler h, int what, Object obj); unregisterForRingbackTone(Handler h)625 void unregisterForRingbackTone(Handler h); 626 627 /** 628 * Registers the handler when mute/unmute need to be resent to get 629 * uplink audio during a call.<p> 630 * 631 * @param h Handler for notification message. 632 * @param what User-defined message code. 633 * @param obj User object. 634 * 635 */ registerForResendIncallMute(Handler h, int what, Object obj)636 void registerForResendIncallMute(Handler h, int what, Object obj); unregisterForResendIncallMute(Handler h)637 void unregisterForResendIncallMute(Handler h); 638 639 /** 640 * Registers the handler for when Cdma subscription changed events 641 * 642 * @param h Handler for notification message. 643 * @param what User-defined message code. 644 * @param obj User object. 645 * 646 */ registerForCdmaSubscriptionChanged(Handler h, int what, Object obj)647 void registerForCdmaSubscriptionChanged(Handler h, int what, Object obj); unregisterForCdmaSubscriptionChanged(Handler h)648 void unregisterForCdmaSubscriptionChanged(Handler h); 649 650 /** 651 * Registers the handler for when Cdma prl changed events 652 * 653 * @param h Handler for notification message. 654 * @param what User-defined message code. 655 * @param obj User object. 656 * 657 */ registerForCdmaPrlChanged(Handler h, int what, Object obj)658 void registerForCdmaPrlChanged(Handler h, int what, Object obj); unregisterForCdmaPrlChanged(Handler h)659 void unregisterForCdmaPrlChanged(Handler h); 660 661 /** 662 * Registers the handler for when Cdma prl changed events 663 * 664 * @param h Handler for notification message. 665 * @param what User-defined message code. 666 * @param obj User object. 667 * 668 */ registerForExitEmergencyCallbackMode(Handler h, int what, Object obj)669 void registerForExitEmergencyCallbackMode(Handler h, int what, Object obj); unregisterForExitEmergencyCallbackMode(Handler h)670 void unregisterForExitEmergencyCallbackMode(Handler h); 671 672 /** 673 * Registers the handler for RIL_UNSOL_RIL_CONNECT events. 674 * 675 * When ril connects or disconnects a message is sent to the registrant 676 * which contains an AsyncResult, ar, in msg.obj. The ar.result is an 677 * Integer which is the version of the ril or -1 if the ril disconnected. 678 * 679 * @param h Handler for notification message. 680 * @param what User-defined message code. 681 * @param obj User object. 682 */ 683 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) registerForRilConnected(Handler h, int what, Object obj)684 void registerForRilConnected(Handler h, int what, Object obj); 685 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) unregisterForRilConnected(Handler h)686 void unregisterForRilConnected(Handler h); 687 688 /** 689 * Registers the handler for RIL_UNSOL_SIM_DETACH_FROM_NETWORK_CONFIG_CHANGED events. 690 * 691 * @param h Handler for notification message. 692 * @param what User-defined message code. 693 * @param obj User object. 694 */ registerUiccApplicationEnablementChanged(Handler h, int what, Object obj)695 default void registerUiccApplicationEnablementChanged(Handler h, int what, Object obj) {}; 696 697 /** 698 * Unregisters the handler for RIL_UNSOL_SIM_DETACH_FROM_NETWORK_CONFIG_CHANGED events. 699 * 700 * @param h Handler for notification message. 701 */ unregisterUiccApplicationEnablementChanged(Handler h)702 default void unregisterUiccApplicationEnablementChanged(Handler h) {}; 703 704 /** 705 * Supply the ICC PIN to the ICC card 706 * 707 * returned message 708 * retMsg.obj = AsyncResult ar 709 * ar.exception carries exception on failure 710 * This exception is CommandException with an error of PASSWORD_INCORRECT 711 * if the password is incorrect 712 * 713 * ar.result is an optional array of integers where the first entry 714 * is the number of attempts remaining before the ICC will be PUK locked. 715 * 716 * ar.exception and ar.result are null on success 717 */ 718 719 @UnsupportedAppUsage supplyIccPin(String pin, Message result)720 void supplyIccPin(String pin, Message result); 721 722 /** 723 * Supply the PIN for the app with this AID on the ICC card 724 * 725 * AID (Application ID), See ETSI 102.221 8.1 and 101.220 4 726 * 727 * returned message 728 * retMsg.obj = AsyncResult ar 729 * ar.exception carries exception on failure 730 * This exception is CommandException with an error of PASSWORD_INCORRECT 731 * if the password is incorrect 732 * 733 * ar.result is an optional array of integers where the first entry 734 * is the number of attempts remaining before the ICC will be PUK locked. 735 * 736 * ar.exception and ar.result are null on success 737 */ 738 supplyIccPinForApp(String pin, String aid, Message result)739 void supplyIccPinForApp(String pin, String aid, Message result); 740 741 /** 742 * Supply the ICC PUK and newPin to the ICC card 743 * 744 * returned message 745 * retMsg.obj = AsyncResult ar 746 * ar.exception carries exception on failure 747 * This exception is CommandException with an error of PASSWORD_INCORRECT 748 * if the password is incorrect 749 * 750 * ar.result is an optional array of integers where the first entry 751 * is the number of attempts remaining before the ICC is permanently disabled. 752 * 753 * ar.exception and ar.result are null on success 754 */ 755 supplyIccPuk(String puk, String newPin, Message result)756 void supplyIccPuk(String puk, String newPin, Message result); 757 758 /** 759 * Supply the PUK, new pin for the app with this AID on the ICC card 760 * 761 * AID (Application ID), See ETSI 102.221 8.1 and 101.220 4 762 * 763 * retMsg.obj = AsyncResult ar 764 * ar.exception carries exception on failure 765 * This exception is CommandException with an error of PASSWORD_INCORRECT 766 * if the password is incorrect 767 * 768 * ar.result is an optional array of integers where the first entry 769 * is the number of attempts remaining before the ICC is permanently disabled. 770 * 771 * ar.exception and ar.result are null on success 772 */ 773 supplyIccPukForApp(String puk, String newPin, String aid, Message result)774 void supplyIccPukForApp(String puk, String newPin, String aid, Message result); 775 776 /** 777 * Supply the ICC PIN2 to the ICC card 778 * Only called following operation where ICC_PIN2 was 779 * returned as a a failure from a previous operation 780 * 781 * returned message 782 * retMsg.obj = AsyncResult ar 783 * ar.exception carries exception on failure 784 * This exception is CommandException with an error of PASSWORD_INCORRECT 785 * if the password is incorrect 786 * 787 * ar.result is an optional array of integers where the first entry 788 * is the number of attempts remaining before the ICC will be PUK locked. 789 * 790 * ar.exception and ar.result are null on success 791 */ 792 supplyIccPin2(String pin2, Message result)793 void supplyIccPin2(String pin2, Message result); 794 795 /** 796 * Supply the PIN2 for the app with this AID on the ICC card 797 * Only called following operation where ICC_PIN2 was 798 * returned as a a failure from a previous operation 799 * 800 * AID (Application ID), See ETSI 102.221 8.1 and 101.220 4 801 * 802 * returned message 803 * retMsg.obj = AsyncResult ar 804 * ar.exception carries exception on failure 805 * This exception is CommandException with an error of PASSWORD_INCORRECT 806 * if the password is incorrect 807 * 808 * ar.result is an optional array of integers where the first entry 809 * is the number of attempts remaining before the ICC will be PUK locked. 810 * 811 * ar.exception and ar.result are null on success 812 */ 813 supplyIccPin2ForApp(String pin2, String aid, Message result)814 void supplyIccPin2ForApp(String pin2, String aid, Message result); 815 816 /** 817 * Supply the SIM PUK2 to the SIM card 818 * Only called following operation where SIM_PUK2 was 819 * returned as a a failure from a previous operation 820 * 821 * returned message 822 * retMsg.obj = AsyncResult ar 823 * ar.exception carries exception on failure 824 * This exception is CommandException with an error of PASSWORD_INCORRECT 825 * if the password is incorrect 826 * 827 * ar.result is an optional array of integers where the first entry 828 * is the number of attempts remaining before the ICC is permanently disabled. 829 * 830 * ar.exception and ar.result are null on success 831 */ 832 supplyIccPuk2(String puk2, String newPin2, Message result)833 void supplyIccPuk2(String puk2, String newPin2, Message result); 834 835 /** 836 * Supply the PUK2, newPin2 for the app with this AID on the ICC card 837 * Only called following operation where SIM_PUK2 was 838 * returned as a a failure from a previous operation 839 * 840 * AID (Application ID), See ETSI 102.221 8.1 and 101.220 4 841 * 842 * returned message 843 * retMsg.obj = AsyncResult ar 844 * ar.exception carries exception on failure 845 * This exception is CommandException with an error of PASSWORD_INCORRECT 846 * if the password is incorrect 847 * 848 * ar.result is an optional array of integers where the first entry 849 * is the number of attempts remaining before the ICC is permanently disabled. 850 * 851 * ar.exception and ar.result are null on success 852 */ 853 supplyIccPuk2ForApp(String puk2, String newPin2, String aid, Message result)854 void supplyIccPuk2ForApp(String puk2, String newPin2, String aid, Message result); 855 856 // TODO: Add java doc and indicate that msg.arg1 contains the number of attempts remaining. changeIccPin(String oldPin, String newPin, Message result)857 void changeIccPin(String oldPin, String newPin, Message result); changeIccPinForApp(String oldPin, String newPin, String aidPtr, Message result)858 void changeIccPinForApp(String oldPin, String newPin, String aidPtr, Message result); changeIccPin2(String oldPin2, String newPin2, Message result)859 void changeIccPin2(String oldPin2, String newPin2, Message result); changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr, Message result)860 void changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr, Message result); 861 862 @UnsupportedAppUsage changeBarringPassword(String facility, String oldPwd, String newPwd, Message result)863 void changeBarringPassword(String facility, String oldPwd, String newPwd, Message result); 864 supplyNetworkDepersonalization(String netpin, Message result)865 void supplyNetworkDepersonalization(String netpin, Message result); 866 supplySimDepersonalization(PersoSubState persoType, String controlKey, Message result)867 void supplySimDepersonalization(PersoSubState persoType, String controlKey, Message result); 868 869 /** 870 * returned message 871 * retMsg.obj = AsyncResult ar 872 * ar.exception carries exception on failure 873 * ar.userObject contains the orignal value of result.obj 874 * ar.result contains a List of DriverCall 875 * The ar.result List is sorted by DriverCall.index 876 */ getCurrentCalls(Message result)877 void getCurrentCalls (Message result); 878 879 /** 880 * returned message 881 * retMsg.obj = AsyncResult ar 882 * ar.exception carries exception on failure 883 * ar.userObject contains the orignal value of result.obj 884 * ar.result contains a List of DataCallResponse 885 * @deprecated Do not use. 886 */ 887 @UnsupportedAppUsage 888 @Deprecated getPDPContextList(Message result)889 void getPDPContextList(Message result); 890 891 /** 892 * returned message 893 * retMsg.obj = AsyncResult ar 894 * ar.exception carries exception on failure 895 * ar.userObject contains the orignal value of result.obj 896 * ar.result contains a List of DataCallResponse 897 */ 898 @UnsupportedAppUsage getDataCallList(Message result)899 void getDataCallList(Message result); 900 901 /** 902 * returned message 903 * retMsg.obj = AsyncResult ar 904 * ar.exception carries exception on failure 905 * ar.userObject contains the orignal value of result.obj 906 * ar.result is null on success and failure 907 * 908 * CLIR_DEFAULT == on "use subscription default value" 909 * CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation) 910 * CLIR_INVOCATION == on "CLIR invocation" (restrict CLI presentation) 911 */ dial(String address, boolean isEmergencyCall, EmergencyNumber emergencyNumberInfo, boolean hasKnownUserIntentEmergency, int clirMode, Message result)912 void dial(String address, boolean isEmergencyCall, EmergencyNumber emergencyNumberInfo, 913 boolean hasKnownUserIntentEmergency, int clirMode, Message result); 914 915 /** 916 * returned message 917 * retMsg.obj = AsyncResult ar 918 * ar.exception carries exception on failure 919 * ar.userObject contains the orignal value of result.obj 920 * ar.result is null on success and failure 921 * 922 * CLIR_DEFAULT == on "use subscription default value" 923 * CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation) 924 * CLIR_INVOCATION == on "CLIR invocation" (restrict CLI presentation) 925 */ dial(String address, boolean isEmergencyCall, EmergencyNumber emergencyNumberInfo, boolean hasKnownUserIntentEmergency, int clirMode, UUSInfo uusInfo, Message result)926 void dial(String address, boolean isEmergencyCall, EmergencyNumber emergencyNumberInfo, 927 boolean hasKnownUserIntentEmergency, int clirMode, UUSInfo uusInfo, Message result); 928 929 /** 930 * returned message 931 * retMsg.obj = AsyncResult ar 932 * ar.exception carries exception on failure 933 * ar.userObject contains the orignal value of result.obj 934 * ar.result is String containing IMSI on success 935 */ 936 @UnsupportedAppUsage getIMSI(Message result)937 void getIMSI(Message result); 938 939 /** 940 * returned message 941 * retMsg.obj = AsyncResult ar 942 * ar.exception carries exception on failure 943 * ar.userObject contains the orignal value of result.obj 944 * ar.result is String containing IMSI on success 945 */ getIMSIForApp(String aid, Message result)946 void getIMSIForApp(String aid, Message result); 947 948 /** 949 * returned message 950 * retMsg.obj = AsyncResult ar 951 * ar.exception carries exception on failure 952 * ar.userObject contains the orignal value of result.obj 953 * ar.result is String containing IMEI on success 954 */ getIMEI(Message result)955 void getIMEI(Message result); 956 957 /** 958 * returned message 959 * retMsg.obj = AsyncResult ar 960 * ar.exception carries exception on failure 961 * ar.userObject contains the orignal value of result.obj 962 * ar.result is String containing IMEISV on success 963 */ 964 @UnsupportedAppUsage getIMEISV(Message result)965 void getIMEISV(Message result); 966 967 /** 968 * Hang up one individual connection. 969 * returned message 970 * retMsg.obj = AsyncResult ar 971 * ar.exception carries exception on failure 972 * ar.userObject contains the orignal value of result.obj 973 * ar.result is null on success and failure 974 * 975 * 3GPP 22.030 6.5.5 976 * "Releases a specific active call X" 977 */ hangupConnection(int gsmIndex, Message result)978 void hangupConnection (int gsmIndex, Message result); 979 980 /** 981 * 3GPP 22.030 6.5.5 982 * "Releases all held calls or sets User Determined User Busy (UDUB) 983 * for a waiting call." 984 * ar.exception carries exception on failure 985 * ar.userObject contains the orignal value of result.obj 986 * ar.result is null on success and failure 987 */ hangupWaitingOrBackground(Message result)988 void hangupWaitingOrBackground (Message result); 989 990 /** 991 * 3GPP 22.030 6.5.5 992 * "Releases all active calls (if any exist) and accepts 993 * the other (held or waiting) call." 994 * 995 * ar.exception carries exception on failure 996 * ar.userObject contains the orignal value of result.obj 997 * ar.result is null on success and failure 998 */ hangupForegroundResumeBackground(Message result)999 void hangupForegroundResumeBackground (Message result); 1000 1001 /** 1002 * 3GPP 22.030 6.5.5 1003 * "Places all active calls (if any exist) on hold and accepts 1004 * the other (held or waiting) call." 1005 * 1006 * ar.exception carries exception on failure 1007 * ar.userObject contains the orignal value of result.obj 1008 * ar.result is null on success and failure 1009 */ 1010 @UnsupportedAppUsage switchWaitingOrHoldingAndActive(Message result)1011 void switchWaitingOrHoldingAndActive (Message result); 1012 1013 /** 1014 * 3GPP 22.030 6.5.5 1015 * "Adds a held call to the conversation" 1016 * 1017 * ar.exception carries exception on failure 1018 * ar.userObject contains the orignal value of result.obj 1019 * ar.result is null on success and failure 1020 */ conference(Message result)1021 void conference (Message result); 1022 1023 /** 1024 * Set preferred Voice Privacy (VP). 1025 * 1026 * @param enable true is enhanced and false is normal VP 1027 * @param result is a callback message 1028 */ setPreferredVoicePrivacy(boolean enable, Message result)1029 void setPreferredVoicePrivacy(boolean enable, Message result); 1030 1031 /** 1032 * Get currently set preferred Voice Privacy (VP) mode. 1033 * 1034 * @param result is a callback message 1035 */ getPreferredVoicePrivacy(Message result)1036 void getPreferredVoicePrivacy(Message result); 1037 1038 /** 1039 * 3GPP 22.030 6.5.5 1040 * "Places all active calls on hold except call X with which 1041 * communication shall be supported." 1042 */ separateConnection(int gsmIndex, Message result)1043 void separateConnection (int gsmIndex, Message result); 1044 1045 /** 1046 * 1047 * ar.exception carries exception on failure 1048 * ar.userObject contains the orignal value of result.obj 1049 * ar.result is null on success and failure 1050 */ 1051 @UnsupportedAppUsage acceptCall(Message result)1052 void acceptCall (Message result); 1053 1054 /** 1055 * also known as UDUB 1056 * ar.exception carries exception on failure 1057 * ar.userObject contains the orignal value of result.obj 1058 * ar.result is null on success and failure 1059 */ rejectCall(Message result)1060 void rejectCall (Message result); 1061 1062 /** 1063 * 3GPP 22.030 6.5.5 1064 * "Connects the two calls and disconnects the subscriber from both calls" 1065 * 1066 * ar.exception carries exception on failure 1067 * ar.userObject contains the orignal value of result.obj 1068 * ar.result is null on success and failure 1069 */ explicitCallTransfer(Message result)1070 void explicitCallTransfer (Message result); 1071 1072 /** 1073 * cause code returned as int[0] in Message.obj.response 1074 * Returns integer cause code defined in TS 24.008 1075 * Annex H or closest approximation. 1076 * Most significant codes: 1077 * - Any defined in 22.001 F.4 (for generating busy/congestion) 1078 * - Cause 68: ACM >= ACMMax 1079 */ getLastCallFailCause(Message result)1080 void getLastCallFailCause (Message result); 1081 1082 1083 /** 1084 * Reason for last PDP context deactivate or failure to activate 1085 * cause code returned as int[0] in Message.obj.response 1086 * returns an integer cause code defined in TS 24.008 1087 * section 6.1.3.1.3 or close approximation 1088 * @deprecated Do not use. 1089 */ 1090 @UnsupportedAppUsage 1091 @Deprecated getLastPdpFailCause(Message result)1092 void getLastPdpFailCause (Message result); 1093 1094 /** 1095 * The preferred new alternative to getLastPdpFailCause 1096 * that is also CDMA-compatible. 1097 */ 1098 @UnsupportedAppUsage getLastDataCallFailCause(Message result)1099 void getLastDataCallFailCause (Message result); 1100 setMute(boolean enableMute, Message response)1101 void setMute (boolean enableMute, Message response); 1102 getMute(Message response)1103 void getMute (Message response); 1104 1105 /** 1106 * response.obj is an AsyncResult 1107 * response.obj.result is an int[2] 1108 * response.obj.result[0] is received signal strength (0-31, 99) 1109 * response.obj.result[1] is bit error rate (0-7, 99) 1110 * as defined in TS 27.007 8.5 1111 */ 1112 @UnsupportedAppUsage getSignalStrength(Message response)1113 void getSignalStrength (Message response); 1114 1115 1116 /** 1117 * response.obj.result is an int[3] 1118 * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2 1119 * response.obj.result[1] is LAC if registered or -1 if not 1120 * response.obj.result[2] is CID if registered or -1 if not 1121 * valid LAC and CIDs are 0x0000 - 0xffff 1122 * 1123 * Please note that registration state 4 ("unknown") is treated 1124 * as "out of service" above 1125 */ 1126 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) getVoiceRegistrationState(Message response)1127 void getVoiceRegistrationState (Message response); 1128 1129 /** 1130 * response.obj.result is an int[3] 1131 * response.obj.result[0] is registration state 0-5 from TS 27.007 7.2 1132 * response.obj.result[1] is LAC if registered or -1 if not 1133 * response.obj.result[2] is CID if registered or -1 if not 1134 * valid LAC and CIDs are 0x0000 - 0xffff 1135 * 1136 * Please note that registration state 4 ("unknown") is treated 1137 * as "out of service" above 1138 */ getDataRegistrationState(Message response)1139 void getDataRegistrationState (Message response); 1140 1141 /** 1142 * response.obj.result is a String[3] 1143 * response.obj.result[0] is long alpha or null if unregistered 1144 * response.obj.result[1] is short alpha or null if unregistered 1145 * response.obj.result[2] is numeric or null if unregistered 1146 */ 1147 @UnsupportedAppUsage getOperator(Message response)1148 void getOperator(Message response); 1149 1150 /** 1151 * ar.exception carries exception on failure 1152 * ar.userObject contains the orignal value of result.obj 1153 * ar.result is null on success and failure 1154 */ 1155 @UnsupportedAppUsage sendDtmf(char c, Message result)1156 void sendDtmf(char c, Message result); 1157 1158 1159 /** 1160 * ar.exception carries exception on failure 1161 * ar.userObject contains the orignal value of result.obj 1162 * ar.result is null on success and failure 1163 */ startDtmf(char c, Message result)1164 void startDtmf(char c, Message result); 1165 1166 /** 1167 * ar.exception carries exception on failure 1168 * ar.userObject contains the orignal value of result.obj 1169 * ar.result is null on success and failure 1170 */ stopDtmf(Message result)1171 void stopDtmf(Message result); 1172 1173 /** 1174 * ar.exception carries exception on failure 1175 * ar.userObject contains the orignal value of result.obj 1176 * ar.result is null on success and failure 1177 */ sendBurstDtmf(String dtmfString, int on, int off, Message result)1178 void sendBurstDtmf(String dtmfString, int on, int off, Message result); 1179 1180 /** 1181 * smscPDU is smsc address in PDU form GSM BCD format prefixed 1182 * by a length byte (as expected by TS 27.005) or NULL for default SMSC 1183 * pdu is SMS in PDU format as an ASCII hex string 1184 * less the SMSC address 1185 */ sendSMS(String smscPDU, String pdu, Message response)1186 void sendSMS (String smscPDU, String pdu, Message response); 1187 1188 /** 1189 * Send an SMS message, Identical to sendSMS, 1190 * except that more messages are expected to be sent soon 1191 * smscPDU is smsc address in PDU form GSM BCD format prefixed 1192 * by a length byte (as expected by TS 27.005) or NULL for default SMSC 1193 * pdu is SMS in PDU format as an ASCII hex string 1194 * less the SMSC address 1195 */ sendSMSExpectMore(String smscPDU, String pdu, Message response)1196 void sendSMSExpectMore (String smscPDU, String pdu, Message response); 1197 1198 /** 1199 * @param pdu is CDMA-SMS in internal pseudo-PDU format 1200 * @param response sent when operation completes 1201 */ sendCdmaSms(byte[] pdu, Message response)1202 void sendCdmaSms(byte[] pdu, Message response); 1203 1204 /** 1205 * Identical to sendCdmaSms, except that more messages are expected to be sent soon 1206 * @param pdu is CDMA-SMS in internal pseudo-PDU format 1207 * @param response response sent when operation completed 1208 */ sendCdmaSMSExpectMore(byte[] pdu, Message response)1209 void sendCdmaSMSExpectMore(byte[] pdu, Message response); 1210 1211 /** 1212 * send SMS over IMS with 3GPP/GSM SMS format 1213 * @param smscPDU is smsc address in PDU form GSM BCD format prefixed 1214 * by a length byte (as expected by TS 27.005) or NULL for default SMSC 1215 * @param pdu is SMS in PDU format as an ASCII hex string 1216 * less the SMSC address 1217 * @param retry indicates if this is a retry; 0 == not retry, nonzero = retry 1218 * @param messageRef valid field if retry is set to nonzero. 1219 * Contains messageRef from RIL_SMS_Response corresponding to failed MO SMS 1220 * @param response sent when operation completes 1221 */ sendImsGsmSms(String smscPDU, String pdu, int retry, int messageRef, Message response)1222 void sendImsGsmSms (String smscPDU, String pdu, int retry, int messageRef, 1223 Message response); 1224 1225 /** 1226 * send SMS over IMS with 3GPP2/CDMA SMS format 1227 * @param pdu is CDMA-SMS in internal pseudo-PDU format 1228 * @param response sent when operation completes 1229 * @param retry indicates if this is a retry; 0 == not retry, nonzero = retry 1230 * @param messageRef valid field if retry is set to nonzero. 1231 * Contains messageRef from RIL_SMS_Response corresponding to failed MO SMS 1232 * @param response sent when operation completes 1233 */ sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message response)1234 void sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message response); 1235 1236 /** 1237 * Deletes the specified SMS record from SIM memory (EF_SMS). 1238 * 1239 * @param index index of the SMS record to delete 1240 * @param response sent when operation completes 1241 */ 1242 @UnsupportedAppUsage deleteSmsOnSim(int index, Message response)1243 void deleteSmsOnSim(int index, Message response); 1244 1245 /** 1246 * Deletes the specified SMS record from RUIM memory (EF_SMS in DF_CDMA). 1247 * 1248 * @param index index of the SMS record to delete 1249 * @param response sent when operation completes 1250 */ 1251 @UnsupportedAppUsage deleteSmsOnRuim(int index, Message response)1252 void deleteSmsOnRuim(int index, Message response); 1253 1254 /** 1255 * Writes an SMS message to SIM memory (EF_SMS). 1256 * 1257 * @param status status of message on SIM. One of: 1258 * SmsManger.STATUS_ON_ICC_READ 1259 * SmsManger.STATUS_ON_ICC_UNREAD 1260 * SmsManger.STATUS_ON_ICC_SENT 1261 * SmsManger.STATUS_ON_ICC_UNSENT 1262 * @param pdu message PDU, as hex string 1263 * @param response sent when operation completes. 1264 * response.obj will be an AsyncResult, and will indicate 1265 * any error that may have occurred (eg, out of memory). 1266 */ 1267 @UnsupportedAppUsage writeSmsToSim(int status, String smsc, String pdu, Message response)1268 void writeSmsToSim(int status, String smsc, String pdu, Message response); 1269 1270 /** 1271 * Writes an SMS message to RUIM memory (EF_SMS). 1272 * 1273 * @param status status of message on SIM. One of: 1274 * SmsManger.STATUS_ON_ICC_READ 1275 * SmsManger.STATUS_ON_ICC_UNREAD 1276 * SmsManger.STATUS_ON_ICC_SENT 1277 * SmsManger.STATUS_ON_ICC_UNSENT 1278 * @param pdu message PDU, as byte array 1279 * @param response sent when operation completes. response.obj will be an AsyncResult, and will 1280 * indicate any error that may have occurred (eg, out of memory). 1281 */ 1282 @UnsupportedAppUsage writeSmsToRuim(int status, byte[] pdu, Message response)1283 void writeSmsToRuim(int status, byte[] pdu, Message response); 1284 1285 @UnsupportedAppUsage setRadioPower(boolean on, Message response)1286 default void setRadioPower(boolean on, Message response) { 1287 setRadioPower(on, false, false, response); 1288 } 1289 1290 /** 1291 * Sets the radio power on/off state (off is sometimes 1292 * called "airplane mode"). 1293 * 1294 * @param on true means "on", false means "off". 1295 * @param forEmergencyCall true means the purpose of turning radio power on is for emergency 1296 * call. No effect if power is set false. 1297 * @param isSelectedPhoneForEmergencyCall true means this phone / modem is selected to place 1298 * emergency call after turning power on. No effect if power 1299 * or forEmergency is set false. 1300 * @param response sent when operation completes. 1301 */ setRadioPower(boolean on, boolean forEmergencyCall, boolean isSelectedPhoneForEmergencyCall, Message response)1302 default void setRadioPower(boolean on, boolean forEmergencyCall, 1303 boolean isSelectedPhoneForEmergencyCall, Message response) {} 1304 1305 @UnsupportedAppUsage acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response)1306 void acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response); 1307 1308 @UnsupportedAppUsage acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response)1309 void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response); 1310 1311 /** 1312 * Acknowledge successful or failed receipt of last incoming SMS, 1313 * including acknowledgement TPDU to send as the RP-User-Data element 1314 * of the RP-ACK or RP-ERROR PDU. 1315 * 1316 * @param success true to send RP-ACK, false to send RP-ERROR 1317 * @param ackPdu the acknowledgement TPDU in hexadecimal format 1318 * @param response sent when operation completes. 1319 */ acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response)1320 void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response); 1321 1322 /** 1323 * parameters equivalent to 27.007 AT+CRSM command 1324 * response.obj will be an AsyncResult 1325 * response.obj.result will be an IccIoResult on success 1326 */ 1327 @UnsupportedAppUsage iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, Message response)1328 void iccIO (int command, int fileid, String path, int p1, int p2, int p3, 1329 String data, String pin2, Message response); 1330 1331 /** 1332 * parameters equivalent to 27.007 AT+CRSM command 1333 * response.obj will be an AsyncResult 1334 * response.obj.userObj will be a IccIoResult on success 1335 */ 1336 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid, Message response)1337 void iccIOForApp (int command, int fileid, String path, int p1, int p2, int p3, 1338 String data, String pin2, String aid, Message response); 1339 1340 /** 1341 * (AsyncResult)response.obj).result is an int[] with element [0] set to 1342 * 1 for "CLIP is provisioned", and 0 for "CLIP is not provisioned". 1343 * 1344 * @param response is callback message 1345 */ 1346 queryCLIP(Message response)1347 void queryCLIP(Message response); 1348 1349 /** 1350 * response.obj will be a an int[2] 1351 * 1352 * response.obj[0] will be TS 27.007 +CLIR parameter 'n' 1353 * 0 presentation indicator is used according to the subscription of the CLIR service 1354 * 1 CLIR invocation 1355 * 2 CLIR suppression 1356 * 1357 * response.obj[1] will be TS 27.007 +CLIR parameter 'm' 1358 * 0 CLIR not provisioned 1359 * 1 CLIR provisioned in permanent mode 1360 * 2 unknown (e.g. no network, etc.) 1361 * 3 CLIR temporary mode presentation restricted 1362 * 4 CLIR temporary mode presentation allowed 1363 */ 1364 getCLIR(Message response)1365 void getCLIR(Message response); 1366 1367 /** 1368 * clirMode is one of the CLIR_* constants above 1369 * 1370 * response.obj is null 1371 */ 1372 setCLIR(int clirMode, Message response)1373 void setCLIR(int clirMode, Message response); 1374 1375 /** 1376 * (AsyncResult)response.obj).result is an int[] with element [0] set to 1377 * 0 for disabled, 1 for enabled. 1378 * 1379 * @param serviceClass is a sum of SERVICE_CLASS_* 1380 * @param response is callback message 1381 */ 1382 1383 @UnsupportedAppUsage queryCallWaiting(int serviceClass, Message response)1384 void queryCallWaiting(int serviceClass, Message response); 1385 1386 /** 1387 * @param enable is true to enable, false to disable 1388 * @param serviceClass is a sum of SERVICE_CLASS_* 1389 * @param response is callback message 1390 */ 1391 1392 @UnsupportedAppUsage setCallWaiting(boolean enable, int serviceClass, Message response)1393 void setCallWaiting(boolean enable, int serviceClass, Message response); 1394 1395 /** 1396 * @param action is one of CF_ACTION_* 1397 * @param cfReason is one of CF_REASON_* 1398 * @param serviceClass is a sum of SERVICE_CLASSS_* 1399 */ 1400 @UnsupportedAppUsage setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds, Message response)1401 void setCallForward(int action, int cfReason, int serviceClass, 1402 String number, int timeSeconds, Message response); 1403 1404 /** 1405 * cfReason is one of CF_REASON_* 1406 * 1407 * ((AsyncResult)response.obj).result will be an array of 1408 * CallForwardInfo's 1409 * 1410 * An array of length 0 means "disabled for all codes" 1411 */ 1412 @UnsupportedAppUsage queryCallForwardStatus(int cfReason, int serviceClass, String number, Message response)1413 void queryCallForwardStatus(int cfReason, int serviceClass, 1414 String number, Message response); 1415 1416 @UnsupportedAppUsage setNetworkSelectionModeAutomatic(Message response)1417 void setNetworkSelectionModeAutomatic(Message response); 1418 1419 /** 1420 * Ask the radio to connect to the input network with specific RadioAccessNetwork 1421 * and change selection mode to manual. 1422 * @param operatorNumeric PLMN ID of the network to select. 1423 * @param ran radio access network type (see {@link AccessNetworkType}). 1424 * @param response callback message. 1425 */ 1426 @UnsupportedAppUsage setNetworkSelectionModeManual(String operatorNumeric, int ran, Message response)1427 void setNetworkSelectionModeManual(String operatorNumeric, int ran, Message response); 1428 1429 /** 1430 * Queries whether the current network selection mode is automatic 1431 * or manual 1432 * 1433 * ((AsyncResult)response.obj).result is an int[] with element [0] being 1434 * a 0 for automatic selection and a 1 for manual selection 1435 */ 1436 1437 @UnsupportedAppUsage getNetworkSelectionMode(Message response)1438 void getNetworkSelectionMode(Message response); 1439 1440 /** 1441 * Queries the currently available networks 1442 * 1443 * ((AsyncResult)response.obj).result is a List of NetworkInfo objects 1444 */ getAvailableNetworks(Message response)1445 void getAvailableNetworks(Message response); 1446 1447 /** 1448 * Starts a radio network scan 1449 * 1450 * ((AsyncResult)response.obj).result is a NetworkScanResult object 1451 */ startNetworkScan(NetworkScanRequest nsr, Message response)1452 void startNetworkScan(NetworkScanRequest nsr, Message response); 1453 1454 /** 1455 * Stops the ongoing network scan 1456 * 1457 * ((AsyncResult)response.obj).result is a NetworkScanResult object 1458 * 1459 */ stopNetworkScan(Message response)1460 void stopNetworkScan(Message response); 1461 1462 /** 1463 * Gets the baseband version 1464 */ 1465 @UnsupportedAppUsage getBasebandVersion(Message response)1466 void getBasebandVersion(Message response); 1467 1468 /** 1469 * (AsyncResult)response.obj).result will be an Integer representing 1470 * the sum of enabled service classes (sum of SERVICE_CLASS_*) 1471 * 1472 * @param facility one of CB_FACILTY_* 1473 * @param password password or "" if not required 1474 * @param serviceClass is a sum of SERVICE_CLASS_* 1475 * @param response is callback message 1476 */ 1477 1478 @UnsupportedAppUsage queryFacilityLock(String facility, String password, int serviceClass, Message response)1479 void queryFacilityLock (String facility, String password, int serviceClass, 1480 Message response); 1481 1482 /** 1483 * (AsyncResult)response.obj).result will be an Integer representing 1484 * the sum of enabled service classes (sum of SERVICE_CLASS_*) for the 1485 * application with appId. 1486 * 1487 * @param facility one of CB_FACILTY_* 1488 * @param password password or "" if not required 1489 * @param serviceClass is a sum of SERVICE_CLASS_* 1490 * @param appId is application Id or null if none 1491 * @param response is callback message 1492 */ 1493 queryFacilityLockForApp(String facility, String password, int serviceClass, String appId, Message response)1494 void queryFacilityLockForApp(String facility, String password, int serviceClass, String appId, 1495 Message response); 1496 1497 /** 1498 * @param facility one of CB_FACILTY_* 1499 * @param lockState true means lock, false means unlock 1500 * @param password password or "" if not required 1501 * @param serviceClass is a sum of SERVICE_CLASS_* 1502 * @param response is callback message 1503 */ 1504 @UnsupportedAppUsage setFacilityLock(String facility, boolean lockState, String password, int serviceClass, Message response)1505 void setFacilityLock (String facility, boolean lockState, String password, 1506 int serviceClass, Message response); 1507 1508 /** 1509 * Set the facility lock for the app with this AID on the ICC card. 1510 * 1511 * @param facility one of CB_FACILTY_* 1512 * @param lockState true means lock, false means unlock 1513 * @param password password or "" if not required 1514 * @param serviceClass is a sum of SERVICE_CLASS_* 1515 * @param appId is application Id or null if none 1516 * @param response is callback message 1517 */ setFacilityLockForApp(String facility, boolean lockState, String password, int serviceClass, String appId, Message response)1518 void setFacilityLockForApp(String facility, boolean lockState, String password, 1519 int serviceClass, String appId, Message response); 1520 sendUSSD(String ussdString, Message response)1521 void sendUSSD (String ussdString, Message response); 1522 1523 /** 1524 * Cancels a pending USSD session if one exists. 1525 * @param response callback message 1526 */ cancelPendingUssd(Message response)1527 void cancelPendingUssd (Message response); 1528 resetRadio(Message result)1529 void resetRadio(Message result); 1530 1531 /** 1532 * Assign a specified band for RF configuration. 1533 * 1534 * @param bandMode one of BM_*_BAND 1535 * @param response is callback message 1536 */ setBandMode(int bandMode, Message response)1537 void setBandMode (int bandMode, Message response); 1538 1539 /** 1540 * Query the list of band mode supported by RF. 1541 * 1542 * @param response is callback message 1543 * ((AsyncResult)response.obj).result is an int[] where int[0] is 1544 * the size of the array and the rest of each element representing 1545 * one available BM_*_BAND 1546 */ queryAvailableBandMode(Message response)1547 void queryAvailableBandMode (Message response); 1548 1549 /** 1550 * Requests to set the preferred network type for searching and registering 1551 * (CS/PS domain, RAT, and operation mode) 1552 * @param networkType one of NT_*_TYPE 1553 * @param response is callback message 1554 */ 1555 @UnsupportedAppUsage setPreferredNetworkType(int networkType , Message response)1556 void setPreferredNetworkType(int networkType , Message response); 1557 1558 /** 1559 * Query the preferred network type setting 1560 * 1561 * @param response is callback message to report one of NT_*_TYPE 1562 */ 1563 @UnsupportedAppUsage getPreferredNetworkType(Message response)1564 void getPreferredNetworkType(Message response); 1565 1566 /** 1567 * Requests to set the allowed network types for searching and registering. 1568 * 1569 * @param networkTypeBitmask {@link TelephonyManager.NetworkTypeBitMask} 1570 * @param response is callback message 1571 */ setAllowedNetworkTypesBitmap( @elephonyManager.NetworkTypeBitMask int networkTypeBitmask, Message response)1572 void setAllowedNetworkTypesBitmap( 1573 @TelephonyManager.NetworkTypeBitMask int networkTypeBitmask, Message response); 1574 1575 /** 1576 * Query the allowed network types setting. 1577 * 1578 * @param response is callback message to report allowed network types bitmask 1579 */ getAllowedNetworkTypesBitmap(Message response)1580 void getAllowedNetworkTypesBitmap(Message response); 1581 1582 /** 1583 * Enable/Disable E-UTRA-NR Dual Connectivity 1584 * @param nrDualConnectivityState expected NR dual connectivity state 1585 * This can be passed following states 1586 * <ol> 1587 * <li>Enable NR dual connectivity {@link TelephonyManager#NR_DUAL_CONNECTIVITY_ENABLE} 1588 * <li>Disable NR dual connectivity {@link TelephonyManager#NR_DUAL_CONNECTIVITY_DISABLE} 1589 * <li>Disable NR dual connectivity and force secondary cell to be released 1590 * {@link TelephonyManager#NR_DUAL_CONNECTIVITY_DISABLE_IMMEDIATE} 1591 * </ol> 1592 */ setNrDualConnectivityState(int nrDualConnectivityState, Message message, WorkSource workSource)1593 default void setNrDualConnectivityState(int nrDualConnectivityState, 1594 Message message, WorkSource workSource) {} 1595 1596 /** 1597 * Is E-UTRA-NR Dual Connectivity enabled 1598 */ isNrDualConnectivityEnabled(Message message, WorkSource workSource)1599 default void isNrDualConnectivityEnabled(Message message, WorkSource workSource) {} 1600 1601 /** 1602 * Request to enable/disable network state change notifications when 1603 * location information (lac and/or cid) has changed. 1604 * 1605 * @param enable true to enable, false to disable 1606 * @param workSource calling WorkSource 1607 * @param response callback message 1608 */ setLocationUpdates(boolean enable, WorkSource workSource, Message response)1609 default void setLocationUpdates(boolean enable, WorkSource workSource, Message response) {} 1610 1611 /** 1612 * To be deleted 1613 */ setLocationUpdates(boolean enable, Message response)1614 default void setLocationUpdates(boolean enable, Message response) {} 1615 1616 /** 1617 * Gets the default SMSC address. 1618 * 1619 * @param result Callback message contains the SMSC address. 1620 */ 1621 @UnsupportedAppUsage getSmscAddress(Message result)1622 void getSmscAddress(Message result); 1623 1624 /** 1625 * Sets the default SMSC address. 1626 * 1627 * @param address new SMSC address 1628 * @param result Callback message is empty on completion 1629 */ 1630 @UnsupportedAppUsage setSmscAddress(String address, Message result)1631 void setSmscAddress(String address, Message result); 1632 1633 /** 1634 * Indicates whether there is storage available for new SMS messages. 1635 * @param available true if storage is available 1636 * @param result callback message 1637 */ 1638 @UnsupportedAppUsage reportSmsMemoryStatus(boolean available, Message result)1639 void reportSmsMemoryStatus(boolean available, Message result); 1640 1641 /** 1642 * Indicates to the vendor ril that StkService is running 1643 * and is ready to receive RIL_UNSOL_STK_XXXX commands. 1644 * 1645 * @param result callback message 1646 */ 1647 @UnsupportedAppUsage reportStkServiceIsRunning(Message result)1648 void reportStkServiceIsRunning(Message result); 1649 1650 @UnsupportedAppUsage invokeOemRilRequestRaw(byte[] data, Message response)1651 void invokeOemRilRequestRaw(byte[] data, Message response); 1652 1653 /** 1654 * Sends carrier specific information to the vendor ril that can be used to 1655 * encrypt the IMSI and IMPI. 1656 * 1657 * @param publicKey the public key of the carrier used to encrypt IMSI/IMPI. 1658 * @param keyIdentifier the key identifier is optional information that is carrier 1659 * specific. 1660 * @param response callback message 1661 */ setCarrierInfoForImsiEncryption(ImsiEncryptionInfo imsiEncryptionInfo, Message response)1662 void setCarrierInfoForImsiEncryption(ImsiEncryptionInfo imsiEncryptionInfo, 1663 Message response); 1664 invokeOemRilRequestStrings(String[] strings, Message response)1665 void invokeOemRilRequestStrings(String[] strings, Message response); 1666 1667 /** 1668 * Fires when RIL_UNSOL_OEM_HOOK_RAW is received from the RIL. 1669 */ setOnUnsolOemHookRaw(Handler h, int what, Object obj)1670 void setOnUnsolOemHookRaw(Handler h, int what, Object obj); unSetOnUnsolOemHookRaw(Handler h)1671 void unSetOnUnsolOemHookRaw(Handler h); 1672 1673 /** 1674 * Send TERMINAL RESPONSE to the SIM, after processing a proactive command 1675 * sent by the SIM. 1676 * 1677 * @param contents String containing SAT/USAT response in hexadecimal 1678 * format starting with first byte of response data. See 1679 * TS 102 223 for details. 1680 * @param response Callback message 1681 */ 1682 @UnsupportedAppUsage sendTerminalResponse(String contents, Message response)1683 public void sendTerminalResponse(String contents, Message response); 1684 1685 /** 1686 * Send ENVELOPE to the SIM, after processing a proactive command sent by 1687 * the SIM. 1688 * 1689 * @param contents String containing SAT/USAT response in hexadecimal 1690 * format starting with command tag. See TS 102 223 for 1691 * details. 1692 * @param response Callback message 1693 */ 1694 @UnsupportedAppUsage sendEnvelope(String contents, Message response)1695 public void sendEnvelope(String contents, Message response); 1696 1697 /** 1698 * Send ENVELOPE to the SIM, such as an SMS-PP data download envelope 1699 * for a SIM data download message. This method has one difference 1700 * from {@link #sendEnvelope}: The SW1 and SW2 status bytes from the UICC response 1701 * are returned along with the response data. 1702 * 1703 * response.obj will be an AsyncResult 1704 * response.obj.result will be an IccIoResult on success 1705 * 1706 * @param contents String containing SAT/USAT response in hexadecimal 1707 * format starting with command tag. See TS 102 223 for 1708 * details. 1709 * @param response Callback message 1710 */ sendEnvelopeWithStatus(String contents, Message response)1711 public void sendEnvelopeWithStatus(String contents, Message response); 1712 1713 /** 1714 * Accept or reject the call setup request from SIM. 1715 * 1716 * @param accept true if the call is to be accepted, false otherwise. 1717 * @param response Callback message 1718 */ 1719 @UnsupportedAppUsage handleCallSetupRequestFromSim(boolean accept, Message response)1720 public void handleCallSetupRequestFromSim(boolean accept, Message response); 1721 1722 /** 1723 * Activate or deactivate cell broadcast SMS for GSM. 1724 * 1725 * @param activate 1726 * true = activate, false = deactivate 1727 * @param result Callback message is empty on completion 1728 */ setGsmBroadcastActivation(boolean activate, Message result)1729 public void setGsmBroadcastActivation(boolean activate, Message result); 1730 1731 /** 1732 * Configure cell broadcast SMS for GSM. 1733 * 1734 * @param response Callback message is empty on completion 1735 */ setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response)1736 public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response); 1737 1738 /** 1739 * Query the current configuration of cell broadcast SMS of GSM. 1740 * 1741 * @param response 1742 * Callback message contains the configuration from the modem 1743 * on completion 1744 */ getGsmBroadcastConfig(Message response)1745 public void getGsmBroadcastConfig(Message response); 1746 1747 //***** new Methods for CDMA support 1748 1749 /** 1750 * Request the device ESN / MEID / IMEI / IMEISV. 1751 * "response" is const char ** 1752 * [0] is IMEI if GSM subscription is available 1753 * [1] is IMEISV if GSM subscription is available 1754 * [2] is ESN if CDMA subscription is available 1755 * [3] is MEID if CDMA subscription is available 1756 */ getDeviceIdentity(Message response)1757 public void getDeviceIdentity(Message response); 1758 1759 /** 1760 * Request the device MDN / H_SID / H_NID / MIN. 1761 * "response" is const char ** 1762 * [0] is MDN if CDMA subscription is available 1763 * [1] is a comma separated list of H_SID (Home SID) in decimal format 1764 * if CDMA subscription is available 1765 * [2] is a comma separated list of H_NID (Home NID) in decimal format 1766 * if CDMA subscription is available 1767 * [3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available 1768 */ 1769 @UnsupportedAppUsage getCDMASubscription(Message response)1770 public void getCDMASubscription(Message response); 1771 1772 /** 1773 * Send Flash Code. 1774 * "response" is is NULL 1775 * [0] is a FLASH string 1776 */ sendCDMAFeatureCode(String FeatureCode, Message response)1777 public void sendCDMAFeatureCode(String FeatureCode, Message response); 1778 1779 /** Set the Phone type created */ 1780 @UnsupportedAppUsage setPhoneType(int phoneType)1781 void setPhoneType(int phoneType); 1782 1783 /** 1784 * Query the CDMA roaming preference setting 1785 * 1786 * @param response is callback message to report one of CDMA_RM_* 1787 */ queryCdmaRoamingPreference(Message response)1788 void queryCdmaRoamingPreference(Message response); 1789 1790 /** 1791 * Requests to set the CDMA roaming preference 1792 * @param cdmaRoamingType one of CDMA_RM_* 1793 * @param response is callback message 1794 */ setCdmaRoamingPreference(int cdmaRoamingType, Message response)1795 void setCdmaRoamingPreference(int cdmaRoamingType, Message response); 1796 1797 /** 1798 * Requests to set the CDMA subscription mode 1799 * @param cdmaSubscriptionType one of CDMA_SUBSCRIPTION_* 1800 * @param response is callback message 1801 */ setCdmaSubscriptionSource(int cdmaSubscriptionType, Message response)1802 void setCdmaSubscriptionSource(int cdmaSubscriptionType, Message response); 1803 1804 /** 1805 * Requests to get the CDMA subscription srouce 1806 * @param response is callback message 1807 */ getCdmaSubscriptionSource(Message response)1808 void getCdmaSubscriptionSource(Message response); 1809 1810 /** 1811 * Set the TTY mode 1812 * 1813 * @param ttyMode one of the following: 1814 * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF} 1815 * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL} 1816 * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO} 1817 * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO} 1818 * @param response is callback message 1819 */ 1820 @UnsupportedAppUsage setTTYMode(int ttyMode, Message response)1821 void setTTYMode(int ttyMode, Message response); 1822 1823 /** 1824 * Query the TTY mode 1825 * (AsyncResult)response.obj).result is an int[] with element [0] set to 1826 * tty mode: 1827 * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF} 1828 * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL} 1829 * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO} 1830 * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO} 1831 * @param response is callback message 1832 */ 1833 @UnsupportedAppUsage queryTTYMode(Message response)1834 void queryTTYMode(Message response); 1835 1836 /** 1837 * Setup a packet data connection On successful completion, the result 1838 * message will return a SetupDataResult object containing the connection information. 1839 * 1840 * @param accessNetworkType 1841 * Access network to use. Values is one of AccessNetworkConstants.AccessNetworkType. 1842 * @param dataProfile 1843 * Data profile for data call setup 1844 * @param isRoaming 1845 * Device is roaming or not 1846 * @param allowRoaming 1847 * Flag indicating data roaming is enabled or not 1848 * @param reason 1849 * The reason for data setup 1850 * @param linkProperties 1851 * If the reason is for handover, this indicates the link properties of the existing 1852 * data connection 1853 * @param pduSessionId the pdu session id to be used for this data call. 1854 * The standard range of values are 1-15 while 0 means no pdu session id was attached 1855 * to this call. Reference: 3GPP TS 24.007 section 11.2.3.1b. 1856 * @param sliceInfo used within the data connection when a handover occurs from EPDG to 5G. 1857 * The value is null unless the access network is 1858 * {@link android.telephony.AccessNetworkConstants.AccessNetworkType#NGRAN} and a 1859 * handover is occurring from EPDG to 5G. If the slice passed is rejected, then 1860 * {@link DataCallResponse#getCause()} is 1861 * {@link android.telephony.DataFailCause#SLICE_REJECTED}. 1862 * @param trafficDescriptor TrafficDescriptor for which data connection needs to be established. 1863 * It is used for URSP traffic matching as described in 3GPP TS 24.526 Section 4.2.2. 1864 * It includes an optional DNN which, if present, must be used for traffic matching; 1865 * it does not specify the end point to be used for the data call. 1866 * @param matchAllRuleAllowed indicates if using default match-all URSP rule for this request is 1867 * allowed. If false, this request must not use the match-all URSP rule and if a 1868 * non-match-all rule is not found (or if URSP rules are not available) then 1869 * {@link DataCallResponse#getCause()} is 1870 * {@link android.telephony.DataFailCause#MATCH_ALL_RULE_NOT_ALLOWED}. This is needed 1871 * as some requests need to have a hard failure if the intention cannot be met, 1872 * for example, a zero-rating slice. 1873 * @param result 1874 * Callback message 1875 */ setupDataCall(int accessNetworkType, DataProfile dataProfile, boolean isRoaming, boolean allowRoaming, int reason, LinkProperties linkProperties, int pduSessionId, NetworkSliceInfo sliceInfo, TrafficDescriptor trafficDescriptor, boolean matchAllRuleAllowed, Message result)1876 void setupDataCall(int accessNetworkType, DataProfile dataProfile, boolean isRoaming, 1877 boolean allowRoaming, int reason, LinkProperties linkProperties, int pduSessionId, 1878 NetworkSliceInfo sliceInfo, TrafficDescriptor trafficDescriptor, 1879 boolean matchAllRuleAllowed, Message result); 1880 1881 /** 1882 * Deactivate packet data connection 1883 * 1884 * @param cid 1885 * The connection ID 1886 * @param reason 1887 * Data disconnect reason. 1888 * @param result 1889 * Callback message is empty on completion 1890 */ deactivateDataCall(int cid, int reason, Message result)1891 public void deactivateDataCall(int cid, int reason, Message result); 1892 1893 /** 1894 * Activate or deactivate cell broadcast SMS for CDMA. 1895 * 1896 * @param activate 1897 * true = activate, false = deactivate 1898 * @param result 1899 * Callback message is empty on completion 1900 */ 1901 @UnsupportedAppUsage setCdmaBroadcastActivation(boolean activate, Message result)1902 public void setCdmaBroadcastActivation(boolean activate, Message result); 1903 1904 /** 1905 * Configure cdma cell broadcast SMS. 1906 * 1907 * @param response 1908 * Callback message is empty on completion 1909 */ setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response)1910 public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response); 1911 1912 /** 1913 * Query the current configuration of cdma cell broadcast SMS. 1914 * 1915 * @param result 1916 * Callback message contains the configuration from the modem on completion 1917 */ 1918 @UnsupportedAppUsage getCdmaBroadcastConfig(Message result)1919 public void getCdmaBroadcastConfig(Message result); 1920 1921 /** 1922 * Requests the radio's system selection module to exit emergency callback mode. 1923 * This function should only be called from for CDMA. 1924 * 1925 * @param response callback message 1926 */ 1927 @UnsupportedAppUsage exitEmergencyCallbackMode(Message response)1928 public void exitEmergencyCallbackMode(Message response); 1929 1930 /** 1931 * Request the status of the ICC and UICC cards. 1932 * 1933 * @param result 1934 * Callback message containing {@link IccCardStatus} structure for the card. 1935 */ 1936 @UnsupportedAppUsage getIccCardStatus(Message result)1937 public void getIccCardStatus(Message result); 1938 1939 /** 1940 * Request the status of all the physical UICC slots. 1941 * 1942 * @param result Callback message containing a {@link java.util.ArrayList} of 1943 * {@link com.android.internal.telephony.uicc.IccSlotStatus} instances for all the slots. 1944 */ getIccSlotsStatus(Message result)1945 void getIccSlotsStatus(Message result); 1946 1947 /** 1948 * Set the mapping from logical slots to physical slots. 1949 * 1950 * @param physicalSlots Mapping from logical slots to physical slots. 1951 * @param result Callback message is empty on completion. 1952 */ setLogicalToPhysicalSlotMapping(int[] physicalSlots, Message result)1953 void setLogicalToPhysicalSlotMapping(int[] physicalSlots, Message result); 1954 1955 /** 1956 * Request the SIM application on the UICC to perform authentication 1957 * challenge/response algorithm. The data string and challenge response are 1958 * Base64 encoded Strings. 1959 * Can support EAP-SIM, EAP-AKA with results encoded per 3GPP TS 31.102. 1960 * 1961 * @param authContext is the P2 parameter that specifies the authentication context per 3GPP TS 1962 * 31.102 (Section 7.1.2) 1963 * @param data authentication challenge data 1964 * @param aid used to determine which application/slot to send the auth command to. See ETSI 1965 * 102.221 8.1 and 101.220 4 1966 * @param response a callback message with the String response in the obj field 1967 */ 1968 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) requestIccSimAuthentication(int authContext, String data, String aid, Message response)1969 public void requestIccSimAuthentication(int authContext, String data, String aid, Message response); 1970 1971 /** 1972 * Get the current Voice Radio Technology. 1973 * 1974 * AsyncResult.result is an int array with the first value 1975 * being one of the ServiceState.RIL_RADIO_TECHNOLOGY_xxx values. 1976 * 1977 * @param result is sent back to handler and result.obj is a AsyncResult 1978 */ getVoiceRadioTechnology(Message result)1979 void getVoiceRadioTechnology(Message result); 1980 1981 /** 1982 * Return the current set of CellInfo records 1983 * 1984 * AsyncResult.result is a of Collection<CellInfo> 1985 * 1986 * @param result is sent back to handler and result.obj is a AsyncResult 1987 * @param workSource calling WorkSource 1988 */ getCellInfoList(Message result, WorkSource workSource)1989 default void getCellInfoList(Message result, WorkSource workSource) {} 1990 1991 /** 1992 * Sets the minimum time in milli-seconds between when RIL_UNSOL_CELL_INFO_LIST 1993 * should be invoked. 1994 * 1995 * The default, 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported 1996 * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue 1997 * A RIL_UNSOL_CELL_INFO_LIST. 1998 * 1999 * 2000 2001 * @param rateInMillis is sent back to handler and result.obj is a AsyncResult 2002 * @param response.obj is AsyncResult ar when sent to associated handler 2003 * ar.exception carries exception on failure or null on success 2004 * otherwise the error. 2005 * @param workSource calling WorkSource 2006 */ setCellInfoListRate(int rateInMillis, Message response, WorkSource workSource)2007 default void setCellInfoListRate(int rateInMillis, Message response, WorkSource workSource){} 2008 2009 /** 2010 * Fires when RIL_UNSOL_CELL_INFO_LIST is received from the RIL. 2011 */ 2012 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) registerForCellInfoList(Handler h, int what, Object obj)2013 void registerForCellInfoList(Handler h, int what, Object obj); unregisterForCellInfoList(Handler h)2014 void unregisterForCellInfoList(Handler h); 2015 2016 /** 2017 * Fires when a new {@link android.telephony.PhysicalChannelConfig} list is received from the 2018 * RIL. 2019 */ registerForPhysicalChannelConfiguration(Handler h, int what, Object obj)2020 void registerForPhysicalChannelConfiguration(Handler h, int what, Object obj); 2021 2022 /** 2023 * Unregisters the handler for {@link android.telephony.PhysicalChannelConfig} updates. 2024 */ unregisterForPhysicalChannelConfiguration(Handler h)2025 void unregisterForPhysicalChannelConfiguration(Handler h); 2026 2027 /** 2028 * Set Initial Attach Apn 2029 * 2030 * @param dataProfile 2031 * data profile for initial APN attach 2032 * @param isRoaming 2033 * indicating the device is roaming or not 2034 * @param result 2035 * callback message contains the information of SUCCESS/FAILURE 2036 */ setInitialAttachApn(DataProfile dataProfile, boolean isRoaming, Message result)2037 void setInitialAttachApn(DataProfile dataProfile, boolean isRoaming, Message result); 2038 2039 /** 2040 * Set data profiles in modem 2041 * 2042 * @param dps 2043 * Array of the data profiles set to modem 2044 * @param isRoaming 2045 * Indicating if the device is roaming or not 2046 * @param result 2047 * callback message contains the information of SUCCESS/FAILURE 2048 */ setDataProfile(DataProfile[] dps, boolean isRoaming, Message result)2049 void setDataProfile(DataProfile[] dps, boolean isRoaming, Message result); 2050 2051 /** 2052 * Notifiy that we are testing an emergency call 2053 */ testingEmergencyCall()2054 public void testingEmergencyCall(); 2055 2056 /** 2057 * Open a logical channel to the SIM. 2058 * 2059 * Input parameters equivalent to TS 27.007 AT+CCHO command. 2060 * 2061 * @param AID Application id. See ETSI 102.221 and 101.220. 2062 * @param p2 P2 parameter (described in ISO 7816-4). 2063 * @param response Callback message. response.obj will be an int [1] with 2064 * element [0] set to the id of the logical channel. 2065 */ iccOpenLogicalChannel(String AID, int p2, Message response)2066 public void iccOpenLogicalChannel(String AID, int p2, Message response); 2067 2068 /** 2069 * Close a previously opened logical channel to the SIM. 2070 * 2071 * Input parameters equivalent to TS 27.007 AT+CCHC command. 2072 * 2073 * @param channel Channel id. Id of the channel to be closed. 2074 * @param response Callback message. 2075 */ iccCloseLogicalChannel(int channel, Message response)2076 public void iccCloseLogicalChannel(int channel, Message response); 2077 2078 /** 2079 * Exchange APDUs with the SIM on a logical channel. 2080 * 2081 * Input parameters equivalent to TS 27.007 AT+CGLA command. 2082 * 2083 * @param channel Channel id of the channel to use for communication. Has to 2084 * be greater than zero. 2085 * @param cla Class of the APDU command. 2086 * @param instruction Instruction of the APDU command. 2087 * @param p1 P1 value of the APDU command. 2088 * @param p2 P2 value of the APDU command. 2089 * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU 2090 * is sent to the SIM. 2091 * @param data Data to be sent with the APDU. 2092 * @param response Callback message. response.obj.userObj will be 2093 * an IccIoResult on success. 2094 */ iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message response)2095 public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, 2096 int p1, int p2, int p3, String data, Message response); 2097 2098 /** 2099 * Exchange APDUs with the SIM on a basic channel. 2100 * 2101 * Input parameters equivalent to TS 27.007 AT+CSIM command. 2102 * 2103 * @param cla Class of the APDU command. 2104 * @param instruction Instruction of the APDU command. 2105 * @param p1 P1 value of the APDU command. 2106 * @param p2 P2 value of the APDU command. 2107 * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU 2108 * is sent to the SIM. 2109 * @param data Data to be sent with the APDU. 2110 * @param response Callback message. response.obj.userObj will be 2111 * an IccIoResult on success. 2112 */ iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data, Message response)2113 public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, 2114 int p3, String data, Message response); 2115 2116 /** 2117 * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}. 2118 * Used for device configuration by some CDMA operators. 2119 * 2120 * @param itemID the ID of the item to read 2121 * @param response callback message with the String response in the obj field 2122 * @param workSource calling WorkSource 2123 */ nvReadItem(int itemID, Message response, WorkSource workSource)2124 default void nvReadItem(int itemID, Message response, WorkSource workSource) {} 2125 2126 /** 2127 * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}. 2128 * Used for device configuration by some CDMA operators. 2129 * 2130 * @param itemID the ID of the item to read 2131 * @param itemValue the value to write, as a String 2132 * @param response Callback message. 2133 * @param workSource calling WorkSource 2134 */ nvWriteItem(int itemID, String itemValue, Message response, WorkSource workSource)2135 default void nvWriteItem(int itemID, String itemValue, Message response, 2136 WorkSource workSource) {} 2137 2138 /** 2139 * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage. 2140 * Used for device configuration by some CDMA operators. 2141 * 2142 * @param preferredRoamingList byte array containing the new PRL 2143 * @param response Callback message. 2144 */ nvWriteCdmaPrl(byte[] preferredRoamingList, Message response)2145 void nvWriteCdmaPrl(byte[] preferredRoamingList, Message response); 2146 2147 /** 2148 * Perform the specified type of NV config reset. The radio will be taken offline 2149 * and the device must be rebooted after erasing the NV. Used for device 2150 * configuration by some CDMA operators. 2151 * 2152 * @param resetType reset type: 1: reload NV reset, 2: erase NV reset, 3: factory NV reset 2153 * @param response Callback message. 2154 */ nvResetConfig(int resetType, Message response)2155 void nvResetConfig(int resetType, Message response); 2156 2157 /** 2158 * returned message 2159 * retMsg.obj = AsyncResult ar 2160 * ar.exception carries exception on failure 2161 * ar.userObject contains the orignal value of result.obj 2162 * ar.result contains a List of HardwareConfig 2163 */ getHardwareConfig(Message result)2164 void getHardwareConfig (Message result); 2165 2166 /** 2167 * @return version of the ril. 2168 */ getRilVersion()2169 int getRilVersion(); 2170 2171 /** 2172 * @return the radio hal version 2173 */ getHalVersion()2174 default HalVersion getHalVersion() { 2175 return HalVersion.UNKNOWN; 2176 } 2177 2178 /** 2179 * Sets user selected subscription at Modem. 2180 * 2181 * @param slotId 2182 * Slot. 2183 * @param appIndex 2184 * Application index in the card. 2185 * @param subId 2186 * Indicates subscription 0 or subscription 1. 2187 * @param subStatus 2188 * Activation status, 1 = activate and 0 = deactivate. 2189 * @param result 2190 * Callback message contains the information of SUCCESS/FAILURE. 2191 */ 2192 // FIXME Update the doc and consider modifying the request to make more generic. 2193 @UnsupportedAppUsage setUiccSubscription(int slotId, int appIndex, int subId, int subStatus, Message result)2194 public void setUiccSubscription(int slotId, int appIndex, int subId, int subStatus, 2195 Message result); 2196 2197 /** 2198 * Tells the modem if data is allowed or not. 2199 * 2200 * @param allowed 2201 * true = allowed, false = not alowed 2202 * @param result 2203 * Callback message contains the information of SUCCESS/FAILURE. 2204 */ 2205 // FIXME We may need to pass AID and slotid also 2206 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) setDataAllowed(boolean allowed, Message result)2207 public void setDataAllowed(boolean allowed, Message result); 2208 2209 /** 2210 * Inform RIL that the device is shutting down 2211 * 2212 * @param result Callback message contains the information of SUCCESS/FAILURE 2213 */ 2214 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) requestShutdown(Message result)2215 public void requestShutdown(Message result); 2216 2217 /** 2218 * Set phone radio type and access technology. 2219 * 2220 * @param rc the phone radio capability defined in 2221 * RadioCapability. It's a input object used to transfer parameter to logic modem 2222 * 2223 * @param result Callback message. 2224 */ setRadioCapability(RadioCapability rc, Message result)2225 public void setRadioCapability(RadioCapability rc, Message result); 2226 2227 /** 2228 * Get phone radio capability 2229 * 2230 * @param result Callback message. 2231 */ getRadioCapability(Message result)2232 public void getRadioCapability(Message result); 2233 2234 /** 2235 * Registers the handler when phone radio capability is changed. 2236 * 2237 * @param h Handler for notification message. 2238 * @param what User-defined message code. 2239 * @param obj User object. 2240 */ registerForRadioCapabilityChanged(Handler h, int what, Object obj)2241 public void registerForRadioCapabilityChanged(Handler h, int what, Object obj); 2242 2243 /** 2244 * Unregister for notifications when phone radio capability is changed. 2245 * 2246 * @param h Handler to be removed from the registrant list. 2247 */ unregisterForRadioCapabilityChanged(Handler h)2248 public void unregisterForRadioCapabilityChanged(Handler h); 2249 2250 /** 2251 * Start LCE (Link Capacity Estimation) service with a desired reporting interval. 2252 * 2253 * @param reportIntervalMs 2254 * LCE info reporting interval (ms). 2255 * 2256 * @param result Callback message contains the current LCE status. 2257 * {byte status, int actualIntervalMs} 2258 */ startLceService(int reportIntervalMs, boolean pullMode, Message result)2259 public void startLceService(int reportIntervalMs, boolean pullMode, Message result); 2260 2261 /** 2262 * Stop LCE service. 2263 * 2264 * @param result Callback message contains the current LCE status: 2265 * {byte status, int actualIntervalMs} 2266 * 2267 */ stopLceService(Message result)2268 public void stopLceService(Message result); 2269 2270 /** 2271 * Pull LCE service for capacity data. 2272 * 2273 * @param result Callback message contains the capacity info: 2274 * {int capacityKbps, byte confidenceLevel, byte lceSuspendedTemporarily} 2275 */ pullLceData(Message result)2276 public void pullLceData(Message result); 2277 2278 /** 2279 * Register a LCE info listener. 2280 * 2281 * @param h Handler for notification message. 2282 * @param what User-defined message code. 2283 * @param obj User object. 2284 */ registerForLceInfo(Handler h, int what, Object obj)2285 void registerForLceInfo(Handler h, int what, Object obj); 2286 2287 /** 2288 * Unregister the LCE Info listener. 2289 * 2290 * @param h handle to be removed. 2291 */ unregisterForLceInfo(Handler h)2292 void unregisterForLceInfo(Handler h); 2293 2294 /** 2295 * 2296 * Get modem activity info and stats 2297 * 2298 * @param result Callback message contains the modem activity information 2299 * @param workSource calling WorkSource 2300 */ getModemActivityInfo(Message result, WorkSource workSource)2301 default void getModemActivityInfo(Message result, WorkSource workSource) {} 2302 2303 /** 2304 * Set allowed carriers 2305 * 2306 * @param carriers Allowed carriers 2307 * @param result Callback message contains the result of the operation 2308 * @param workSource calling WorkSource 2309 */ setAllowedCarriers(CarrierRestrictionRules carrierRestrictionRules, Message result, WorkSource workSource)2310 default void setAllowedCarriers(CarrierRestrictionRules carrierRestrictionRules, 2311 Message result, WorkSource workSource) {} 2312 2313 /** 2314 * Get allowed carriers 2315 * 2316 * @param result Callback message contains the allowed carriers 2317 * @param workSource calling WorkSource 2318 */ getAllowedCarriers(Message result, WorkSource workSource)2319 default void getAllowedCarriers(Message result, WorkSource workSource) {} 2320 2321 /** 2322 * Register for unsolicited PCO data. This information is carrier-specific, 2323 * opaque binary blobs destined for carrier apps for interpretation. 2324 * 2325 * @param h Handler for notification message. 2326 * @param what User-defined message code. 2327 * @param obj User object. 2328 */ registerForPcoData(Handler h, int what, Object obj)2329 public void registerForPcoData(Handler h, int what, Object obj); 2330 2331 /** 2332 * Unregister for PCO data. 2333 * 2334 * @param h handler to be removed 2335 */ unregisterForPcoData(Handler h)2336 public void unregisterForPcoData(Handler h); 2337 2338 /** 2339 * Register for modem reset indication. 2340 * 2341 * @param h Handler for the notification message 2342 * @param what User-defined message code 2343 * @param obj User object 2344 */ registerForModemReset(Handler h, int what, Object obj)2345 void registerForModemReset(Handler h, int what, Object obj); 2346 2347 /** 2348 * Unregister for modem reset 2349 * 2350 * @param h handler to be removed 2351 */ unregisterForModemReset(Handler h)2352 void unregisterForModemReset(Handler h); 2353 2354 /** 2355 * Send the updated device state 2356 * 2357 * @param stateType Device state type 2358 * @param state True if enabled, otherwise disabled 2359 * @param result callback message contains the information of SUCCESS/FAILURE 2360 */ sendDeviceState(int stateType, boolean state, Message result)2361 void sendDeviceState(int stateType, boolean state, Message result); 2362 2363 /** 2364 * Send the device state to the modem 2365 * 2366 * @param filter unsolicited response filter. See DeviceStateMonitor.UnsolicitedResponseFilter 2367 * @param result callback message contains the information of SUCCESS/FAILURE 2368 */ setUnsolResponseFilter(int filter, Message result)2369 void setUnsolResponseFilter(int filter, Message result); 2370 2371 /** 2372 * Sets the signal strength reporting criteria. 2373 * 2374 * The resulting reporting rules are the AND of all the supplied criteria. For each RAN 2375 * The hysteresisDb and thresholds apply to only the following measured quantities: 2376 * -GERAN - RSSI 2377 * -CDMA2000 - RSSI 2378 * -UTRAN - RSCP 2379 * -EUTRAN - RSRP/RSRQ/RSSNR 2380 * -NGRAN - SSRSRP/SSRSRQ/SSSINR 2381 * 2382 * Note: Reporting criteria must be individually set for each RAN. For any unset reporting 2383 * criteria, the value is implementation-defined. 2384 * 2385 * Response callback is 2386 * IRadioResponse.setSignalStrengthReportingCriteriaResponse_1_5() 2387 * 2388 * @param signalThresholdInfo Signal threshold info including the threshold values, 2389 * hysteresisDb, and hysteresisMs. See @1.5::SignalThresholdInfo 2390 * for details. 2391 * @param ran The type of network for which to apply these thresholds. 2392 * @param result callback message contains the information of SUCCESS/FAILURE 2393 */ setSignalStrengthReportingCriteria(SignalThresholdInfo signalThresholdInfo, int ran, Message result)2394 void setSignalStrengthReportingCriteria(SignalThresholdInfo signalThresholdInfo, int ran, 2395 Message result); 2396 2397 /** 2398 * Send the link capacity reporting criteria to the modem 2399 * 2400 * @param hysteresisMs A hysteresis time in milliseconds. A value of 0 disables hysteresis. 2401 * @param hysteresisDlKbps An interval in kbps defining the required magnitude change between DL 2402 * reports. A value of 0 disables hysteresis. 2403 * @param hysteresisUlKbps An interval in kbps defining the required magnitude change between UL 2404 * reports. A value of 0 disables hysteresis. 2405 * @param thresholdsDlKbps An array of trigger thresholds in kbps for downlink reports. A size 2406 * of 0 disables thresholds. 2407 * @param thresholdsUlKbps An array of trigger thresholds in kbps for uplink reports. A size 2408 * of 0 disables thresholds. 2409 * @param ran RadioAccessNetwork for which to apply criteria. 2410 * @param result callback message contains the information of SUCCESS/FAILURE 2411 */ setLinkCapacityReportingCriteria(int hysteresisMs, int hysteresisDlKbps, int hysteresisUlKbps, int[] thresholdsDlKbps, int[] thresholdsUlKbps, int ran, Message result)2412 void setLinkCapacityReportingCriteria(int hysteresisMs, int hysteresisDlKbps, 2413 int hysteresisUlKbps, int[] thresholdsDlKbps, int[] thresholdsUlKbps, int ran, 2414 Message result); 2415 2416 /** 2417 * Set SIM card power up or down 2418 * 2419 * @param state State of SIM (power down, power up, pass through) 2420 * - {@link android.telephony.TelephonyManager#CARD_POWER_DOWN} 2421 * - {@link android.telephony.TelephonyManager#CARD_POWER_UP} 2422 * - {@link android.telephony.TelephonyManager#CARD_POWER_UP_PASS_THROUGH} 2423 * @param result callback message contains the information of SUCCESS/FAILURE 2424 * @param workSource calling WorkSource 2425 */ setSimCardPower(int state, Message result, WorkSource workSource)2426 default void setSimCardPower(int state, Message result, WorkSource workSource) {} 2427 2428 /** 2429 * Register for unsolicited Carrier Public Key. 2430 * 2431 * @param h Handler for notification message. 2432 * @param what User-defined message code. 2433 * @param obj User object. 2434 */ registerForCarrierInfoForImsiEncryption(Handler h, int what, Object obj)2435 void registerForCarrierInfoForImsiEncryption(Handler h, int what, Object obj); 2436 2437 /** 2438 * DeRegister for unsolicited Carrier Public Key. 2439 * 2440 * @param h Handler for notification message. 2441 */ unregisterForCarrierInfoForImsiEncryption(Handler h)2442 void unregisterForCarrierInfoForImsiEncryption(Handler h); 2443 2444 /** 2445 * Register for unsolicited Network Scan result. 2446 * 2447 * @param h Handler for notification message. 2448 * @param what User-defined message code. 2449 * @param obj User object. 2450 */ registerForNetworkScanResult(Handler h, int what, Object obj)2451 void registerForNetworkScanResult(Handler h, int what, Object obj); 2452 2453 /** 2454 * DeRegister for unsolicited Network Scan result. 2455 * 2456 * @param h Handler for notification message. 2457 */ unregisterForNetworkScanResult(Handler h)2458 void unregisterForNetworkScanResult(Handler h); 2459 2460 /** 2461 * Register for unsolicited NATT Keepalive Status Indications 2462 * 2463 * @param h Handler for notification message. 2464 * @param what User-defined message code. 2465 * @param obj User object. 2466 */ registerForNattKeepaliveStatus(Handler h, int what, Object obj)2467 void registerForNattKeepaliveStatus(Handler h, int what, Object obj); 2468 2469 /** 2470 * Deregister for unsolicited NATT Keepalive Status Indications. 2471 * 2472 * @param h Handler for notification message. 2473 */ unregisterForNattKeepaliveStatus(Handler h)2474 void unregisterForNattKeepaliveStatus(Handler h); 2475 2476 /** 2477 * Register for unsolicited Emergency Number List Indications 2478 * 2479 * @param h Handler for notification message. 2480 * @param what User-defined message code. 2481 * @param obj User object. 2482 */ registerForEmergencyNumberList(Handler h, int what, Object obj)2483 void registerForEmergencyNumberList(Handler h, int what, Object obj); 2484 2485 /** 2486 * Deregister for unsolicited Emergency Number List Indications 2487 * 2488 * @param h Handler for notification message. 2489 */ unregisterForEmergencyNumberList(Handler h)2490 void unregisterForEmergencyNumberList(Handler h); 2491 2492 /** 2493 * Start sending NATT Keepalive packets on a specified data connection 2494 * 2495 * @param contextId cid that identifies the data connection for this keepalive 2496 * @param packetData the keepalive packet data description 2497 * @param intervalMillis a time interval in ms between keepalive packet transmissions 2498 * @param result a Message to return to the requester 2499 */ startNattKeepalive( int contextId, KeepalivePacketData packetData, int intervalMillis, Message result)2500 void startNattKeepalive( 2501 int contextId, KeepalivePacketData packetData, int intervalMillis, Message result); 2502 2503 /** 2504 * Stop sending NATT Keepalive packets on a specified data connection 2505 * 2506 * @param sessionHandle the keepalive session handle (from the modem) to stop 2507 * @param result a Message to return to the requester 2508 */ stopNattKeepalive(int sessionHandle, Message result)2509 void stopNattKeepalive(int sessionHandle, Message result); 2510 2511 /** 2512 * Enable or disable the logical modem. 2513 * 2514 * @param enable whether to enable or disable the modem 2515 * @param result a Message to return to the requester 2516 */ enableModem(boolean enable, Message result)2517 default void enableModem(boolean enable, Message result) {}; 2518 2519 /** 2520 * Notify CommandsInterface that whether its corresponding slot is active or not. If not, 2521 * it means it has no RIL service or logical modem to connect to. 2522 * 2523 * @param active whether there's a matching active SIM slot. 2524 */ onSlotActiveStatusChange(boolean active)2525 default void onSlotActiveStatusChange(boolean active) {} 2526 2527 /** 2528 * Query whether logical modem is enabled or disabled 2529 * 2530 * @param result a Message to return to the requester 2531 */ getModemStatus(Message result)2532 default void getModemStatus(Message result) {}; 2533 2534 /** 2535 * Enable or disable uicc applications on the SIM. 2536 * 2537 * @param enable enable or disable UiccApplications on the SIM. 2538 * @param onCompleteMessage a Message to return to the requester 2539 */ enableUiccApplications(boolean enable, Message onCompleteMessage)2540 default void enableUiccApplications(boolean enable, Message onCompleteMessage) {} 2541 2542 /** 2543 * Specify which bands modem's background scan must act on. 2544 * If {@code specifiers} is non-empty, the scan will be restricted to the bands specified. 2545 * Otherwise, it scans all bands. 2546 * 2547 * For example, CBRS is only on LTE band 48. By specifying this band, 2548 * modem saves more power. 2549 * 2550 * @param specifiers which bands to scan. 2551 * @param onComplete a message to send when complete. 2552 */ setSystemSelectionChannels(@onNull List<RadioAccessSpecifier> specifiers, Message onComplete)2553 default void setSystemSelectionChannels(@NonNull List<RadioAccessSpecifier> specifiers, 2554 Message onComplete) {} 2555 2556 /** 2557 * Get which bands the modem's background scan is acting on. 2558 * 2559 * @param onComplete a message to send when complete. 2560 */ getSystemSelectionChannels(Message onComplete)2561 default void getSystemSelectionChannels(Message onComplete) {} 2562 2563 /** 2564 * Whether uicc applications are enabled or not. 2565 * 2566 * @param onCompleteMessage a Message to return to the requester 2567 */ areUiccApplicationsEnabled(Message onCompleteMessage)2568 default void areUiccApplicationsEnabled(Message onCompleteMessage) {} 2569 2570 /** 2571 * Whether {@link #enableUiccApplications} is supported, based on IRadio version. 2572 */ canToggleUiccApplicationsEnablement()2573 default boolean canToggleUiccApplicationsEnablement() { 2574 return false; 2575 } 2576 getClientRequestStats()2577 default List<ClientRequestStats> getClientRequestStats() { 2578 return null; 2579 } 2580 2581 /** 2582 * Registers the handler for RIL_UNSOL_BARRING_INFO_CHANGED events. 2583 * 2584 * @param h Handler for notification message. 2585 * @param what User-defined message code. 2586 * @param obj User object. 2587 */ registerForBarringInfoChanged(Handler h, int what, Object obj)2588 default void registerForBarringInfoChanged(Handler h, int what, Object obj) {}; 2589 2590 /** 2591 * Unregisters the handler for RIL_UNSOL_BARRING_INFO_CHANGED events. 2592 * 2593 * @param h Handler for notification message. 2594 */ unregisterForBarringInfoChanged(Handler h)2595 default void unregisterForBarringInfoChanged(Handler h) {}; 2596 2597 /** 2598 * Get all the barring info for the current camped cell applicable to the current user. 2599 * 2600 * AsyncResult.result is the object of {@link android.telephony.BarringInfo}. 2601 * 2602 * @param result Message will be sent back to handler and result.obj will be the AsycResult. 2603 */ getBarringInfo(Message result)2604 default void getBarringInfo(Message result) {}; 2605 2606 /** 2607 * Allocates a pdu session id 2608 * 2609 * AsyncResult.result is the allocated pdu session id 2610 * 2611 * @param result Message will be sent back to handler and result.obj will be the AsycResult. 2612 * 2613 */ allocatePduSessionId(Message result)2614 default void allocatePduSessionId(Message result) {}; 2615 2616 /** 2617 * Release the pdu session id 2618 * 2619 * @param result Message that will be sent back to handler. 2620 * @param pduSessionId The id that was allocated and should now be released. 2621 * 2622 */ releasePduSessionId(Message result, int pduSessionId)2623 default void releasePduSessionId(Message result, int pduSessionId) {}; 2624 2625 /** 2626 * Indicates that a handover has started 2627 * 2628 * @param result Message that will be sent back to handler. 2629 * @param callId Identifier associated with the data call 2630 */ startHandover(Message result, int callId)2631 default void startHandover(Message result, int callId) {}; 2632 2633 /** 2634 * Indicates that a handover has been cancelled 2635 * 2636 * @param result Message that will be sent back to handler. 2637 * @param callId Identifier associated with the data call 2638 */ cancelHandover(Message result, int callId)2639 default void cancelHandover(Message result, int callId) {}; 2640 2641 /** 2642 * Control the data throttling at modem. 2643 * 2644 * @param result Message that will be sent back to the requester 2645 * @param workSource calling Worksource 2646 * @param dataThrottlingAction the DataThrottlingAction that is being requested. 2647 * Defined in android.hardware.radio@1.6.types. 2648 * @param completionWindowMillis milliseconds in which data throttling action has to be 2649 * achieved. 2650 */ setDataThrottling(Message result, WorkSource workSource, int dataThrottlingAction, long completionWindowMillis)2651 default void setDataThrottling(Message result, WorkSource workSource, 2652 int dataThrottlingAction, long completionWindowMillis) {}; 2653 2654 /** 2655 * Request to get the current slicing configuration including URSP rules and 2656 * NSSAIs (configured, allowed and rejected). 2657 * 2658 * @param result Message that will be sent back to handler. 2659 */ getSlicingConfig(Message result)2660 default void getSlicingConfig(Message result) {}; 2661 2662 /** 2663 * Request the SIM phonebook records of all activated UICC applications 2664 * 2665 * @param result Callback message containing the count of ADN valid record. 2666 */ getSimPhonebookRecords(Message result)2667 public void getSimPhonebookRecords(Message result); 2668 2669 /** 2670 * Request the SIM phonebook Capacity of all activated UICC applications 2671 * 2672 */ getSimPhonebookCapacity(Message result)2673 public void getSimPhonebookCapacity(Message result); 2674 2675 /** 2676 * Request to insert/delete/update the SIM phonebook record 2677 * 2678 * @param phonebookRecordInfo adn record information to be updated 2679 * @param result Callback message containing the SIM phonebook record index. 2680 */ updateSimPhonebookRecord(SimPhonebookRecord phonebookRecordInfo, Message result)2681 public void updateSimPhonebookRecord(SimPhonebookRecord phonebookRecordInfo, Message result); 2682 2683 /** 2684 * Registers the handler when the SIM phonebook is changed. 2685 * 2686 * @param h Handler for notification message. 2687 * @param what User-defined message code. 2688 * @param obj User object . 2689 */ registerForSimPhonebookChanged(Handler h, int what, Object obj)2690 public void registerForSimPhonebookChanged(Handler h, int what, Object obj); 2691 2692 /** 2693 * Unregister for notifications when SIM phonebook has already init done. 2694 * 2695 * @param h Handler to be removed from the registrant list. 2696 */ unregisterForSimPhonebookChanged(Handler h)2697 public void unregisterForSimPhonebookChanged(Handler h); 2698 2699 /** 2700 * Registers the handler when a group of SIM phonebook records received. 2701 * 2702 * @param h Handler for notification message. 2703 * @param what User-defined message code. 2704 * @param obj User object. 2705 */ registerForSimPhonebookRecordsReceived(Handler h, int what, Object obj)2706 public void registerForSimPhonebookRecordsReceived(Handler h, int what, Object obj); 2707 2708 /** 2709 * Unregister for notifications when a group of SIM phonebook records received. 2710 * 2711 * @param h Handler to be removed from the registrant list. 2712 */ unregisterForSimPhonebookRecordsReceived(Handler h)2713 public void unregisterForSimPhonebookRecordsReceived(Handler h); 2714 } 2715