ITelephony.aidl revision fda1855eaa61daad528cb444e99d0fc5195a7bd1
1/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.internal.telephony;
18
19import android.content.ComponentName;
20import android.os.Bundle;
21import android.telephony.CellInfo;
22import android.telephony.NeighboringCellInfo;
23
24import java.util.List;
25
26import java.util.List;
27
28/**
29 * Interface used to interact with the phone.  Mostly this is used by the
30 * TelephonyManager class.  A few places are still using this directly.
31 * Please clean them up if possible and use TelephonyManager insteadl.
32 *
33 * {@hide}
34 */
35interface ITelephony {
36
37    /**
38     * Dial a number. This doesn't place the call. It displays
39     * the Dialer screen.
40     * @param number the number to be dialed. If null, this
41     * would display the Dialer screen with no number pre-filled.
42     */
43    void dial(String number);
44
45    /**
46     * Place a call to the specified number.
47     * @param number the number to be called.
48     */
49    void call(String callingPackage, String number);
50
51    /**
52     * If there is currently a call in progress, show the call screen.
53     * The DTMF dialpad may or may not be visible initially, depending on
54     * whether it was up when the user last exited the InCallScreen.
55     *
56     * @return true if the call screen was shown.
57     */
58    boolean showCallScreen();
59
60    /**
61     * Variation of showCallScreen() that also specifies whether the
62     * DTMF dialpad should be initially visible when the InCallScreen
63     * comes up.
64     *
65     * @param showDialpad if true, make the dialpad visible initially,
66     *                    otherwise hide the dialpad initially.
67     * @return true if the call screen was shown.
68     *
69     * @see showCallScreen
70     */
71    boolean showCallScreenWithDialpad(boolean showDialpad);
72
73    /**
74     * End call if there is a call in progress, otherwise does nothing.
75     *
76     * @return whether it hung up
77     */
78    boolean endCall();
79
80    /**
81     * Answer the currently-ringing call.
82     *
83     * If there's already a current active call, that call will be
84     * automatically put on hold.  If both lines are currently in use, the
85     * current active call will be ended.
86     *
87     * TODO: provide a flag to let the caller specify what policy to use
88     * if both lines are in use.  (The current behavior is hardwired to
89     * "answer incoming, end ongoing", which is how the CALL button
90     * is specced to behave.)
91     *
92     * TODO: this should be a oneway call (especially since it's called
93     * directly from the key queue thread).
94     */
95    void answerRingingCall();
96
97    /**
98     * Silence the ringer if an incoming call is currently ringing.
99     * (If vibrating, stop the vibrator also.)
100     *
101     * It's safe to call this if the ringer has already been silenced, or
102     * even if there's no incoming call.  (If so, this method will do nothing.)
103     *
104     * TODO: this should be a oneway call too (see above).
105     *       (Actually *all* the methods here that return void can
106     *       probably be oneway.)
107     */
108    void silenceRinger();
109
110    /**
111     * Check if we are in either an active or holding call
112     * @return true if the phone state is OFFHOOK.
113     */
114    boolean isOffhook();
115
116    /**
117     * Check if an incoming phone call is ringing or call waiting.
118     * @return true if the phone state is RINGING.
119     */
120    boolean isRinging();
121
122    /**
123     * Check if the phone is idle.
124     * @return true if the phone state is IDLE.
125     */
126    boolean isIdle();
127
128    /**
129     * Check to see if the radio is on or not.
130     * @return returns true if the radio is on.
131     */
132    boolean isRadioOn();
133
134    /**
135     * Check if the SIM pin lock is enabled.
136     * @return true if the SIM pin lock is enabled.
137     */
138    boolean isSimPinEnabled();
139
140    /**
141     * Cancels the missed calls notification.
142     */
143    void cancelMissedCallsNotification();
144
145    /**
146     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
147     * @param pin The pin to check.
148     * @return whether the operation was a success.
149     */
150    boolean supplyPin(String pin);
151
152    /**
153     * Supply puk to unlock the SIM and set SIM pin to new pin.
154     *  Blocks until a result is determined.
155     * @param puk The puk to check.
156     *        pin The new pin to be set in SIM
157     * @return whether the operation was a success.
158     */
159    boolean supplyPuk(String puk, String pin);
160
161    /**
162     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
163     * Returns a specific success/error code.
164     * @param pin The pin to check.
165     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
166     *         retValue[1] = number of attempts remaining if known otherwise -1
167     */
168    int[] supplyPinReportResult(String pin);
169
170    /**
171     * Supply puk to unlock the SIM and set SIM pin to new pin.
172     * Blocks until a result is determined.
173     * Returns a specific success/error code
174     * @param puk The puk to check
175     *        pin The pin to check.
176     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
177     *         retValue[1] = number of attempts remaining if known otherwise -1
178     */
179    int[] supplyPukReportResult(String puk, String pin);
180
181    /**
182     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
183     * without SEND (so <code>dial</code> is not appropriate).
184     *
185     * @param dialString the MMI command to be executed.
186     * @return true if MMI command is executed.
187     */
188    boolean handlePinMmi(String dialString);
189
190    /**
191     * Toggles the radio on or off.
192     */
193    void toggleRadioOnOff();
194
195    /**
196     * Set the radio to on or off
197     */
198    boolean setRadio(boolean turnOn);
199
200    /**
201     * Set the radio to on or off unconditionally
202     */
203    boolean setRadioPower(boolean turnOn);
204
205    /**
206     * Request to update location information in service state
207     */
208    void updateServiceLocation();
209
210    /**
211     * Enable location update notifications.
212     */
213    void enableLocationUpdates();
214
215    /**
216     * Disable location update notifications.
217     */
218    void disableLocationUpdates();
219
220    /**
221     * Enable a specific APN type.
222     */
223    int enableApnType(String type);
224
225    /**
226     * Disable a specific APN type.
227     */
228    int disableApnType(String type);
229
230    /**
231     * Allow mobile data connections.
232     */
233    boolean enableDataConnectivity();
234
235    /**
236     * Disallow mobile data connections.
237     */
238    boolean disableDataConnectivity();
239
240    /**
241     * Report whether data connectivity is possible.
242     */
243    boolean isDataConnectivityPossible();
244
245    Bundle getCellLocation();
246
247    /**
248     * Returns the neighboring cell information of the device.
249     */
250    List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg);
251
252     int getCallState();
253     int getDataActivity();
254     int getDataState();
255
256    /**
257     * Returns the current active phone type as integer.
258     * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
259     * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
260     */
261    int getActivePhoneType();
262
263    /**
264     * Returns the CDMA ERI icon index to display
265     */
266    int getCdmaEriIconIndex();
267
268    /**
269     * Returns the CDMA ERI icon mode,
270     * 0 - ON
271     * 1 - FLASHING
272     */
273    int getCdmaEriIconMode();
274
275    /**
276     * Returns the CDMA ERI text,
277     */
278    String getCdmaEriText();
279
280    /**
281     * Returns true if OTA service provisioning needs to run.
282     * Only relevant on some technologies, others will always
283     * return false.
284     */
285    boolean needsOtaServiceProvisioning();
286
287    /**
288      * Returns the unread count of voicemails
289      */
290    int getVoiceMessageCount();
291
292    /**
293      * Returns the network type for data transmission
294      */
295    int getNetworkType();
296
297    /**
298      * Returns the network type for data transmission
299      */
300    int getDataNetworkType();
301
302    /**
303      * Returns the network type for voice
304      */
305    int getVoiceNetworkType();
306
307    /**
308     * Return true if an ICC card is present
309     */
310    boolean hasIccCard();
311
312    /**
313     * Return if the current radio is LTE on CDMA. This
314     * is a tri-state return value as for a period of time
315     * the mode may be unknown.
316     *
317     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
318     * or {@link PHone#LTE_ON_CDMA_TRUE}
319     */
320    int getLteOnCdmaMode();
321
322    /**
323     * Returns the all observed cell information of the device.
324     */
325    List<CellInfo> getAllCellInfo();
326
327    /**
328     * Sets minimum time in milli-seconds between onCellInfoChanged
329     */
330    void setCellInfoListRate(int rateInMillis);
331
332    /**
333     * User enable/disable Mobile Data.
334     *
335     * @param enable true to turn on, else false
336     */
337    void setDataEnabled(boolean enable);
338
339    /**
340     * Get the user enabled state of Mobile Data.
341     *
342     * @return true on enabled
343     */
344    boolean getDataEnabled();
345}
346
347