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