ITelephony.aidl revision 98c7781ca89348992e3cb455e83cbc774bbe4d3e
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.os.Bundle;
20import java.util.List;
21import android.telephony.NeighboringCellInfo;
22
23/**
24 * Interface used to interact with the phone.  Mostly this is used by the
25 * TelephonyManager class.  A few places are still using this directly.
26 * Please clean them up if possible and use TelephonyManager insteadl.
27 *
28 * {@hide}
29 */
30interface ITelephony {
31
32    /**
33     * Dial a number. This doesn't place the call. It displays
34     * the Dialer screen.
35     * @param number the number to be dialed. If null, this
36     * would display the Dialer screen with no number pre-filled.
37     */
38    void dial(String number);
39
40    /**
41     * Place a call to the specified number.
42     * @param number the number to be called.
43     */
44    void call(String number);
45
46    /**
47     * If there is currently a call in progress, show the call screen.
48     * The DTMF dialpad may or may not be visible initially, depending on
49     * whether it was up when the user last exited the InCallScreen.
50     *
51     * @return true if the call screen was shown.
52     */
53    boolean showCallScreen();
54
55    /**
56     * Variation of showCallScreen() that also specifies whether the
57     * DTMF dialpad should be initially visible when the InCallScreen
58     * comes up.
59     *
60     * @param showDialpad if true, make the dialpad visible initially,
61     *                    otherwise hide the dialpad initially.
62     * @return true if the call screen was shown.
63     *
64     * @see showCallScreen
65     */
66    boolean showCallScreenWithDialpad(boolean showDialpad);
67
68    /**
69     * End call if there is a call in progress, otherwise does nothing.
70     *
71     * @return whether it hung up
72     */
73    boolean endCall();
74
75    /**
76     * Answer the currently-ringing call.
77     *
78     * If there's already a current active call, that call will be
79     * automatically put on hold.  If both lines are currently in use, the
80     * current active call will be ended.
81     *
82     * TODO: provide a flag to let the caller specify what policy to use
83     * if both lines are in use.  (The current behavior is hardwired to
84     * "answer incoming, end ongoing", which is how the CALL button
85     * is specced to behave.)
86     *
87     * TODO: this should be a oneway call (especially since it's called
88     * directly from the key queue thread).
89     */
90    void answerRingingCall();
91
92    /**
93     * Silence the ringer if an incoming call is currently ringing.
94     * (If vibrating, stop the vibrator also.)
95     *
96     * It's safe to call this if the ringer has already been silenced, or
97     * even if there's no incoming call.  (If so, this method will do nothing.)
98     *
99     * TODO: this should be a oneway call too (see above).
100     *       (Actually *all* the methods here that return void can
101     *       probably be oneway.)
102     */
103    void silenceRinger();
104
105    /**
106     * Check if we are in either an active or holding call
107     * @return true if the phone state is OFFHOOK.
108     */
109    boolean isOffhook();
110
111    /**
112     * Check if an incoming phone call is ringing or call waiting.
113     * @return true if the phone state is RINGING.
114     */
115    boolean isRinging();
116
117    /**
118     * Check if the phone is idle.
119     * @return true if the phone state is IDLE.
120     */
121    boolean isIdle();
122
123    /**
124     * Check to see if the radio is on or not.
125     * @return returns true if the radio is on.
126     */
127    boolean isRadioOn();
128
129    /**
130     * Check if the SIM pin lock is enabled.
131     * @return true if the SIM pin lock is enabled.
132     */
133    boolean isSimPinEnabled();
134
135    /**
136     * Cancels the missed calls notification.
137     */
138    void cancelMissedCallsNotification();
139
140    /**
141     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
142     * @param pin The pin to check.
143     * @return whether the operation was a success.
144     */
145    boolean supplyPin(String pin);
146
147    /**
148     * Supply puk to unlock the SIM and set SIM pin to new pin.
149     *  Blocks until a result is determined.
150     * @param puk The puk to check.
151     *        pin The new pin to be set in SIM
152     * @return whether the operation was a success.
153     */
154    boolean supplyPuk(String puk, String pin);
155
156    /**
157     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
158     * without SEND (so <code>dial</code> is not appropriate).
159     *
160     * @param dialString the MMI command to be executed.
161     * @return true if MMI command is executed.
162     */
163    boolean handlePinMmi(String dialString);
164
165    /**
166     * Toggles the radio on or off.
167     */
168    void toggleRadioOnOff();
169
170    /**
171     * Set the radio to on or off
172     */
173    boolean setRadio(boolean turnOn);
174
175    /**
176     * Request to update location information in service state
177     */
178    void updateServiceLocation();
179
180    /**
181     * Enable location update notifications.
182     */
183    void enableLocationUpdates();
184
185    /**
186     * Disable location update notifications.
187     */
188    void disableLocationUpdates();
189
190    /**
191     * Enable a specific APN type.
192     */
193    int enableApnType(String type);
194
195    /**
196     * Disable a specific APN type.
197     */
198    int disableApnType(String type);
199
200    /**
201     * Allow mobile data connections.
202     */
203    boolean enableDataConnectivity();
204
205    /**
206     * Disallow mobile data connections.
207     */
208    boolean disableDataConnectivity();
209
210    /**
211     * Report whether data connectivity is possible.
212     */
213    boolean isDataConnectivityPossible();
214
215    Bundle getCellLocation();
216
217    /**
218     * Returns the neighboring cell information of the device.
219     */
220    List<NeighboringCellInfo> getNeighboringCellInfo();
221
222     int getCallState();
223     int getDataActivity();
224     int getDataState();
225
226    /**
227     * Returns the current active phone type as integer.
228     * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
229     * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
230     */
231    int getActivePhoneType();
232
233    /**
234     * Returns the CDMA ERI icon index to display
235     */
236    int getCdmaEriIconIndex();
237
238    /**
239     * Returns the CDMA ERI icon mode,
240     * 0 - ON
241     * 1 - FLASHING
242     */
243    int getCdmaEriIconMode();
244
245    /**
246     * Returns the CDMA ERI text,
247     */
248    String getCdmaEriText();
249
250    /**
251     * Returns true if OTA service provisioning needs to run.
252     * Only relevant on some technologies, others will always
253     * return false.
254     */
255    boolean needsOtaServiceProvisioning();
256
257    /**
258      * Returns the unread count of voicemails
259      */
260    int getVoiceMessageCount();
261
262    /**
263      * Returns the network type
264      */
265    int getNetworkType();
266
267    /**
268     * Return true if an ICC card is present
269     */
270    boolean hasIccCard();
271
272    /**
273     * Return if the current radio is LTE on CDMA. This
274     * is a tri-state return value as for a period of time
275     * the mode may be unknown.
276     *
277     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
278     * or {@link PHone#LTE_ON_CDMA_TRUE}
279     */
280    int getLteOnCdmaMode();
281}
282
283