OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / frameworks / base / telephony / java / com / android / internal / telephony / ITelephony.aidl
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
17 package com.android.internal.telephony;
18
19 import android.os.Bundle;
20 import java.util.List;
21 import 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  */
30 interface 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      * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
149      * without SEND (so <code>dial</code> is not appropriate).
150      *
151      * @param dialString the MMI command to be executed.
152      * @return true if MMI command is executed.
153      */
154     boolean handlePinMmi(String dialString);
155
156     /**
157      * Toggles the radio on or off.
158      */
159     void toggleRadioOnOff();
160
161     /**
162      * Set the radio to on or off
163      */
164     boolean setRadio(boolean turnOn);
165
166     /**
167      * Request to update location information in service state
168      */
169     void updateServiceLocation();
170
171     /**
172      * Enable location update notifications.
173      */
174     void enableLocationUpdates();
175
176     /**
177      * Disable location update notifications.
178      */
179     void disableLocationUpdates();
180
181     /**
182      * Enable a specific APN type.
183      */
184     int enableApnType(String type);
185
186     /**
187      * Disable a specific APN type.
188      */
189     int disableApnType(String type);
190
191     /**
192      * Allow mobile data connections.
193      */
194     boolean enableDataConnectivity();
195
196     /**
197      * Disallow mobile data connections.
198      */
199     boolean disableDataConnectivity();
200
201     /**
202      * Report whether data connectivity is possible.
203      */
204     boolean isDataConnectivityPossible();
205
206     Bundle getCellLocation();
207
208     /**
209      * Returns the neighboring cell information of the device.
210      */
211     List<NeighboringCellInfo> getNeighboringCellInfo();
212
213      int getCallState();
214      int getDataActivity();
215      int getDataState();
216
217     /**
218      * Returns the current active phone type as integer.
219      * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
220      * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
221      */
222     int getActivePhoneType();
223
224     /**
225      * Returns the CDMA ERI icon index to display
226      */
227     int getCdmaEriIconIndex();
228
229     /**
230      * Returns the CDMA ERI icon mode,
231      * 0 - ON
232      * 1 - FLASHING
233      */
234     int getCdmaEriIconMode();
235
236     /**
237      * Returns the CDMA ERI text,
238      */
239     String getCdmaEriText();
240
241     /**
242      * Returns true if CDMA provisioning needs to run.
243      */
244     boolean getCdmaNeedsProvisioning();
245
246     /**
247       * Returns the unread count of voicemails
248       */
249     int getVoiceMessageCount();
250
251     /**
252       * Returns the network type
253       */
254     int getNetworkType();
255     
256     /**
257      * Return true if an ICC card is present
258      */
259     boolean hasIccCard();
260 }
261