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