ITelephony.aidl revision 3534ede5722b98c5be1526ba0bc2cd8acfbe0e55
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     * End call if there is a call in progress, otherwise does nothing.
53     *
54     * @return whether it hung up
55     */
56    boolean endCall();
57
58    /**
59     * Answer the currently-ringing call.
60     *
61     * If there's already a current active call, that call will be
62     * automatically put on hold.  If both lines are currently in use, the
63     * current active call will be ended.
64     *
65     * TODO: provide a flag to let the caller specify what policy to use
66     * if both lines are in use.  (The current behavior is hardwired to
67     * "answer incoming, end ongoing", which is how the CALL button
68     * is specced to behave.)
69     *
70     * TODO: this should be a oneway call (especially since it's called
71     * directly from the key queue thread).
72     */
73    void answerRingingCall();
74
75    /**
76     * Silence the ringer if an incoming call is currently ringing.
77     * (If vibrating, stop the vibrator also.)
78     *
79     * It's safe to call this if the ringer has already been silenced, or
80     * even if there's no incoming call.  (If so, this method will do nothing.)
81     *
82     * TODO: this should be a oneway call too (see above).
83     *       (Actually *all* the methods here that return void can
84     *       probably be oneway.)
85     */
86    void silenceRinger();
87
88    /**
89     * Check if we are in either an active or holding call
90     * @return true if the phone state is OFFHOOK.
91     */
92    boolean isOffhook();
93
94    /**
95     * Check if an incoming phone call is ringing or call waiting.
96     * @return true if the phone state is RINGING.
97     */
98    boolean isRinging();
99
100    /**
101     * Check if the phone is idle.
102     * @return true if the phone state is IDLE.
103     */
104    boolean isIdle();
105
106    /**
107     * Check to see if the radio is on or not.
108     * @return returns true if the radio is on.
109     */
110    boolean isRadioOn();
111
112    /**
113     * Check if the SIM pin lock is enabled.
114     * @return true if the SIM pin lock is enabled.
115     */
116    boolean isSimPinEnabled();
117
118    /**
119     * Cancels the missed calls notification.
120     */
121    void cancelMissedCallsNotification();
122
123    /**
124     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
125     * @param pin The pin to check.
126     * @return whether the operation was a success.
127     */
128    boolean supplyPin(String pin);
129
130    /**
131     * Supply puk to unlock the SIM and set SIM pin to new pin.
132     *  Blocks until a result is determined.
133     * @param puk The puk to check.
134     *        pin The new pin to be set in SIM
135     * @return whether the operation was a success.
136     */
137    boolean supplyPuk(String puk, String pin);
138
139    /**
140     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
141     * Returns a specific success/error code.
142     * @param pin The pin to check.
143     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
144     *         retValue[1] = number of attempts remaining if known otherwise -1
145     */
146    int[] supplyPinReportResult(String pin);
147
148    /**
149     * Supply puk to unlock the SIM and set SIM pin to new pin.
150     * Blocks until a result is determined.
151     * Returns a specific success/error code
152     * @param puk The puk to check
153     *        pin The pin to check.
154     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
155     *         retValue[1] = number of attempts remaining if known otherwise -1
156     */
157    int[] supplyPukReportResult(String puk, String pin);
158
159    /**
160     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
161     * without SEND (so <code>dial</code> is not appropriate).
162     *
163     * @param dialString the MMI command to be executed.
164     * @return true if MMI command is executed.
165     */
166    boolean handlePinMmi(String dialString);
167
168    /**
169     * Toggles the radio on or off.
170     */
171    void toggleRadioOnOff();
172
173    /**
174     * Set the radio to on or off
175     */
176    boolean setRadio(boolean turnOn);
177
178    /**
179     * Set the radio to on or off unconditionally
180     */
181    boolean setRadioPower(boolean turnOn);
182
183    /**
184     * Request to update location information in service state
185     */
186    void updateServiceLocation();
187
188    /**
189     * Enable location update notifications.
190     */
191    void enableLocationUpdates();
192
193    /**
194     * Disable location update notifications.
195     */
196    void disableLocationUpdates();
197
198    /**
199     * Enable a specific APN type.
200     */
201    int enableApnType(String type);
202
203    /**
204     * Disable a specific APN type.
205     */
206    int disableApnType(String type);
207
208    /**
209     * Allow mobile data connections.
210     */
211    boolean enableDataConnectivity();
212
213    /**
214     * Disallow mobile data connections.
215     */
216    boolean disableDataConnectivity();
217
218    /**
219     * Report whether data connectivity is possible.
220     */
221    boolean isDataConnectivityPossible();
222
223    Bundle getCellLocation();
224
225    /**
226     * Returns the neighboring cell information of the device.
227     */
228    List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg);
229
230     int getCallState();
231     int getDataActivity();
232     int getDataState();
233
234    /**
235     * Returns the current active phone type as integer.
236     * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
237     * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
238     */
239    int getActivePhoneType();
240
241    /**
242     * Returns the CDMA ERI icon index to display
243     */
244    int getCdmaEriIconIndex();
245
246    /**
247     * Returns the CDMA ERI icon mode,
248     * 0 - ON
249     * 1 - FLASHING
250     */
251    int getCdmaEriIconMode();
252
253    /**
254     * Returns the CDMA ERI text,
255     */
256    String getCdmaEriText();
257
258    /**
259     * Returns true if OTA service provisioning needs to run.
260     * Only relevant on some technologies, others will always
261     * return false.
262     */
263    boolean needsOtaServiceProvisioning();
264
265    /**
266      * Returns the unread count of voicemails
267      */
268    int getVoiceMessageCount();
269
270    /**
271      * Returns the network type for data transmission
272      */
273    int getNetworkType();
274
275    /**
276      * Returns the network type for data transmission
277      */
278    int getDataNetworkType();
279
280    /**
281      * Returns the network type for voice
282      */
283    int getVoiceNetworkType();
284
285    /**
286     * Return true if an ICC card is present
287     */
288    boolean hasIccCard();
289
290    /**
291     * Return if the current radio is LTE on CDMA. This
292     * is a tri-state return value as for a period of time
293     * the mode may be unknown.
294     *
295     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
296     * or {@link PHone#LTE_ON_CDMA_TRUE}
297     */
298    int getLteOnCdmaMode();
299
300    /**
301     * Returns the all observed cell information of the device.
302     */
303    List<CellInfo> getAllCellInfo();
304
305    /**
306     * Sets minimum time in milli-seconds between onCellInfoChanged
307     */
308    void setCellInfoListRate(int rateInMillis);
309
310    /**
311     * Opens a logical channel to the ICC card.
312     *
313     * Input parameters equivalent to TS 27.007 AT+CCHO command.
314     *
315     * @param AID Application id. See ETSI 102.221 and 101.220.
316     * @return The logical channel id which is set to -1 on error.
317     */
318    int iccOpenLogicalChannel(String AID);
319
320    /**
321     * Closes a previously opened logical channel to the ICC card.
322     *
323     * Input parameters equivalent to TS 27.007 AT+CCHC command.
324     *
325     * @param channel is the channel id to be closed as retruned by a
326     *            successful iccOpenLogicalChannel.
327     * @return true if the channel was closed successfully.
328     */
329    boolean iccCloseLogicalChannel(int channel);
330
331    /**
332     * Transmit an APDU to the ICC card over a logical channel.
333     *
334     * Input parameters equivalent to TS 27.007 AT+CGLA command.
335     *
336     * @param channel is the channel id to be closed as retruned by a
337     *            successful iccOpenLogicalChannel.
338     * @param cla Class of the APDU command.
339     * @param instruction Instruction of the APDU command.
340     * @param p1 P1 value of the APDU command.
341     * @param p2 P2 value of the APDU command.
342     * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
343     *            is sent to the SIM.
344     * @param data Data to be sent with the APDU.
345     * @return The APDU response from the ICC card with the status appended at
346     *            the end. If an error occurs, an empty string is returned.
347     */
348    String iccTransmitApduLogicalChannel(int channel, int cla, int instruction,
349            int p1, int p2, int p3, String data);
350
351    /**
352     * Send ENVELOPE to the SIM and returns the response.
353     *
354     * @param contents  String containing SAT/USAT response in hexadecimal
355     *                  format starting with command tag. See TS 102 223 for
356     *                  details.
357     * @return The APDU response from the ICC card, with the last 4 bytes
358     *         being the status word. If the command fails, returns an empty
359     *         string.
360     */
361    String sendEnvelopeWithStatus(String content);
362
363    /**
364     * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
365     * Used for device configuration by some CDMA operators.
366     *
367     * @param itemID the ID of the item to read.
368     * @return the NV item as a String, or null on any failure.
369     */
370    String nvReadItem(int itemID);
371
372    /**
373     * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
374     * Used for device configuration by some CDMA operators.
375     *
376     * @param itemID the ID of the item to read.
377     * @param itemValue the value to write, as a String.
378     * @return true on success; false on any failure.
379     */
380    boolean nvWriteItem(int itemID, String itemValue);
381
382    /**
383     * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
384     * Used for device configuration by some CDMA operators.
385     *
386     * @param preferredRoamingList byte array containing the new PRL.
387     * @return true on success; false on any failure.
388     */
389    boolean nvWriteCdmaPrl(in byte[] preferredRoamingList);
390
391    /**
392     * Perform the specified type of NV config reset. The radio will be taken offline
393     * and the device must be rebooted after the operation. Used for device
394     * configuration by some CDMA operators.
395     *
396     * @param resetType the type of reset to perform (1 == factory reset; 2 == NV-only reset).
397     * @return true on success; false on any failure.
398     */
399    boolean nvResetConfig(int resetType);
400
401    /*
402     * Get the preferred network type.
403     * Used for device configuration by some CDMA operators.
404     *
405     * @return the preferred network type, defined in RILConstants.java.
406     */
407    int getPreferredNetworkType();
408
409    /**
410     * Set the preferred network type.
411     * Used for device configuration by some CDMA operators.
412     *
413     * @param networkType the preferred network type, defined in RILConstants.java.
414     * @return true on success; false on any failure.
415     */
416    boolean setPreferredNetworkType(int networkType);
417
418    /**
419     * User enable/disable Mobile Data.
420     *
421     * @param enable true to turn on, else false
422     */
423    void setDataEnabled(boolean enable);
424
425    /**
426     * Get the user enabled state of Mobile Data.
427     *
428     * @return true on enabled
429     */
430    boolean getDataEnabled();
431}
432