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