ITelephony.aidl revision 64eebba6bccff8e60f6a194eeed97d31441644b0
114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber/*
214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber * Copyright (C) 2007 The Android Open Source Project
389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project *
489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License");
589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * you may not use this file except in compliance with the License.
689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * You may obtain a copy of the License at
789fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project *
889fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project *      http://www.apache.org/licenses/LICENSE-2.0
989fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project *
1089fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * Unless required by applicable law or agreed to in writing, software
1189fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS,
1289fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1389fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * See the License for the specific language governing permissions and
1489fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project * limitations under the License.
1589fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project */
1689fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5The Android Open Source Project
17fc9ba09e3bb368f823d473f5e2bb9aa32dba6289Andreas Huberpackage com.android.internal.telephony;
1814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
1914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.content.Intent;
200852843d304006e3ab333081fddda13b07193de8Robert Shihimport android.os.Bundle;
2114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.os.ResultReceiver;
2214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.net.Uri;
235abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhangimport android.service.carrier.CarrierIdentifier;
2414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.telecom.PhoneAccount;
2514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.telecom.PhoneAccountHandle;
2614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.telephony.CellInfo;
2714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.telephony.IccOpenLogicalChannelResponse;
2814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.telephony.ModemActivityInfo;
293a37f3e948b600405e0c70b8a241778fda44168eHassan Shojaniaimport android.telephony.NeighboringCellInfo;
3014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.telephony.RadioAccessFamily;
3114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.telephony.ServiceState;
3214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.telephony.TelephonyHistogram;
3314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport android.telephony.VisualVoicemailSmsFilterSettings;
3414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport com.android.ims.internal.IImsServiceController;
3514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport com.android.ims.internal.IImsServiceFeatureListener;
3614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport com.android.internal.telephony.CellNetworkScanResult;
3714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huberimport com.android.internal.telephony.OperatorInfo;
3814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
39b4a7a2df4c28c3f32b5d877b54831d2cc5d78f81Colin Crossimport java.util.List;
4014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
4125f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang
4225f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang/**
4325f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang * Interface used to interact with the phone.  Mostly this is used by the
4425f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang * TelephonyManager class.  A few places are still using this directly.
4514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber * Please clean them up if possible and use TelephonyManager instead.
4614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber *
4714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber * {@hide}
487c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang */
49e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnarinterface ITelephony {
50a93fd2be99d21629bed504b9b7df035fc2f54562Leena Winterrowd
51a93fd2be99d21629bed504b9b7df035fc2f54562Leena Winterrowd    /**
5214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Dial a number. This doesn't place the call. It displays
53a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * the Dialer screen.
54a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param number the number to be dialed. If null, this
55a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * would display the Dialer screen with no number pre-filled.
56a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
57a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    void dial(String number);
58a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
59a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
60a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Place a call to the specified number.
61a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param callingPackage The package making the call.
62a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param number the number to be called.
63a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
64a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    void call(String callingPackage, String number);
65a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
66a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
67a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * End call if there is a call in progress, otherwise does nothing.
68a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
69a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @return whether it hung up
70a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
71a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    boolean endCall();
72a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
73a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
74a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * End call on particular subId or go to the Home screen
75a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param subId user preferred subId.
76a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @return whether it hung up
77a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
78a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    boolean endCallForSubscriber(int subId);
79a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
80a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
81a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Answer the currently-ringing call.
82a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
83a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * If there's already a current active call, that call will be
84a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * automatically put on hold.  If both lines are currently in use, the
85a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * current active call will be ended.
86a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
87a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * TODO: provide a flag to let the caller specify what policy to use
88a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * if both lines are in use.  (The current behavior is hardwired to
89a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * "answer incoming, end ongoing", which is how the CALL button
90a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * is specced to behave.)
91a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
92a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * TODO: this should be a oneway call (especially since it's called
93a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * directly from the key queue thread).
94a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
95a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    void answerRingingCall();
96a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
97a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
98a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Answer the currently-ringing call on particular subId .
99a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
100a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * If there's already a current active call, that call will be
101a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * automatically put on hold.  If both lines are currently in use, the
102a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * current active call will be ended.
103a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
104a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * TODO: provide a flag to let the caller specify what policy to use
105a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * if both lines are in use.  (The current behavior is hardwired to
106a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * "answer incoming, end ongoing", which is how the CALL button
107a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * is specced to behave.)
108a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
109a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * TODO: this should be a oneway call (especially since it's called
110a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * directly from the key queue thread).
111a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
112a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    void answerRingingCallForSubscriber(int subId);
113a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
114a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
115a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Silence the ringer if an incoming call is currently ringing.
116a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * (If vibrating, stop the vibrator also.)
117a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
118a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * It's safe to call this if the ringer has already been silenced, or
119a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * even if there's no incoming call.  (If so, this method will do nothing.)
120a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
121a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * TODO: this should be a oneway call too (see above).
122a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *       (Actually *all* the methods here that return void can
123a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *       probably be oneway.)
124a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
125a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    void silenceRinger();
126a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
127a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
128a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Check if we are in either an active or holding call
129a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param callingPackage the name of the package making the call.
130a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @return true if the phone state is OFFHOOK.
131a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
132a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    boolean isOffhook(String callingPackage);
133a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
134a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
135a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Check if a particular subId has an active or holding call
136a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
137a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param subId user preferred subId.
138a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param callingPackage the name of the package making the call.
13914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return true if the phone state is OFFHOOK.
14014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
14114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean isOffhookForSubscriber(int subId, String callingPackage);
142b44ce2f84691559672cfaf6bb8fd3a9ac43904f2Robert Shih
14325f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang    /**
144b44ce2f84691559672cfaf6bb8fd3a9ac43904f2Robert Shih     * Check if an incoming phone call is ringing or call waiting
14514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * on a particular subId.
14614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
14714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId user preferred subId.
14825f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * @param callingPackage the name of the package making the call.
14914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return true if the phone state is RINGING.
15014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
151309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih    boolean isRingingForSubscriber(int subId, String callingPackage);
152309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih
153309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih    /**
15414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Check if an incoming phone call is ringing or call waiting.
155978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * @param callingPackage the name of the package making the call.
15614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return true if the phone state is RINGING.
15714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
15814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean isRinging(String callingPackage);
1597c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang
160a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
161c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     * Check if the phone is idle.
16214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param callingPackage the name of the package making the call.
16314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return true if the phone state is IDLE.
164b44ce2f84691559672cfaf6bb8fd3a9ac43904f2Robert Shih     */
165c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang    boolean isIdle(String callingPackage);
16614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
16714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
168a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Check if the phone is idle on a particular subId.
169a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
1703a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param subId user preferred subId.
171a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param callingPackage the name of the package making the call.
1720852843d304006e3ab333081fddda13b07193de8Robert Shih     * @return true if the phone state is IDLE.
1730852843d304006e3ab333081fddda13b07193de8Robert Shih     */
17414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean isIdleForSubscriber(int subId, String callingPackage);
1755abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang
1763a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    /**
1773a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * Check to see if the radio is on or not.
1783a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param callingPackage the name of the package making the call.
17914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return returns true if the radio is on.
18014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
18114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean isRadioOn(String callingPackage);
18214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
18314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
18425f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * Check to see if the radio is on or not on particular subId.
18525f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * @param subId user preferred subId.
18625f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * @param callingPackage the name of the package making the call.
18725f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * @return returns true if the radio is on.
18814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
18914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean isRadioOnForSubscriber(int subId, String callingPackage);
19014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
191978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang    /**
192978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
193978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * @param pin The pin to check.
194b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * @return whether the operation was a success.
195b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     */
196b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber    boolean supplyPin(String pin);
197b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber
198b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber    /**
199b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * Supply a pin to unlock the SIM for particular subId.
200b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * Blocks until a result is determined.
201b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * @param pin The pin to check.
202b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * @param subId user preferred subId.
203b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * @return whether the operation was a success.
204b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     */
205b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber    boolean supplyPinForSubscriber(int subId, String pin);
206b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber
207b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber    /**
208b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * Supply puk to unlock the SIM and set SIM pin to new pin.
209b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     *  Blocks until a result is determined.
210b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * @param puk The puk to check.
211b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     *        pin The new pin to be set in SIM
212b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * @return whether the operation was a success.
213b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     */
2147c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    boolean supplyPuk(String puk, String pin);
2157c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang
2167c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    /**
217978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * Supply puk to unlock the SIM and set SIM pin to new pin.
218978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     *  Blocks until a result is determined.
219978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * @param puk The puk to check.
220b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     *        pin The new pin to be set in SIM
221b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * @param subId user preferred subId.
222b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     * @return whether the operation was a success.
223b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     */
2247c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    boolean supplyPukForSubscriber(int subId, String puk, String pin);
2257c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang
2267c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    /**
2277c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
2287c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * Returns a specific success/error code.
2297c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @param pin The pin to check.
2307c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
2317c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     *         retValue[1] = number of attempts remaining if known otherwise -1
2327c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     */
2337c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    int[] supplyPinReportResult(String pin);
2347c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang
235e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    /**
236e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
237e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     * Returns a specific success/error code.
238e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     * @param pin The pin to check.
23914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
240e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     *         retValue[1] = number of attempts remaining if known otherwise -1
241e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     */
242e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    int[] supplyPinReportResultForSubscriber(int subId, String pin);
243e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar
244e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    /**
24514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Supply puk to unlock the SIM and set SIM pin to new pin.
24614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Blocks until a result is determined.
247978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * Returns a specific success/error code
2487e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * @param puk The puk to check
2497e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     *        pin The pin to check.
2507e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
2517e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     *         retValue[1] = number of attempts remaining if known otherwise -1
2527e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     */
2537e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    int[] supplyPukReportResult(String puk, String pin);
2547e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber
2557e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    /**
2567e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * Supply puk to unlock the SIM and set SIM pin to new pin.
2577e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * Blocks until a result is determined.
2580f30bd90272c818aa37c0bb22d22eaa7d3689879Andreas Huber     * Returns a specific success/error code
2590f30bd90272c818aa37c0bb22d22eaa7d3689879Andreas Huber     * @param puk The puk to check
2600f30bd90272c818aa37c0bb22d22eaa7d3689879Andreas Huber     *        pin The pin to check.
2610f30bd90272c818aa37c0bb22d22eaa7d3689879Andreas Huber     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
2627e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     *         retValue[1] = number of attempts remaining if known otherwise -1
2637e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     */
2647e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    int[] supplyPukReportResultForSubscriber(int subId, String puk, String pin);
2657e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber
2667e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    /**
2677e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
2687e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * without SEND (so <code>dial</code> is not appropriate).
2697e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     *
2707e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * @param dialString the MMI command to be executed.
2717e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * @return true if MMI command is executed.
2727e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     */
2737e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    boolean handlePinMmi(String dialString);
2747e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber
2757e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    /**
2767e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
2777e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * without SEND (so <code>dial</code> is not appropriate) for
2787e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * a particular subId.
2797e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * @param dialString the MMI command to be executed.
2807e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * @param subId user preferred subId.
2817e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * @return true if MMI command is executed.
2827e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     */
2837e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    boolean handlePinMmiForSubscriber(int subId, String dialString);
2847e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber
2857e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    /**
2867e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * Toggles the radio on or off.
2877e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     */
2887e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    void toggleRadioOnOff();
2897e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber
2907e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    /**
2917e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     * Toggles the radio on or off on particular subId.
292e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     * @param subId user preferred subId.
293e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     */
29414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    void toggleRadioOnOffForSubscriber(int subId);
29514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
29614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
297ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * Set the radio to on or off
298ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     */
299e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber    boolean setRadio(boolean turnOn);
300e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber
301e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber    /**
302e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber     * Set the radio to on or off on particular subId.
303a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * @param subId user preferred subId.
304e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber     */
305e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber    boolean setRadioForSubscriber(int subId, boolean turnOn);
306e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber
307e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber    /**
308e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber     * Set the radio to on or off unconditionally
309e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber     */
310e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber    boolean setRadioPower(boolean turnOn);
311e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber
312e332a9181cf6a3155ed1a0fd2afc212ccb1f2753Andreas Huber    /**
3133a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * Request to update location information in service state
3143a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     */
3153a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    void updateServiceLocation();
3163a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania
3173a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    /**
3183a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * Request to update location information for a subscrition in service state
3193a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param subId user preferred subId.
3203a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     */
3213a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    void updateServiceLocationForSubscriber(int subId);
32214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
32314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
32414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Enable location update notifications.
325ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     */
32614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    void enableLocationUpdates();
32714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
32814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
3293a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * Enable location update notifications.
3303a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param subId user preferred subId.
331a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     */
33229357bc2c0dd7c43ad3bd0c8e3efa4e6fd9bfd47Steve Block    void enableLocationUpdatesForSubscriber(int subId);
333a44153c1a57202fb538659eb50706e60454d6273Andreas Huber
334a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    /**
335a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * Disable location update notifications.
336a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     */
337a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    void disableLocationUpdates();
33829357bc2c0dd7c43ad3bd0c8e3efa4e6fd9bfd47Steve Block
339a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    /**
340a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * Disable location update notifications.
341a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * @param subId user preferred subId.
342a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     */
343a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    void disableLocationUpdatesForSubscriber(int subId);
344a44153c1a57202fb538659eb50706e60454d6273Andreas Huber
345a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    /**
346a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * Allow mobile data connections.
347a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     */
3485abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    boolean enableDataConnectivity();
34914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
3505abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
3515abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * Disallow mobile data connections.
3525abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     */
35314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean disableDataConnectivity();
35414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
35514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
35614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Report whether data connectivity is possible.
35714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
35814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean isDataConnectivityPossible();
35914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
36014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    Bundle getCellLocation(String callingPkg);
36114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
36214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
363ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * Returns the neighboring cell information of the device.
364ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     */
365ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg);
36614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
3673a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     int getCallState();
368ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih
369ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    /**
370ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * Returns the call state for a slot.
3714a3108a4464490a57bbe2854d1b47df8336bd471Robert Shih     */
37229357bc2c0dd7c43ad3bd0c8e3efa4e6fd9bfd47Steve Block     int getCallStateForSlot(int slotId);
373a44153c1a57202fb538659eb50706e60454d6273Andreas Huber
374a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     int getDataActivity();
37514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     int getDataState();
3764a3108a4464490a57bbe2854d1b47df8336bd471Robert Shih
3774a3108a4464490a57bbe2854d1b47df8336bd471Robert Shih    /**
3784a3108a4464490a57bbe2854d1b47df8336bd471Robert Shih     * Returns the current active phone type as integer.
3794a3108a4464490a57bbe2854d1b47df8336bd471Robert Shih     * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
3803a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
381ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     */
382ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    int getActivePhoneType();
383ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih
384ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    /**
385ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * Returns the current active phone type as integer for particular slot.
386ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
387ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
388ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * @param slotId - slot to query.
389ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     */
390ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    int getActivePhoneTypeForSlot(int slotId);
3913a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania
392ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    /**
393ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * Returns the CDMA ERI icon index to display
3943a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param callingPackage package making the call.
3953a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     */
3963a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    int getCdmaEriIconIndex(String callingPackage);
3973a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania
3983a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    /**
3993a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * Returns the CDMA ERI icon index to display on particular subId.
4003a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param subId user preferred subId.
4013a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param callingPackage package making the call.
4023a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     */
4033a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    int getCdmaEriIconIndexForSubscriber(int subId, String callingPackage);
4043a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania
4053a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    /**
4063a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * Returns the CDMA ERI icon mode,
4073a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * 0 - ON
4083a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * 1 - FLASHING
4093a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param callingPackage package making the call.
4103a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     */
4113a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    int getCdmaEriIconMode(String callingPackage);
4123a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania
4133a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    /**
4143a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * Returns the CDMA ERI icon mode on particular subId,
4153a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * 0 - ON
4163a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * 1 - FLASHING
4173a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param subId user preferred subId.
4183a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param callingPackage package making the call.
4193a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     */
4203a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    int getCdmaEriIconModeForSubscriber(int subId, String callingPackage);
4213a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania
4223a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    /**
4233a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * Returns the CDMA ERI text,
4243a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param callingPackage package making the call.
4253a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     */
4263a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    String getCdmaEriText(String callingPackage);
4273a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania
4283a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    /**
4293a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * Returns the CDMA ERI text for particular subId,
4303a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param subId user preferred subId.
4313a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     * @param callingPackage package making the call.
4323a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania     */
4333a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    String getCdmaEriTextForSubscriber(int subId, String callingPackage);
4343a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania
435a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    /**
436a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * Returns true if OTA service provisioning needs to run.
437a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * Only relevant on some technologies, others will always
43829357bc2c0dd7c43ad3bd0c8e3efa4e6fd9bfd47Steve Block     * return false.
439a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     */
440a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    boolean needsOtaServiceProvisioning();
441a44153c1a57202fb538659eb50706e60454d6273Andreas Huber
442ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    /**
443ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * Sets the voicemail number for a particular subscriber.
444ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     */
445ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    boolean setVoiceMailNumber(int subId, String alphaTag, String number);
446fbe6a51d5841c865b870bab1da7d828caa78a7caRobert Shih
447fbe6a51d5841c865b870bab1da7d828caa78a7caRobert Shih     /**
448fbe6a51d5841c865b870bab1da7d828caa78a7caRobert Shih      * Sets the voice activation state for a particular subscriber.
449fbe6a51d5841c865b870bab1da7d828caa78a7caRobert Shih      */
450a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    void setVoiceActivationState(int subId, int activationState);
451a44153c1a57202fb538659eb50706e60454d6273Andreas Huber
452a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     /**
453a44153c1a57202fb538659eb50706e60454d6273Andreas Huber      * Sets the data activation state for a particular subscriber.
454ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih      */
45514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    void setDataActivationState(int subId, int activationState);
456ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih
457ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     /**
45814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber      * Returns the voice activation state for a particular subscriber.
459ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih      * @param subId user preferred sub
460ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih      * @param callingPackage package queries voice activation state
461ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih      */
4623a37f3e948b600405e0c70b8a241778fda44168eHassan Shojania    int getVoiceActivationState(int subId, String callingPackage);
463ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih
464ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     /**
46514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber      * Returns the data activation state for a particular subscriber.
466ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih      * @param subId user preferred sub
467ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih      * @param callingPackage package queris data activation state
468ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih      */
46914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    int getDataActivationState(int subId, String callingPackage);
47014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
471ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    /**
472ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih      * Returns the unread count of voicemails
473ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih      */
47414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    int getVoiceMessageCount();
475ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih
476ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    /**
477ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * Returns the unread count of voicemails for a subId.
478ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * @param subId user preferred subId.
479ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih     * Returns the unread count of voicemails
48014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
481ebe130923fb1a5b8dda4b3ee215593edcd804f0dRobert Shih    int getVoiceMessageCountForSubscriber(int subId);
48214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
48314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    oneway void setVisualVoicemailEnabled(String callingPackage,
48414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber            in PhoneAccountHandle accountHandle, boolean enabled);
485e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar
486e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    boolean isVisualVoicemailEnabled(String callingPackage,
487e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar            in PhoneAccountHandle accountHandle);
488e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar
489e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    // Not oneway, caller needs to make sure the vaule is set before receiving a SMS
490e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    void enableVisualVoicemailSmsFilter(String callingPackage, int subId,
49125f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang            in VisualVoicemailSmsFilterSettings settings);
492e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar
493e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    oneway void disableVisualVoicemailSmsFilter(String callingPackage, int subId);
4941d15ab58bf8239069ef343de6cb21aabf3ef7d78Lajos Molnar
49514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    // Get settings set by the calling package
49614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    VisualVoicemailSmsFilterSettings getVisualVoicemailSmsFilterSettings(String callingPackage,
49714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber            int subId);
49814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
49914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    // Get settings set by the package, requires READ_PRIVILEGED_PHONE_STATE permission
50014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    VisualVoicemailSmsFilterSettings getSystemVisualVoicemailSmsFilterSettings(String packageName,
50114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber            int subId);
50214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
5035abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
5045abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * Returns the network type for data transmission
5055abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * Legacy call, permission-free
5065abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     */
5075abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    int getNetworkType();
5085abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang
5095abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
5105abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * Returns the network type of a subId.
5115abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param subId user preferred subId.
5125abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param callingPackage package making the call.
5135abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     */
5145abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    int getNetworkTypeForSubscriber(int subId, String callingPackage);
5155abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang
5165abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
5175abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * Returns the network type for data transmission
5185abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param callingPackage package making the call.
5195abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     */
5205abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    int getDataNetworkType(String callingPackage);
5215abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang
5225abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
523a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Returns the data network type of a subId
5245abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param subId user preferred subId.
5255abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param callingPackage package making the call.
5265abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     */
5275abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    int getDataNetworkTypeForSubscriber(int subId, String callingPackage);
5285abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang
529c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang    /**
530c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang      * Returns the voice network type of a subId
53114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber      * @param subId user preferred subId.
53214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber      * @param callingPackage package making the call.
53314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber      * Returns the network type
53414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber      */
5350852843d304006e3ab333081fddda13b07193de8Robert Shih    int getVoiceNetworkTypeForSubscriber(int subId, String callingPackage);
5361543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih
537309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih    /**
538309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * Return true if an ICC card is present
539a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
5401d15ab58bf8239069ef343de6cb21aabf3ef7d78Lajos Molnar    boolean hasIccCard();
54114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
54214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
54314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Return true if an ICC card is present for a subId.
54414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param slotId user preferred slotId.
54514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Return true if an ICC card is present
54614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
54714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean hasIccCardUsingSlotId(int slotId);
54814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
54914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
55014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Return if the current radio is LTE on CDMA. This
55114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * is a tri-state return value as for a period of time
55214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * the mode may be unknown.
55314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
55414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param callingPackage the name of the calling package
55514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
55614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * or {@link PHone#LTE_ON_CDMA_TRUE}
55714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
55814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    int getLteOnCdmaMode(String callingPackage);
5590852843d304006e3ab333081fddda13b07193de8Robert Shih
5600852843d304006e3ab333081fddda13b07193de8Robert Shih    /**
5610852843d304006e3ab333081fddda13b07193de8Robert Shih     * Return if the current radio is LTE on CDMA. This
5620852843d304006e3ab333081fddda13b07193de8Robert Shih     * is a tri-state return value as for a period of time
5630852843d304006e3ab333081fddda13b07193de8Robert Shih     * the mode may be unknown.
56414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
56514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param callingPackage the name of the calling package
566309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
567309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * or {@link PHone#LTE_ON_CDMA_TRUE}
568a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
56914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    int getLteOnCdmaModeForSubscriber(int subId, String callingPackage);
57014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
57114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
5725ef659e010e90175eb5282d9642a02f6105189bfChong Zhang     * Returns the all observed cell information of the device.
5735ef659e010e90175eb5282d9642a02f6105189bfChong Zhang     */
5745ef659e010e90175eb5282d9642a02f6105189bfChong Zhang    List<CellInfo> getAllCellInfo(String callingPkg);
5755ef659e010e90175eb5282d9642a02f6105189bfChong Zhang
5765ef659e010e90175eb5282d9642a02f6105189bfChong Zhang    /**
5775ef659e010e90175eb5282d9642a02f6105189bfChong Zhang     * Sets minimum time in milli-seconds between onCellInfoChanged
5785ef659e010e90175eb5282d9642a02f6105189bfChong Zhang     */
5795abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    void setCellInfoListRate(int rateInMillis);
5805abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang
5815abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
5825abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * get default sim
5831d15ab58bf8239069ef343de6cb21aabf3ef7d78Lajos Molnar     * @return sim id
58414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
58514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    int getDefaultSim();
586309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih
5875abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
588c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     * Opens a logical channel to the ICC card.
5891d15ab58bf8239069ef343de6cb21aabf3ef7d78Lajos Molnar     *
590309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * Input parameters equivalent to TS 27.007 AT+CCHO command.
5915ce50c1931e1e3d8f113394bbe2c9f99354f4c5fRobert Shih     *
59214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId The subscription to use.
59314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param AID Application id. See ETSI 102.221 and 101.220.
5941543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * @return an IccOpenLogicalChannelResponse object.
59525f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     */
59625f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang    IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID);
5971d15ab58bf8239069ef343de6cb21aabf3ef7d78Lajos Molnar
5981543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih    /**
5991543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * Closes a previously opened logical channel to the ICC card.
6001543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     *
6011543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * Input parameters equivalent to TS 27.007 AT+CCHC command.
6025abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     *
6035abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param subId The subscription to use.
6045abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param channel is the channel id to be closed as retruned by a
6055abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     *            successful iccOpenLogicalChannel.
60614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return true if the channel was closed successfully.
60714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
60814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean iccCloseLogicalChannel(int subId, int channel);
60914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
61014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
61114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Transmit an APDU to the ICC card over a logical channel.
61214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
61314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Input parameters equivalent to TS 27.007 AT+CGLA command.
61414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
61514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId The subscription to use.
61614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param channel is the channel id to be closed as retruned by a
61714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *            successful iccOpenLogicalChannel.
61814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param cla Class of the APDU command.
61914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param instruction Instruction of the APDU command.
62014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param p1 P1 value of the APDU command.
62114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param p2 P2 value of the APDU command.
62214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
62314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *            is sent to the SIM.
62414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param data Data to be sent with the APDU.
625a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @return The APDU response from the ICC card with the status appended at
626a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *            the end.
627a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
628a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    String iccTransmitApduLogicalChannel(int subId, int channel, int cla, int instruction,
62914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber            int p1, int p2, int p3, String data);
63014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
63114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
63214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Transmit an APDU to the ICC card over the basic channel.
63314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
63414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Input parameters equivalent to TS 27.007 AT+CSIM command.
6355ce50c1931e1e3d8f113394bbe2c9f99354f4c5fRobert Shih     *
63614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId The subscription to use.
63714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param cla Class of the APDU command.
63814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param instruction Instruction of the APDU command.
63914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param p1 P1 value of the APDU command.
64014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param p2 P2 value of the APDU command.
64114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
64214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *            is sent to the SIM.
6435abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param data Data to be sent with the APDU.
6445abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @return The APDU response from the ICC card with the status appended at
6455abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     *            the end.
6465abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     */
6475abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    String iccTransmitApduBasicChannel(int subId, int cla, int instruction,
6485abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang            int p1, int p2, int p3, String data);
6495abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang
6505abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
6515abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * Returns the response APDU for a command APDU sent through SIM_IO.
6525abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     *
6535abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param subId The subscription to use.
6545abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param fileID
6555abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param command
65614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param p1 P1 value of the APDU command.
6571543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * @param p2 P2 value of the APDU command.
658a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * @param p3 P3 value of the APDU command.
659a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * @param filePath
660a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * @return The APDU response.
661a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     */
662a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    byte[] iccExchangeSimIO(int subId, int fileID, int command, int p1, int p2, int p3,
663a44153c1a57202fb538659eb50706e60454d6273Andreas Huber            String filePath);
664a44153c1a57202fb538659eb50706e60454d6273Andreas Huber
665a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    /**
666a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * Send ENVELOPE to the SIM and returns the response.
6671543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     *
6681543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * @param subId The subscription to use.
6691543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * @param contents  String containing SAT/USAT response in hexadecimal
6701543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     *                  format starting with command tag. See TS 102 223 for
6711543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     *                  details.
6721543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * @return The APDU response from the ICC card, with the last 4 bytes
6731543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     *         being the status word. If the command fails, returns an empty
6741543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     *         string.
6751543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     */
6761543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih    String sendEnvelopeWithStatus(int subId, String content);
6771543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih
67814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
67914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
68014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Used for device configuration by some CDMA operators.
68114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
68214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param itemID the ID of the item to read.
68314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return the NV item as a String, or null on any failure.
68414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
68514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    String nvReadItem(int itemID);
68614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
68714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
688c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
689c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     * Used for device configuration by some CDMA operators.
690c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     *
691a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param itemID the ID of the item to read.
69214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param itemValue the value to write, as a String.
69314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return true on success; false on any failure.
69414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
69514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean nvWriteItem(int itemID, String itemValue);
69614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
697309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih    /**
698309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
699a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Used for device configuration by some CDMA operators.
70014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
701309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * @param preferredRoamingList byte array containing the new PRL.
702309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * @return true on success; false on any failure.
703a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
70414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean nvWriteCdmaPrl(in byte[] preferredRoamingList);
70514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
70614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
70714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Perform the specified type of NV config reset. The radio will be taken offline
70814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * and the device must be rebooted after the operation. Used for device
70914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * configuration by some CDMA operators.
71014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
71114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param resetType the type of reset to perform (1 == factory reset; 2 == NV-only reset).
71214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return true on success; false on any failure.
71314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
71414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean nvResetConfig(int resetType);
71514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
71614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /*
71714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Get the calculated preferred network type.
71814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Used for device configuration by some CDMA operators.
71914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param callingPackage The package making the call.
72014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
72114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return the calculated preferred network type, defined in RILConstants.java.
72214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
72314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    int getCalculatedPreferredNetworkType(String callingPackage);
72414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
72514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /*
72614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Get the preferred network type.
72714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Used for device configuration by some CDMA operators.
72814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
72914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId the id of the subscription to query.
73014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return the preferred network type, defined in RILConstants.java.
73114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
7320852843d304006e3ab333081fddda13b07193de8Robert Shih    int getPreferredNetworkType(int subId);
7330852843d304006e3ab333081fddda13b07193de8Robert Shih
7340852843d304006e3ab333081fddda13b07193de8Robert Shih    /**
7350852843d304006e3ab333081fddda13b07193de8Robert Shih     * Check TETHER_DUN_REQUIRED and TETHER_DUN_APN settings, net.tethering.noprovisioning
7360852843d304006e3ab333081fddda13b07193de8Robert Shih     * SystemProperty, and config_tether_apndata to decide whether DUN APN is required for
7370852843d304006e3ab333081fddda13b07193de8Robert Shih     * tethering.
73814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
73914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return 0: Not required. 1: required. 2: Not set.
74014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
74114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    int getTetherApnRequired();
742309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih
743309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih    /**
7447c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     *  Get ImsServiceController binder from ImsResolver that corresponds to the subId and feature
7457c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     *  requested as well as registering the ImsServiceController for callbacks using the
7467c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     *  IImsServiceFeatureListener interface.
7477c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     */
74814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    IImsServiceController getImsServiceControllerAndListen(int slotId, int feature,
749c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang                IImsServiceFeatureListener callback);
750a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
751c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang    /**
7527c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * Set the network selection mode to automatic.
7537c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     *
7547c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @param subId the id of the subscription to update.
7557c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     */
7567c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    void setNetworkSelectionModeAutomatic(int subId);
7577c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang
7580f9a3cf9962b6859cfee9d4bf4676b5aafca79cbRobert Shih    /**
7590f9a3cf9962b6859cfee9d4bf4676b5aafca79cbRobert Shih     * Perform a radio scan and return the list of avialble networks.
760c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     *
76114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId the id of the subscription.
762c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     * @return CellNetworkScanResult containing status of scan and networks.
763a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
7641543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih    CellNetworkScanResult getCellNetworkScanResults(int subId);
7651543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih
76614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
76714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Ask the radio to connect to the input network and change selection mode to manual.
76814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
76914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId the id of the subscription.
77014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param operatorInfo the operator to attach to.
77114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param persistSelection should the selection persist till reboot or its
77214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *        turned off? Will also result in notification being not shown to
773c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     *        the user if the signal is lost.
774c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     * @return true if the request suceeded.
7755abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     */
7761543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih    boolean setNetworkSelectionModeManual(int subId, in OperatorInfo operator,
7771543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih            boolean persistSelection);
7785ce50c1931e1e3d8f113394bbe2c9f99354f4c5fRobert Shih
7791543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih    /**
78014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Set the preferred network type.
781309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * Used for device configuration by some CDMA operators.
782309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     *
783309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * @param subId the id of the subscription to update.
7845ce50c1931e1e3d8f113394bbe2c9f99354f4c5fRobert Shih     * @param networkType the preferred network type, defined in RILConstants.java.
7855ce50c1931e1e3d8f113394bbe2c9f99354f4c5fRobert Shih     * @return true on success; false on any failure.
7865ce50c1931e1e3d8f113394bbe2c9f99354f4c5fRobert Shih     */
7875ce50c1931e1e3d8f113394bbe2c9f99354f4c5fRobert Shih    boolean setPreferredNetworkType(int subId, int networkType);
7885ce50c1931e1e3d8f113394bbe2c9f99354f4c5fRobert Shih
7895ce50c1931e1e3d8f113394bbe2c9f99354f4c5fRobert Shih    /**
790a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * User enable/disable Mobile Data.
79114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
79214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param enable true to turn on, else false
793c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     */
7945abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    void setDataEnabled(int subId, boolean enable);
79514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
79614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
7971543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * Get the user enabled state of Mobile Data.
7981543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     *
7991543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * @return true on enabled
8001543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     */
8011543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih    boolean getDataEnabled(int subId);
8021543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih
8031543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih    /**
8041543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * Get P-CSCF address from PCO after data connection is established or modified.
805964adb17885185808398507d2de88665fe193ee2Chong Zhang     * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN
8061543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * @param callingPackage The package making the call.
8071543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     */
80814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    String[] getPcscfAddress(String apnType, String callingPackage);
80914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
8107c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    /**
8117c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * Set IMS registration state
8127c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     */
8137c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    void setImsRegistrationState(boolean registered);
8147c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang
8157c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    /**
81614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Return MDN string for CDMA phone.
81714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId user preferred subId.
81814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
81914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    String getCdmaMdn(int subId);
82014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
82114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
82214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Return MIN string for CDMA phone.
82314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId user preferred subId.
82414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
82514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    String getCdmaMin(int subId);
826632740c58119a132ce19f6d498e39c5c3773971aChong Zhang
827632740c58119a132ce19f6d498e39c5c3773971aChong Zhang    /**
828632740c58119a132ce19f6d498e39c5c3773971aChong Zhang     * Has the calling application been granted special privileges by the carrier.
829632740c58119a132ce19f6d498e39c5c3773971aChong Zhang     *
83014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * If any of the packages in the calling UID has carrier privileges, the
83114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * call will return true. This access is granted by the owner of the UICC
83214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * card and does not depend on the registered carrier.
83314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
8347c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * TODO: Add a link to documentation.
8357c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     *
8367c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @param subId The subscription to use.
8377c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @return carrier privilege status defined in TelephonyManager.
8387c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     */
839e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    int getCarrierPrivilegeStatus(int subId);
840e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar
841e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    /**
842978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * Similar to above, but check for the package whose name is pkgName.
843e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     */
844e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    int checkCarrierPrivilegesForPackage(String pkgName);
845e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar
846538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang    /**
84714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Similar to above, but check across all phones.
84814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
84914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    int checkCarrierPrivilegesForPackageAnyPhone(String pkgName);
85014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
851e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    /**
852dcb89b3b505522efde173c105a851c412f947178Chong Zhang     * Returns list of the package names of the carrier apps that should handle the input intent
85314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * and have carrier privileges for the given phoneId.
854538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     *
855538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * @param intent Intent that will be sent.
856538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * @param phoneId The phoneId on which the carrier app has carrier privileges.
857538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * @return list of carrier app package names that can handle the intent on phoneId.
858538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     *         Returns null if there is an error and an empty list if there
85914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *         are no matching packages.
860538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     */
861538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang    List<String> getCarrierPackageNamesForIntentAndPhone(in Intent intent, int phoneId);
86214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
86314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
86414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Set the line 1 phone number string and its alphatag for the current ICCID
865e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     * for display purpose only, for example, displayed in Phone Status. It won't
86614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * change the actual MSISDN/MDN. To unset alphatag or number, pass in a null
86725f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * value.
86825f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     *
86925f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * @param subId the subscriber that the alphatag and dialing number belongs to.
870538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * @param alphaTag alpha-tagging of the dailing nubmer
871538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * @param number The dialing number
872e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     * @return true if the operation was executed correctly.
87314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
87414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean setLine1NumberForDisplayForSubscriber(int subId, String alphaTag, String number);
875538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang
876538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang    /**
877538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * Returns the displayed dialing number string if it was set previously via
87814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * {@link #setLine1NumberForDisplay}. Otherwise returns null.
87914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
880538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * @param subId whose dialing number for line 1 is returned.
88125f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * @param callingPackage The package making the call.
88225f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * @return the displayed dialing number if set, or null if not set.
88325f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     */
8841543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih    String getLine1NumberForDisplay(int subId, String callingPackage);
8851543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih
8861543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih    /**
8871d15ab58bf8239069ef343de6cb21aabf3ef7d78Lajos Molnar     * Returns the displayed alphatag of the dialing number if it was set
8881543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     * previously via {@link #setLine1NumberForDisplay}. Otherwise returns null.
8891543d3c735a5ba4ddfcf8ab644575df13c7e30a9Robert Shih     *
89014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId whose alphatag associated with line 1 is returned.
891538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * @param callingPackage The package making the call.
892538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * @return the displayed alphatag of the dialing number if set, or null if
893538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     *         not set.
894538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     */
895538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang    String getLine1AlphaTagForDisplay(int subId, String callingPackage);
896538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang
897538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang    String[] getMergedSubscriberIds(String callingPackage);
89825f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang
89925f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang    /**
90025f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * Override the operator branding for the current ICCID.
90125f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     *
90225f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * Once set, whenever the SIM is present in the device, the service
90325f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * provider name (SPN) and the operator name will both be replaced by the
904538b6d22a3578c0201d48f8548289aa254d81484Chong Zhang     * brand value input. To unset the value, the same function should be
90514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * called with a null brand value.
90614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
90714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * <p>Requires Permission:
908e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
909e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     *  or has to be carrier app - see #hasCarrierPrivileges.
91014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
9115abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param subId The subscription to use.
91214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param brand The brand name to display/set.
91314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return true if the operation was executed correctly.
9147e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber     */
9157e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    boolean setOperatorBrandOverride(int subId, String brand);
9167e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber
9177e43a5a2dcfa9bc64ef477472a33c87a84695c09Andreas Huber    /**
91814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Override the roaming indicator for the current ICCID.
91914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
92014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Using this call, the carrier app (see #hasCarrierPrivileges) can override
92114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * the platform's notion of a network operator being considered roaming or not.
92214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * The change only affects the ICCID that was active when this call was made.
923daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     *
924e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     * If null is passed as any of the input, the corresponding value is deleted.
92514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
92614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * <p>Requires that the caller have carrier privilege. See #hasCarrierPrivileges.
92714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
92814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param subId for which the roaming overrides apply.
92914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param gsmRoamingList - List of MCCMNCs to be considered roaming for 3GPP RATs.
93014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param gsmNonRoamingList - List of MCCMNCs to be considered not roaming for 3GPP RATs.
93114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param cdmaRoamingList - List of SIDs to be considered roaming for 3GPP2 RATs.
93214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param cdmaNonRoamingList - List of SIDs to be considered not roaming for 3GPP2 RATs.
9337c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @return true if the operation was executed correctly.
9347c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     */
9357c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    boolean setRoamingOverride(int subId, in List<String> gsmRoamingList,
9367c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang            in List<String> gsmNonRoamingList, in List<String> cdmaRoamingList,
9377c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang            in List<String> cdmaNonRoamingList);
9387c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang
9397c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    /**
940978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * Returns the result and response from RIL for oem request
94114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
94214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param oemReq the data is sent to ril.
94314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @param oemResp the respose data from RIL.
94414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return negative value request was not handled or get error
945e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     *         0 request was handled succesfully, but no response data
946e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     *         positive value success, data length of response
947e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     */
94843ca783effd99bba0e6e2dd6fe177a8888578ef8Robert Shih    int invokeOemRilRequestRaw(in byte[] oemReq, out byte[] oemResp);
94943ca783effd99bba0e6e2dd6fe177a8888578ef8Robert Shih
95043ca783effd99bba0e6e2dd6fe177a8888578ef8Robert Shih    /**
95143ca783effd99bba0e6e2dd6fe177a8888578ef8Robert Shih     * Check if any mobile Radios need to be shutdown.
95243ca783effd99bba0e6e2dd6fe177a8888578ef8Robert Shih     *
9537c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @return true is any mobile radio needs to be shutdown
954a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
955a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    boolean needMobileRadioShutdown();
956a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
957a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
958a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Shutdown Mobile Radios
959a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
9605abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    void shutdownMobileRadios();
961a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
9625abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
963a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Set phone radio type and access technology.
964a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
9655abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * @param rafs an RadioAccessFamily array to indicate all phone's
966a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *        new radio access family. The length of RadioAccessFamily
967a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *        must equ]]al to phone count.
968a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
969a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    void setRadioCapability(in RadioAccessFamily[] rafs);
970a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
971a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
972a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Get phone radio type and access technology.
973a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
974a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param phoneId which phone you want to get
975a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param callingPackage the name of the package making the call
976a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @return phone radio type and access technology
977a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
978a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    int getRadioAccessFamily(in int phoneId, String callingPackage);
979a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
980a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
981a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Enables or disables video calling.
982a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
983a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param enable Whether to enable video calling.
984a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
985a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    void enableVideoCalling(boolean enable);
986a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
987a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
988a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Whether video calling has been enabled by the user.
989a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
990a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @param callingPackage The package making the call.
991a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @return {@code true} if the user has enabled video calling, {@code false} otherwise.
992a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
993a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    boolean isVideoCallingEnabled(String callingPackage);
99425f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang
9955abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang    /**
9965abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     * Whether the DTMF tone length can be changed.
9975abbd3dcbb0bb32a3d4b90dddbcf90458967eb6fChong Zhang     *
99825f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * @return {@code true} if the DTMF tone length can be changed.
99925f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     */
100025f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang    boolean canChangeDtmfToneLength();
100125f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang
100225f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang    /**
1003a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Whether the device is a world phone.
1004a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *
1005a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * @return {@code true} if the devices is a world phone.
1006a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
1007a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    boolean isWorldPhone();
1008a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
100972433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    /**
101072433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * Whether the phone supports TTY mode.
101172433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     *
101272433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * @return {@code true} if the device supports TTY mode.
101372433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     */
101472433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    boolean isTtyModeSupported();
101572433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé
101672433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    /**
101772433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * Whether the phone supports hearing aid compatibility.
101872433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     *
101972433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * @return {@code true} if the device supports hearing aid compatibility.
102072433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     */
102172433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    boolean isHearingAidCompatibilitySupported();
102272433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé
102372433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    /**
102472433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * Get IMS Registration Status
102572433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     */
102672433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    boolean isImsRegistered();
102772433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé
102872433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    /**
102972433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * Returns the Status of Wi-Fi Calling
103072433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     */
103172433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    boolean isWifiCallingAvailable();
103272433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé
103372433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    /**
103472433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * Returns the Status of Volte
103572433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     */
103672433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé    boolean isVolteAvailable();
103772433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé
103872433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     /**
103972433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * Returns the Status of VT (video telephony)
104072433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     */
1041a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    boolean isVideoTelephonyAvailable();
1042a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang
1043a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    /**
1044a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang      * Returns the unique device ID of phone, for example, the IMEI for
1045a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
1046daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih      *
1047a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang      * @param callingPackage The package making the call.
1048a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang      * <p>Requires Permission:
1049632740c58119a132ce19f6d498e39c5c3773971aChong Zhang      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
105014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber      */
1051daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih    String getDeviceId(String callingPackage);
1052978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang
1053978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang    /**
105414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Returns the IMEI for the given slot.
1055daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     *
1056daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     * @param slotId - device slot.
1057daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     * @param callingPackage The package making the call.
1058309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * <p>Requires Permission:
1059309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1060a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     */
1061a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    String getImeiForSlot(int slotId, String callingPackage);
1062daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih
106314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
106414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Returns the device software version.
1065309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     *
1066309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * @param slotId - device slot.
106772433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * @param callingPackage The package making the call.
106872433b083ccfa3ab55374305b1c2960982ac3e09Oscar Rydhé     * <p>Requires Permission:
1069309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
1070afcc4fcbb3a094ec2221d6e523772e76894d1f00Robert Shih     */
1071afcc4fcbb3a094ec2221d6e523772e76894d1f00Robert Shih    String getDeviceSoftwareVersionForSlot(int slotId, String callingPackage);
1072afcc4fcbb3a094ec2221d6e523772e76894d1f00Robert Shih
1073309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih    /**
1074309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * Returns the subscription ID associated with the specified PhoneAccount.
1075309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     */
1076309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih    int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
107725f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang
107825f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang    void factoryReset(int subId);
1079e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar
108014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
1081afcc4fcbb3a094ec2221d6e523772e76894d1f00Robert Shih     * An estimate of the users's current locale based on the default SIM.
1082afcc4fcbb3a094ec2221d6e523772e76894d1f00Robert Shih     *
1083afcc4fcbb3a094ec2221d6e523772e76894d1f00Robert Shih     * The returned string will be a well formed BCP-47 language tag, or {@code null}
1084afcc4fcbb3a094ec2221d6e523772e76894d1f00Robert Shih     * if no locale could be derived.
1085d47dfcb5a2e5901c96fc92662cec7aa30f7f8843Chong Zhang     */
1086d47dfcb5a2e5901c96fc92662cec7aa30f7f8843Chong Zhang    String getLocaleFromDefaultSim();
1087309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih
1088978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang    /**
1089978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * Requests the modem activity info asynchronously.
1090978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * The implementor is expected to reply with the
1091978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * {@link android.telephony.ModemActivityInfo} object placed into the Bundle with the key
1092978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * {@link android.telephony.TelephonyManager#MODEM_ACTIVITY_RESULT_KEY}.
1093978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * The result code is ignored.
1094978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     */
1095978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang    oneway void requestModemActivityInfo(in ResultReceiver result);
1096978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang
1097309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih    /**
1098309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * Get the service state on specified subscription
1099309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * @param subId Subscription id
1100309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * @param callingPackage The package making the call
1101309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * @return Service state on specified subscription.
1102309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     */
1103b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber    ServiceState getServiceStateForSubscriber(int subId, String callingPackage);
1104b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber
1105b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber    /**
1106309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * Returns the URI for the per-account voicemail ringtone set in Phone settings.
1107309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     *
1108309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
1109309aa8bf5e4cd66fe988adf2654cac3fadc2a1c3Robert Shih     * voicemail ringtone.
111025f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang     * @return The URI for the ringtone to play when receiving a voicemail from a specific
1111e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     * PhoneAccount.
1112e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     */
111314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    Uri getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle);
111414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber
111514f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
1116daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     * Returns whether vibration is set for voicemail notification in Phone settings.
111714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
1118daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
1119daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     * voicemail vibration setting.
1120daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
112114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
112214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    boolean isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle);
1123daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih
1124daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih    /**
1125daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     * Returns a list of packages that have carrier privileges.
1126daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     */
1127e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    List<String> getPackagesWithCarrierPrivileges();
1128e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar
1129daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih    /**
1130978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * Return the application ID for the app type.
1131978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     *
1132978449984366946a2e5c9f7cf350746f4306caf8Chong Zhang     * @param subId the subscription ID that this request applies to.
1133daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih     * @param appType the uicc app type,
1134e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     * @return Application ID for specificied app type or null if no uicc or error.
1135e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar     */
1136e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    String getAidForAppType(int subId, int appType);
113725f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang
113825f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang    /**
1139e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    * Return the Electronic Serial Number.
114025f82752942b1c78aec8ee303d61afff85cff9d1Chong Zhang    *
1141e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
1142a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    *
114314f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    * @param subId the subscription ID that this request applies to.
114414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    * @return ESN or null if error.
1145daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih    * @hide
1146daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih    */
1147a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang    String getEsn(int subId);
1148daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih
1149daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih    /**
1150daad5b2f4a6bb46a7911661e398278d6a80d7093Robert Shih    * Return the Preferred Roaming List Version
115114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    *
115214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    * Requires that the calling app has READ_PRIVILEGED_PHONE_STATE permission
1153e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    * @param subId the subscription ID that this request applies to.
1154e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    * @return PRLVersion or null if error.
1155e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    * @hide
1156e175e5ec1636fc638465187f3d5c6166d92388edLajos Molnar    */
115795697aecd644ffcfbe7fe828e9e42bfab71b75a5Robert Shih    String getCdmaPrlVersion(int subId);
115895697aecd644ffcfbe7fe828e9e42bfab71b75a5Robert Shih
115995697aecd644ffcfbe7fe828e9e42bfab71b75a5Robert Shih    /**
116095697aecd644ffcfbe7fe828e9e42bfab71b75a5Robert Shih     * Get snapshot of Telephony histograms
116195697aecd644ffcfbe7fe828e9e42bfab71b75a5Robert Shih     * @return List of Telephony histograms
11627c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * Requires Permission:
1163a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
116495697aecd644ffcfbe7fe828e9e42bfab71b75a5Robert Shih     * Or the calling app has carrier privileges.
1165b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber     */
1166b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber    List<TelephonyHistogram> getTelephonyHistograms();
1167b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber
1168b7c8e91880463ff4981e3e53e98e45d68e2fe374Andreas Huber    /**
1169632740c58119a132ce19f6d498e39c5c3773971aChong Zhang     * Set the allowed carrier list for slotId
117014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Require system privileges. In the future we may add this to carrier APIs.
117114f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     *
117214f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return The number of carriers set successfully. Should match length of
11737c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * carriers on success.
11744f601e8c9a9203aab38e0c6ac61b9fa65effcd33Robert Shih     */
11754f601e8c9a9203aab38e0c6ac61b9fa65effcd33Robert Shih    int setAllowedCarriers(int slotId, in List<CarrierIdentifier> carriers);
11764f601e8c9a9203aab38e0c6ac61b9fa65effcd33Robert Shih
11774f601e8c9a9203aab38e0c6ac61b9fa65effcd33Robert Shih    /**
11784f601e8c9a9203aab38e0c6ac61b9fa65effcd33Robert Shih     * Get the allowed carrier list for slotId.
11794f601e8c9a9203aab38e0c6ac61b9fa65effcd33Robert Shih     * Require system privileges. In the future we may add this to carrier APIs.
11804f601e8c9a9203aab38e0c6ac61b9fa65effcd33Robert Shih     *
11817c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @return List of {@link android.service.carrier.CarrierIdentifier}; empty list
11827c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * means all carriers are allowed.
11837c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     */
11847c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    List<CarrierIdentifier> getAllowedCarriers(int slotId);
11857c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang
1186aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih    /**
1187aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih     * Action set from carrier signalling broadcast receivers to enable/disable metered apns
1188aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih     * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
1189aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih     * @param subId the subscription ID that this action applies to.
1190aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih     * @param enabled control enable or disable metered apns.
1191aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih     * @hide
1192aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih     */
1193aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih    void carrierActionSetMeteredApnsEnabled(int subId, boolean visible);
1194aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih
1195aabbdc7401ae24a4199f12a283985deb648673c0Robert Shih    /**
11967c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * Action set from carrier signalling broadcast receivers to enable/disable radio
11977c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
11987c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @param subId the subscription ID that this action applies to.
11997c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @param enabled control enable or disable radio.
12007c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     * @hide
12017c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang     */
12027c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang    void carrierActionSetRadioEnabled(int subId, boolean enabled);
12037c8708046117e03c0d38006bdd9685139df3ac6bChong Zhang
120414f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    /**
1205a48d372833ccec13c96ece9efcc226e8beac7f59Chong Zhang     * Get aggregated video call data usage since boot.
120614f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * Permissions android.Manifest.permission.READ_NETWORK_USAGE_HISTORY is required.
120714f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @return total data usage in bytes
120814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     * @hide
120914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber     */
121014f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    long getVtDataUsage();
1211a44153c1a57202fb538659eb50706e60454d6273Andreas Huber
1212a44153c1a57202fb538659eb50706e60454d6273Andreas Huber    /**
1213a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * Policy control of data connection. Usually used when data limit is passed.
1214a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * @param enabled True if enabling the data, otherwise disabling.
1215a44153c1a57202fb538659eb50706e60454d6273Andreas Huber     * @param subId Subscription index
1216c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     * @hide
1217c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang     */
121814f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber    void setPolicyDataEnabled(boolean enabled, int subId);
121914f7672b5d450ed26a06fd3bb3ce045ea78b11b2Andreas Huber}
1220c4547ba77f78632172db3647a09659d9863d3b5cChong Zhang