ITelephony.aidl revision dc50a87495c23068b4150a0fc197e51ace2ae47b
1/*
2 * Copyright (C) 2007 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.content.Intent;
20import android.os.Bundle;
21import android.net.Uri;
22import android.telecom.PhoneAccount;
23import android.telecom.PhoneAccountHandle;
24import android.telephony.CellInfo;
25import android.telephony.IccOpenLogicalChannelResponse;
26import android.telephony.ModemActivityInfo;
27import android.telephony.NeighboringCellInfo;
28import android.telephony.RadioAccessFamily;
29import android.telephony.ServiceState;
30import com.android.internal.telephony.CellNetworkScanResult;
31import com.android.internal.telephony.OperatorInfo;
32import java.util.List;
33
34
35/**
36 * Interface used to interact with the phone.  Mostly this is used by the
37 * TelephonyManager class.  A few places are still using this directly.
38 * Please clean them up if possible and use TelephonyManager instead.
39 *
40 * {@hide}
41 */
42interface ITelephony {
43
44    /**
45     * Dial a number. This doesn't place the call. It displays
46     * the Dialer screen.
47     * @param number the number to be dialed. If null, this
48     * would display the Dialer screen with no number pre-filled.
49     */
50    void dial(String number);
51
52    /**
53     * Place a call to the specified number.
54     * @param callingPackage The package making the call.
55     * @param number the number to be called.
56     */
57    void call(String callingPackage, String number);
58
59    /**
60     * End call if there is a call in progress, otherwise does nothing.
61     *
62     * @return whether it hung up
63     */
64    boolean endCall();
65
66    /**
67     * End call on particular subId or go to the Home screen
68     * @param subId user preferred subId.
69     * @return whether it hung up
70     */
71    boolean endCallForSubscriber(int subId);
72
73    /**
74     * Answer the currently-ringing call.
75     *
76     * If there's already a current active call, that call will be
77     * automatically put on hold.  If both lines are currently in use, the
78     * current active call will be ended.
79     *
80     * TODO: provide a flag to let the caller specify what policy to use
81     * if both lines are in use.  (The current behavior is hardwired to
82     * "answer incoming, end ongoing", which is how the CALL button
83     * is specced to behave.)
84     *
85     * TODO: this should be a oneway call (especially since it's called
86     * directly from the key queue thread).
87     */
88    void answerRingingCall();
89
90    /**
91     * Answer the currently-ringing call on particular subId .
92     *
93     * If there's already a current active call, that call will be
94     * automatically put on hold.  If both lines are currently in use, the
95     * current active call will be ended.
96     *
97     * TODO: provide a flag to let the caller specify what policy to use
98     * if both lines are in use.  (The current behavior is hardwired to
99     * "answer incoming, end ongoing", which is how the CALL button
100     * is specced to behave.)
101     *
102     * TODO: this should be a oneway call (especially since it's called
103     * directly from the key queue thread).
104     */
105    void answerRingingCallForSubscriber(int subId);
106
107    /**
108     * Silence the ringer if an incoming call is currently ringing.
109     * (If vibrating, stop the vibrator also.)
110     *
111     * It's safe to call this if the ringer has already been silenced, or
112     * even if there's no incoming call.  (If so, this method will do nothing.)
113     *
114     * TODO: this should be a oneway call too (see above).
115     *       (Actually *all* the methods here that return void can
116     *       probably be oneway.)
117     */
118    void silenceRinger();
119
120    /**
121     * Check if we are in either an active or holding call
122     * @param callingPackage the name of the package making the call.
123     * @return true if the phone state is OFFHOOK.
124     */
125    boolean isOffhook(String callingPackage);
126
127    /**
128     * Check if a particular subId has an active or holding call
129     *
130     * @param subId user preferred subId.
131     * @param callingPackage the name of the package making the call.
132     * @return true if the phone state is OFFHOOK.
133     */
134    boolean isOffhookForSubscriber(int subId, String callingPackage);
135
136    /**
137     * Check if an incoming phone call is ringing or call waiting
138     * on a particular subId.
139     *
140     * @param subId user preferred subId.
141     * @param callingPackage the name of the package making the call.
142     * @return true if the phone state is RINGING.
143     */
144    boolean isRingingForSubscriber(int subId, String callingPackage);
145
146    /**
147     * Check if an incoming phone call is ringing or call waiting.
148     * @param callingPackage the name of the package making the call.
149     * @return true if the phone state is RINGING.
150     */
151    boolean isRinging(String callingPackage);
152
153    /**
154     * Check if the phone is idle.
155     * @param callingPackage the name of the package making the call.
156     * @return true if the phone state is IDLE.
157     */
158    boolean isIdle(String callingPackage);
159
160    /**
161     * Check if the phone is idle on a particular subId.
162     *
163     * @param subId user preferred subId.
164     * @param callingPackage the name of the package making the call.
165     * @return true if the phone state is IDLE.
166     */
167    boolean isIdleForSubscriber(int subId, String callingPackage);
168
169    /**
170     * Check to see if the radio is on or not.
171     * @param callingPackage the name of the package making the call.
172     * @return returns true if the radio is on.
173     */
174    boolean isRadioOn(String callingPackage);
175
176    /**
177     * Check to see if the radio is on or not on particular subId.
178     * @param subId user preferred subId.
179     * @param callingPackage the name of the package making the call.
180     * @return returns true if the radio is on.
181     */
182    boolean isRadioOnForSubscriber(int subId, String callingPackage);
183
184    /**
185     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
186     * @param pin The pin to check.
187     * @return whether the operation was a success.
188     */
189    boolean supplyPin(String pin);
190
191    /**
192     * Supply a pin to unlock the SIM for particular subId.
193     * Blocks until a result is determined.
194     * @param pin The pin to check.
195     * @param subId user preferred subId.
196     * @return whether the operation was a success.
197     */
198    boolean supplyPinForSubscriber(int subId, String pin);
199
200    /**
201     * Supply puk to unlock the SIM and set SIM pin to new pin.
202     *  Blocks until a result is determined.
203     * @param puk The puk to check.
204     *        pin The new pin to be set in SIM
205     * @return whether the operation was a success.
206     */
207    boolean supplyPuk(String puk, String pin);
208
209    /**
210     * Supply puk to unlock the SIM and set SIM pin to new pin.
211     *  Blocks until a result is determined.
212     * @param puk The puk to check.
213     *        pin The new pin to be set in SIM
214     * @param subId user preferred subId.
215     * @return whether the operation was a success.
216     */
217    boolean supplyPukForSubscriber(int subId, String puk, String pin);
218
219    /**
220     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
221     * Returns a specific success/error code.
222     * @param pin The pin to check.
223     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
224     *         retValue[1] = number of attempts remaining if known otherwise -1
225     */
226    int[] supplyPinReportResult(String pin);
227
228    /**
229     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
230     * Returns a specific success/error code.
231     * @param pin The pin to check.
232     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
233     *         retValue[1] = number of attempts remaining if known otherwise -1
234     */
235    int[] supplyPinReportResultForSubscriber(int subId, String pin);
236
237    /**
238     * Supply puk to unlock the SIM and set SIM pin to new pin.
239     * Blocks until a result is determined.
240     * Returns a specific success/error code
241     * @param puk The puk to check
242     *        pin The pin to check.
243     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
244     *         retValue[1] = number of attempts remaining if known otherwise -1
245     */
246    int[] supplyPukReportResult(String puk, String pin);
247
248    /**
249     * Supply puk to unlock the SIM and set SIM pin to new pin.
250     * Blocks until a result is determined.
251     * Returns a specific success/error code
252     * @param puk The puk to check
253     *        pin The pin to check.
254     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
255     *         retValue[1] = number of attempts remaining if known otherwise -1
256     */
257    int[] supplyPukReportResultForSubscriber(int subId, String puk, String pin);
258
259    /**
260     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
261     * without SEND (so <code>dial</code> is not appropriate).
262     *
263     * @param dialString the MMI command to be executed.
264     * @return true if MMI command is executed.
265     */
266    boolean handlePinMmi(String dialString);
267
268    /**
269     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
270     * without SEND (so <code>dial</code> is not appropriate) for
271     * a particular subId.
272     * @param dialString the MMI command to be executed.
273     * @param subId user preferred subId.
274     * @return true if MMI command is executed.
275     */
276    boolean handlePinMmiForSubscriber(int subId, String dialString);
277
278    /**
279     * Toggles the radio on or off.
280     */
281    void toggleRadioOnOff();
282
283    /**
284     * Toggles the radio on or off on particular subId.
285     * @param subId user preferred subId.
286     */
287    void toggleRadioOnOffForSubscriber(int subId);
288
289    /**
290     * Set the radio to on or off
291     */
292    boolean setRadio(boolean turnOn);
293
294    /**
295     * Set the radio to on or off on particular subId.
296     * @param subId user preferred subId.
297     */
298    boolean setRadioForSubscriber(int subId, boolean turnOn);
299
300    /**
301     * Set the radio to on or off unconditionally
302     */
303    boolean setRadioPower(boolean turnOn);
304
305    /**
306     * Request to update location information in service state
307     */
308    void updateServiceLocation();
309
310    /**
311     * Request to update location information for a subscrition in service state
312     * @param subId user preferred subId.
313     */
314    void updateServiceLocationForSubscriber(int subId);
315
316    /**
317     * Enable location update notifications.
318     */
319    void enableLocationUpdates();
320
321    /**
322     * Enable location update notifications.
323     * @param subId user preferred subId.
324     */
325    void enableLocationUpdatesForSubscriber(int subId);
326
327    /**
328     * Disable location update notifications.
329     */
330    void disableLocationUpdates();
331
332    /**
333     * Disable location update notifications.
334     * @param subId user preferred subId.
335     */
336    void disableLocationUpdatesForSubscriber(int subId);
337
338    /**
339     * Allow mobile data connections.
340     */
341    boolean enableDataConnectivity();
342
343    /**
344     * Disallow mobile data connections.
345     */
346    boolean disableDataConnectivity();
347
348    /**
349     * Report whether data connectivity is possible.
350     */
351    boolean isDataConnectivityPossible();
352
353    Bundle getCellLocation(String callingPkg);
354
355    /**
356     * Returns the neighboring cell information of the device.
357     */
358    List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg);
359
360     int getCallState();
361
362    /**
363     * Returns the call state for a slot.
364     */
365     int getCallStateForSlot(int slotId);
366
367     int getDataActivity();
368     int getDataState();
369
370    /**
371     * Returns the current active phone type as integer.
372     * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
373     * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
374     */
375    int getActivePhoneType();
376
377    /**
378     * Returns the current active phone type as integer for particular slot.
379     * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
380     * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
381     * @param slotId - slot to query.
382     */
383    int getActivePhoneTypeForSlot(int slotId);
384
385    /**
386     * Returns the CDMA ERI icon index to display
387     * @param callingPackage package making the call.
388     */
389    int getCdmaEriIconIndex(String callingPackage);
390
391    /**
392     * Returns the CDMA ERI icon index to display on particular subId.
393     * @param subId user preferred subId.
394     * @param callingPackage package making the call.
395     */
396    int getCdmaEriIconIndexForSubscriber(int subId, String callingPackage);
397
398    /**
399     * Returns the CDMA ERI icon mode,
400     * 0 - ON
401     * 1 - FLASHING
402     * @param callingPackage package making the call.
403     */
404    int getCdmaEriIconMode(String callingPackage);
405
406    /**
407     * Returns the CDMA ERI icon mode on particular subId,
408     * 0 - ON
409     * 1 - FLASHING
410     * @param subId user preferred subId.
411     * @param callingPackage package making the call.
412     */
413    int getCdmaEriIconModeForSubscriber(int subId, String callingPackage);
414
415    /**
416     * Returns the CDMA ERI text,
417     * @param callingPackage package making the call.
418     */
419    String getCdmaEriText(String callingPackage);
420
421    /**
422     * Returns the CDMA ERI text for particular subId,
423     * @param subId user preferred subId.
424     * @param callingPackage package making the call.
425     */
426    String getCdmaEriTextForSubscriber(int subId, String callingPackage);
427
428    /**
429     * Returns true if OTA service provisioning needs to run.
430     * Only relevant on some technologies, others will always
431     * return false.
432     */
433    boolean needsOtaServiceProvisioning();
434
435    /**
436     * Sets the voicemail number for a particular subscriber.
437     */
438    boolean setVoiceMailNumber(int subId, String alphaTag, String number);
439
440    /**
441      * Returns the unread count of voicemails
442      */
443    int getVoiceMessageCount();
444
445    /**
446     * Returns the unread count of voicemails for a subId.
447     * @param subId user preferred subId.
448     * Returns the unread count of voicemails
449     */
450    int getVoiceMessageCountForSubscriber(int subId);
451
452    /**
453     * Returns the network type for data transmission
454     * Legacy call, permission-free
455     */
456    int getNetworkType();
457
458    /**
459     * Returns the network type of a subId.
460     * @param subId user preferred subId.
461     * @param callingPackage package making the call.
462     */
463    int getNetworkTypeForSubscriber(int subId, String callingPackage);
464
465    /**
466     * Returns the network type for data transmission
467     * @param callingPackage package making the call.
468     */
469    int getDataNetworkType(String callingPackage);
470
471    /**
472     * Returns the data network type of a subId
473     * @param subId user preferred subId.
474     * @param callingPackage package making the call.
475     */
476    int getDataNetworkTypeForSubscriber(int subId, String callingPackage);
477
478    /**
479      * Returns the voice network type of a subId
480      * @param subId user preferred subId.
481      * @param callingPackage package making the call.
482      * Returns the network type
483      */
484    int getVoiceNetworkTypeForSubscriber(int subId, String callingPackage);
485
486    /**
487     * Return true if an ICC card is present
488     */
489    boolean hasIccCard();
490
491    /**
492     * Return true if an ICC card is present for a subId.
493     * @param slotId user preferred slotId.
494     * Return true if an ICC card is present
495     */
496    boolean hasIccCardUsingSlotId(int slotId);
497
498    /**
499     * Return if the current radio is LTE on CDMA. This
500     * is a tri-state return value as for a period of time
501     * the mode may be unknown.
502     *
503     * @param callingPackage the name of the calling package
504     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
505     * or {@link PHone#LTE_ON_CDMA_TRUE}
506     */
507    int getLteOnCdmaMode(String callingPackage);
508
509    /**
510     * Return if the current radio is LTE on CDMA. This
511     * is a tri-state return value as for a period of time
512     * the mode may be unknown.
513     *
514     * @param callingPackage the name of the calling package
515     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
516     * or {@link PHone#LTE_ON_CDMA_TRUE}
517     */
518    int getLteOnCdmaModeForSubscriber(int subId, String callingPackage);
519
520    /**
521     * Returns the all observed cell information of the device.
522     */
523    List<CellInfo> getAllCellInfo(String callingPkg);
524
525    /**
526     * Sets minimum time in milli-seconds between onCellInfoChanged
527     */
528    void setCellInfoListRate(int rateInMillis);
529
530    /**
531     * get default sim
532     * @return sim id
533     */
534    int getDefaultSim();
535
536    /**
537     * Opens a logical channel to the ICC card.
538     *
539     * Input parameters equivalent to TS 27.007 AT+CCHO command.
540     *
541     * @param subId The subscription to use.
542     * @param AID Application id. See ETSI 102.221 and 101.220.
543     * @return an IccOpenLogicalChannelResponse object.
544     */
545    IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID);
546
547    /**
548     * Closes a previously opened logical channel to the ICC card.
549     *
550     * Input parameters equivalent to TS 27.007 AT+CCHC command.
551     *
552     * @param subId The subscription to use.
553     * @param channel is the channel id to be closed as retruned by a
554     *            successful iccOpenLogicalChannel.
555     * @return true if the channel was closed successfully.
556     */
557    boolean iccCloseLogicalChannel(int subId, int channel);
558
559    /**
560     * Transmit an APDU to the ICC card over a logical channel.
561     *
562     * Input parameters equivalent to TS 27.007 AT+CGLA command.
563     *
564     * @param subId The subscription to use.
565     * @param channel is the channel id to be closed as retruned by a
566     *            successful iccOpenLogicalChannel.
567     * @param cla Class of the APDU command.
568     * @param instruction Instruction of the APDU command.
569     * @param p1 P1 value of the APDU command.
570     * @param p2 P2 value of the APDU command.
571     * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
572     *            is sent to the SIM.
573     * @param data Data to be sent with the APDU.
574     * @return The APDU response from the ICC card with the status appended at
575     *            the end.
576     */
577    String iccTransmitApduLogicalChannel(int subId, int channel, int cla, int instruction,
578            int p1, int p2, int p3, String data);
579
580    /**
581     * Transmit an APDU to the ICC card over the basic channel.
582     *
583     * Input parameters equivalent to TS 27.007 AT+CSIM command.
584     *
585     * @param subId The subscription to use.
586     * @param cla Class of the APDU command.
587     * @param instruction Instruction of the APDU command.
588     * @param p1 P1 value of the APDU command.
589     * @param p2 P2 value of the APDU command.
590     * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
591     *            is sent to the SIM.
592     * @param data Data to be sent with the APDU.
593     * @return The APDU response from the ICC card with the status appended at
594     *            the end.
595     */
596    String iccTransmitApduBasicChannel(int subId, int cla, int instruction,
597            int p1, int p2, int p3, String data);
598
599    /**
600     * Returns the response APDU for a command APDU sent through SIM_IO.
601     *
602     * @param subId The subscription to use.
603     * @param fileID
604     * @param command
605     * @param p1 P1 value of the APDU command.
606     * @param p2 P2 value of the APDU command.
607     * @param p3 P3 value of the APDU command.
608     * @param filePath
609     * @return The APDU response.
610     */
611    byte[] iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2, int p3,
612            String filePath);
613
614    /**
615     * Send ENVELOPE to the SIM and returns the response.
616     *
617     * @param subId The subscription to use.
618     * @param contents  String containing SAT/USAT response in hexadecimal
619     *                  format starting with command tag. See TS 102 223 for
620     *                  details.
621     * @return The APDU response from the ICC card, with the last 4 bytes
622     *         being the status word. If the command fails, returns an empty
623     *         string.
624     */
625    String sendEnvelopeWithStatus(int subId, String content);
626
627    /**
628     * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
629     * Used for device configuration by some CDMA operators.
630     *
631     * @param itemID the ID of the item to read.
632     * @return the NV item as a String, or null on any failure.
633     */
634    String nvReadItem(int itemID);
635
636    /**
637     * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
638     * Used for device configuration by some CDMA operators.
639     *
640     * @param itemID the ID of the item to read.
641     * @param itemValue the value to write, as a String.
642     * @return true on success; false on any failure.
643     */
644    boolean nvWriteItem(int itemID, String itemValue);
645
646    /**
647     * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
648     * Used for device configuration by some CDMA operators.
649     *
650     * @param preferredRoamingList byte array containing the new PRL.
651     * @return true on success; false on any failure.
652     */
653    boolean nvWriteCdmaPrl(in byte[] preferredRoamingList);
654
655    /**
656     * Perform the specified type of NV config reset. The radio will be taken offline
657     * and the device must be rebooted after the operation. Used for device
658     * configuration by some CDMA operators.
659     *
660     * @param resetType the type of reset to perform (1 == factory reset; 2 == NV-only reset).
661     * @return true on success; false on any failure.
662     */
663    boolean nvResetConfig(int resetType);
664
665    /*
666     * Get the calculated preferred network type.
667     * Used for device configuration by some CDMA operators.
668     * @param callingPackage The package making the call.
669     *
670     * @return the calculated preferred network type, defined in RILConstants.java.
671     */
672    int getCalculatedPreferredNetworkType(String callingPackage);
673
674    /*
675     * Get the preferred network type.
676     * Used for device configuration by some CDMA operators.
677     *
678     * @param subId the id of the subscription to query.
679     * @return the preferred network type, defined in RILConstants.java.
680     */
681    int getPreferredNetworkType(int subId);
682
683    /**
684     * Check TETHER_DUN_REQUIRED and TETHER_DUN_APN settings, net.tethering.noprovisioning
685     * SystemProperty, and config_tether_apndata to decide whether DUN APN is required for
686     * tethering.
687     *
688     * @return 0: Not required. 1: required. 2: Not set.
689     */
690    int getTetherApnRequired();
691
692    /**
693     * Set the network selection mode to automatic.
694     *
695     * @param subId the id of the subscription to update.
696     */
697    void setNetworkSelectionModeAutomatic(int subId);
698
699    /**
700     * Perform a radio scan and return the list of avialble networks.
701     *
702     * @param subId the id of the subscription.
703     * @return CellNetworkScanResult containing status of scan and networks.
704     */
705    CellNetworkScanResult getCellNetworkScanResults(int subId);
706
707    /**
708     * Ask the radio to connect to the input network and change selection mode to manual.
709     *
710     * @param subId the id of the subscription.
711     * @param operatorInfo the operator to attach to.
712     * @param persistSelection should the selection persist till reboot or its
713     *        turned off? Will also result in notification being not shown to
714     *        the user if the signal is lost.
715     * @return true if the request suceeded.
716     */
717    boolean setNetworkSelectionModeManual(int subId, in OperatorInfo operator,
718            boolean persistSelection);
719
720    /**
721     * Set the preferred network type.
722     * Used for device configuration by some CDMA operators.
723     *
724     * @param subId the id of the subscription to update.
725     * @param networkType the preferred network type, defined in RILConstants.java.
726     * @return true on success; false on any failure.
727     */
728    boolean setPreferredNetworkType(int subId, int networkType);
729
730    /**
731     * User enable/disable Mobile Data.
732     *
733     * @param enable true to turn on, else false
734     */
735    void setDataEnabled(int subId, boolean enable);
736
737    /**
738     * Get the user enabled state of Mobile Data.
739     *
740     * @return true on enabled
741     */
742    boolean getDataEnabled(int subId);
743
744    /**
745     * Get P-CSCF address from PCO after data connection is established or modified.
746     * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN
747     * @param callingPackage The package making the call.
748     */
749    String[] getPcscfAddress(String apnType, String callingPackage);
750
751    /**
752     * Set IMS registration state
753     */
754    void setImsRegistrationState(boolean registered);
755
756    /**
757     * Return MDN string for CDMA phone.
758     * @param subId user preferred subId.
759     */
760    String getCdmaMdn(int subId);
761
762    /**
763     * Return MIN string for CDMA phone.
764     * @param subId user preferred subId.
765     */
766    String getCdmaMin(int subId);
767
768    /**
769     * Has the calling application been granted special privileges by the carrier.
770     *
771     * If any of the packages in the calling UID has carrier privileges, the
772     * call will return true. This access is granted by the owner of the UICC
773     * card and does not depend on the registered carrier.
774     *
775     * TODO: Add a link to documentation.
776     *
777     * @param subId The subscription to use.
778     * @return carrier privilege status defined in TelephonyManager.
779     */
780    int getCarrierPrivilegeStatus(int subId);
781
782    /**
783     * Similar to above, but check for the package whose name is pkgName.
784     */
785    int checkCarrierPrivilegesForPackage(String pkgName);
786
787    /**
788     * Similar to above, but check across all phones.
789     */
790    int checkCarrierPrivilegesForPackageAnyPhone(String pkgName);
791
792    /**
793     * Returns list of the package names of the carrier apps that should handle the input intent
794     * and have carrier privileges for the given phoneId.
795     *
796     * @param intent Intent that will be sent.
797     * @param phoneId The phoneId on which the carrier app has carrier privileges.
798     * @return list of carrier app package names that can handle the intent on phoneId.
799     *         Returns null if there is an error and an empty list if there
800     *         are no matching packages.
801     */
802    List<String> getCarrierPackageNamesForIntentAndPhone(in Intent intent, int phoneId);
803
804    /**
805     * Set the line 1 phone number string and its alphatag for the current ICCID
806     * for display purpose only, for example, displayed in Phone Status. It won't
807     * change the actual MSISDN/MDN. To unset alphatag or number, pass in a null
808     * value.
809     *
810     * @param subId the subscriber that the alphatag and dialing number belongs to.
811     * @param alphaTag alpha-tagging of the dailing nubmer
812     * @param number The dialing number
813     * @return true if the operation was executed correctly.
814     */
815    boolean setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number);
816
817    /**
818     * Returns the displayed dialing number string if it was set previously via
819     * {@link #setLine1NumberForDisplay}. Otherwise returns null.
820     *
821     * @param subId whose dialing number for line 1 is returned.
822     * @param callingPackage The package making the call.
823     * @return the displayed dialing number if set, or null if not set.
824     */
825    String getLine1NumberForDisplay(int subId, String callingPackage);
826
827    /**
828     * Returns the displayed alphatag of the dialing number if it was set
829     * previously via {@link #setLine1NumberForDisplay}. Otherwise returns null.
830     *
831     * @param subId whose alphatag associated with line 1 is returned.
832     * @param callingPackage The package making the call.
833     * @return the displayed alphatag of the dialing number if set, or null if
834     *         not set.
835     */
836    String getLine1AlphaTagForDisplay(int subId, String callingPackage);
837
838    String[] getMergedSubscriberIds(String callingPackage);
839
840    /**
841     * Override the operator branding for the current ICCID.
842     *
843     * Once set, whenever the SIM is present in the device, the service
844     * provider name (SPN) and the operator name will both be replaced by the
845     * brand value input. To unset the value, the same function should be
846     * called with a null brand value.
847     *
848     * <p>Requires Permission:
849     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
850     *  or has to be carrier app - see #hasCarrierPrivileges.
851     *
852     * @param subId The subscription to use.
853     * @param brand The brand name to display/set.
854     * @return true if the operation was executed correctly.
855     */
856    boolean setOperatorBrandOverride(int subId, String brand);
857
858    /**
859     * Override the roaming indicator for the current ICCID.
860     *
861     * Using this call, the carrier app (see #hasCarrierPrivileges) can override
862     * the platform's notion of a network operator being considered roaming or not.
863     * The change only affects the ICCID that was active when this call was made.
864     *
865     * If null is passed as any of the input, the corresponding value is deleted.
866     *
867     * <p>Requires that the caller have carrier privilege. See #hasCarrierPrivileges.
868     *
869     * @param subId for which the roaming overrides apply.
870     * @param gsmRoamingList - List of MCCMNCs to be considered roaming for 3GPP RATs.
871     * @param gsmNonRoamingList - List of MCCMNCs to be considered not roaming for 3GPP RATs.
872     * @param cdmaRoamingList - List of SIDs to be considered roaming for 3GPP2 RATs.
873     * @param cdmaNonRoamingList - List of SIDs to be considered not roaming for 3GPP2 RATs.
874     * @return true if the operation was executed correctly.
875     */
876    boolean setRoamingOverride(int subId, in List<String> gsmRoamingList,
877            in List<String> gsmNonRoamingList, in List<String> cdmaRoamingList,
878            in List<String> cdmaNonRoamingList);
879
880    /**
881     * Returns the result and response from RIL for oem request
882     *
883     * @param oemReq the data is sent to ril.
884     * @param oemResp the respose data from RIL.
885     * @return negative value request was not handled or get error
886     *         0 request was handled succesfully, but no response data
887     *         positive value success, data length of response
888     */
889    int invokeOemRilRequestRaw(in byte[] oemReq, out byte[] oemResp);
890
891    /**
892     * Check if any mobile Radios need to be shutdown.
893     *
894     * @return true is any mobile radio needs to be shutdown
895     */
896    boolean needMobileRadioShutdown();
897
898    /**
899     * Shutdown Mobile Radios
900     */
901    void shutdownMobileRadios();
902
903    /**
904     * Set phone radio type and access technology.
905     *
906     * @param rafs an RadioAccessFamily array to indicate all phone's
907     *        new radio access family. The length of RadioAccessFamily
908     *        must equ]]al to phone count.
909     */
910    void setRadioCapability(in RadioAccessFamily[] rafs);
911
912    /**
913     * Get phone radio type and access technology.
914     *
915     * @param phoneId which phone you want to get
916     * @param callingPackage the name of the package making the call
917     * @return phone radio type and access technology
918     */
919    int getRadioAccessFamily(in int phoneId, String callingPackage);
920
921    /**
922     * Enables or disables video calling.
923     *
924     * @param enable Whether to enable video calling.
925     */
926    void enableVideoCalling(boolean enable);
927
928    /**
929     * Whether video calling has been enabled by the user.
930     *
931     * @param callingPackage The package making the call.
932     * @return {@code true} if the user has enabled video calling, {@code false} otherwise.
933     */
934    boolean isVideoCallingEnabled(String callingPackage);
935
936    /**
937     * Whether the DTMF tone length can be changed.
938     *
939     * @return {@code true} if the DTMF tone length can be changed.
940     */
941    boolean canChangeDtmfToneLength();
942
943    /**
944     * Whether the device is a world phone.
945     *
946     * @return {@code true} if the devices is a world phone.
947     */
948    boolean isWorldPhone();
949
950    /**
951     * Whether the phone supports TTY mode.
952     *
953     * @return {@code true} if the device supports TTY mode.
954     */
955    boolean isTtyModeSupported();
956
957    /**
958     * Whether the phone supports hearing aid compatibility.
959     *
960     * @return {@code true} if the device supports hearing aid compatibility.
961     */
962    boolean isHearingAidCompatibilitySupported();
963
964    /**
965     * Get IMS Registration Status
966     */
967    boolean isImsRegistered();
968
969    /**
970     * Returns the Status of Wi-Fi Calling
971     */
972    boolean isWifiCallingAvailable();
973
974    /**
975     * Returns the Status of Volte
976     */
977    boolean isVolteAvailable();
978
979     /**
980     * Returns the Status of VT (video telephony)
981     */
982    boolean isVideoTelephonyAvailable();
983
984    /**
985      * Returns the unique device ID of phone, for example, the IMEI for
986      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
987      *
988      * @param callingPackage The package making the call.
989      * <p>Requires Permission:
990      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
991      */
992    String getDeviceId(String callingPackage);
993
994    /**
995     * Returns the IMEI for the given slot.
996     *
997     * @param slotId - device slot.
998     * @param callingPackage The package making the call.
999     * <p>Requires Permission:
1000     *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1001     */
1002    String getImeiForSlot(int slotId, String callingPackage);
1003
1004    /**
1005     * Returns the device software version.
1006     *
1007     * @param slotId - device slot.
1008     * @param callingPackage The package making the call.
1009     * <p>Requires Permission:
1010     *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1011     */
1012    String getDeviceSoftwareVersionForSlot(int slotId, String callingPackage);
1013
1014    /**
1015     * Returns the subscription ID associated with the specified PhoneAccount.
1016     */
1017    int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
1018
1019    void factoryReset(int subId);
1020
1021    /**
1022     * An estimate of the users's current locale based on the default SIM.
1023     *
1024     * The returned string will be a well formed BCP-47 language tag, or {@code null}
1025     * if no locale could be derived.
1026     */
1027    String getLocaleFromDefaultSim();
1028
1029    /**
1030     * Return the modem activity info.
1031     */
1032    ModemActivityInfo getModemActivityInfo();
1033
1034    /**
1035     * Get the service state on specified subscription
1036     * @param subId Subscription id
1037     * @param callingPackage The package making the call
1038     * @return Service state on specified subscription.
1039     */
1040    ServiceState getServiceStateForSubscriber(int subId, String callingPackage);
1041
1042    /**
1043     * Returns the URI for the per-account voicemail ringtone set in Phone settings.
1044     *
1045     * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
1046     * voicemail ringtone.
1047     * @return The URI for the ringtone to play when receiving a voicemail from a specific
1048     * PhoneAccount.
1049     */
1050    Uri getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle);
1051
1052    /**
1053     * Returns whether vibration is set for voicemail notification in Phone settings.
1054     *
1055     * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
1056     * voicemail vibration setting.
1057     * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
1058     */
1059    boolean isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle);
1060
1061    /**
1062     * Returns a list of packages that have carrier privileges.
1063     */
1064    List<String> getPackagesWithCarrierPrivileges();
1065}
1066