ITelephony.aidl revision ddb74d8eb05bf50ebae673fda87730b80e52a758
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;
22import android.telephony.CellInfo;
23
24
25/**
26 * Interface used to interact with the phone.  Mostly this is used by the
27 * TelephonyManager class.  A few places are still using this directly.
28 * Please clean them up if possible and use TelephonyManager insteadl.
29 *
30 * {@hide}
31 */
32interface ITelephony {
33
34    /**
35     * Dial a number. This doesn't place the call. It displays
36     * the Dialer screen.
37     * @param number the number to be dialed. If null, this
38     * would display the Dialer screen with no number pre-filled.
39     */
40    void dial(String number);
41
42    /**
43     * Place a call to the specified number.
44     * @param number the number to be called.
45     */
46    void call(String callingPackage, String number);
47
48    /**
49     * End call if there is a call in progress, otherwise does nothing.
50     *
51     * @return whether it hung up
52     */
53    boolean endCall();
54
55    /**
56     * End call on particular subId or go to the Home screen
57     * @param subId user preferred subId.
58     * @return whether it hung up
59     */
60    boolean endCallUsingSubId(long subId);
61
62    /**
63     * Answer the currently-ringing call.
64     *
65     * If there's already a current active call, that call will be
66     * automatically put on hold.  If both lines are currently in use, the
67     * current active call will be ended.
68     *
69     * TODO: provide a flag to let the caller specify what policy to use
70     * if both lines are in use.  (The current behavior is hardwired to
71     * "answer incoming, end ongoing", which is how the CALL button
72     * is specced to behave.)
73     *
74     * TODO: this should be a oneway call (especially since it's called
75     * directly from the key queue thread).
76     */
77    void answerRingingCall();
78
79    /**
80     * Silence the ringer if an incoming call is currently ringing.
81     * (If vibrating, stop the vibrator also.)
82     *
83     * It's safe to call this if the ringer has already been silenced, or
84     * even if there's no incoming call.  (If so, this method will do nothing.)
85     *
86     * TODO: this should be a oneway call too (see above).
87     *       (Actually *all* the methods here that return void can
88     *       probably be oneway.)
89     */
90    void silenceRinger();
91
92    /**
93     * Check if we are in either an active or holding call
94     * @return true if the phone state is OFFHOOK.
95     */
96    boolean isOffhook();
97
98    /**
99     * Check if a particular subId has an active or holding call
100     *
101     * @param subId user preferred subId.
102     * @return true if the phone state is OFFHOOK.
103     */
104    boolean isOffhookUsingSubId(long subId);
105
106    /**
107     * Check if an incoming phone call is ringing or call waiting
108     * on a particular subId.
109     *
110     * @param subId user preferred subId.
111     * @return true if the phone state is RINGING.
112     */
113    boolean isRingingUsingSubId(long subId);
114
115    /**
116     * Check if an incoming phone call is ringing or call waiting.
117     * @return true if the phone state is RINGING.
118     */
119    boolean isRinging();
120
121    /**
122     * Check if the phone is idle.
123     * @return true if the phone state is IDLE.
124     */
125    boolean isIdle();
126
127    /**
128     * Check if the phone is idle on a particular subId.
129     *
130     * @param subId user preferred subId.
131     * @return true if the phone state is IDLE.
132     */
133    boolean isIdleUsingSubId(long subId);
134
135    /**
136     * Check to see if the radio is on or not.
137     * @return returns true if the radio is on.
138     */
139    boolean isRadioOn();
140
141    /**
142     * Check to see if the radio is on or not on particular subId.
143     * @param subId user preferred subId.
144     * @return returns true if the radio is on.
145     */
146    boolean isRadioOnUsingSubId(long subId);
147
148    /**
149     * Check if the SIM pin lock is enabled.
150     * @return true if the SIM pin lock is enabled.
151     */
152    boolean isSimPinEnabled();
153
154    /**
155     * Cancels the missed calls notification.
156     */
157    void cancelMissedCallsNotification();
158
159    /**
160     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
161     * @param pin The pin to check.
162     * @return whether the operation was a success.
163     */
164    boolean supplyPin(String pin);
165
166    /**
167     * Supply a pin to unlock the SIM for particular subId.
168     * Blocks until a result is determined.
169     * @param pin The pin to check.
170     * @param subId user preferred subId.
171     * @return whether the operation was a success.
172     */
173    boolean supplyPinUsingSubId(long subId, String pin);
174
175    /**
176     * Supply puk to unlock the SIM and set SIM pin to new pin.
177     *  Blocks until a result is determined.
178     * @param puk The puk to check.
179     *        pin The new pin to be set in SIM
180     * @return whether the operation was a success.
181     */
182    boolean supplyPuk(String puk, String pin);
183
184    /**
185     * Supply puk to unlock the SIM and set SIM pin to new pin.
186     *  Blocks until a result is determined.
187     * @param puk The puk to check.
188     *        pin The new pin to be set in SIM
189     * @param subId user preferred subId.
190     * @return whether the operation was a success.
191     */
192    boolean supplyPukUsingSubId(long subId, String puk, String pin);
193
194    /**
195     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
196     * Returns a specific success/error code.
197     * @param pin The pin to check.
198     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
199     *         retValue[1] = number of attempts remaining if known otherwise -1
200     */
201    int[] supplyPinReportResult(String pin);
202
203    /**
204     * Supply a pin to unlock the SIM.  Blocks until a result is determined.
205     * Returns a specific success/error code.
206     * @param pin The pin to check.
207     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
208     *         retValue[1] = number of attempts remaining if known otherwise -1
209     */
210    int[] supplyPinReportResultUsingSubId(long subId, String pin);
211
212    /**
213     * Supply puk to unlock the SIM and set SIM pin to new pin.
214     * Blocks until a result is determined.
215     * Returns a specific success/error code
216     * @param puk The puk to check
217     *        pin The pin to check.
218     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
219     *         retValue[1] = number of attempts remaining if known otherwise -1
220     */
221    int[] supplyPukReportResult(String puk, String pin);
222
223    /**
224     * Supply puk to unlock the SIM and set SIM pin to new pin.
225     * Blocks until a result is determined.
226     * Returns a specific success/error code
227     * @param puk The puk to check
228     *        pin The pin to check.
229     * @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
230     *         retValue[1] = number of attempts remaining if known otherwise -1
231     */
232    int[] supplyPukReportResultUsingSubId(long subId, String puk, String pin);
233
234    /**
235     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
236     * without SEND (so <code>dial</code> is not appropriate).
237     *
238     * @param dialString the MMI command to be executed.
239     * @return true if MMI command is executed.
240     */
241    boolean handlePinMmi(String dialString);
242
243    /**
244     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
245     * without SEND (so <code>dial</code> is not appropriate) for
246     * a particular subId.
247     * @param dialString the MMI command to be executed.
248     * @param subId user preferred subId.
249     * @return true if MMI command is executed.
250     */
251    boolean handlePinMmiUsingSubId(long subId, String dialString);
252
253    /**
254     * Toggles the radio on or off.
255     */
256    void toggleRadioOnOff();
257
258    /**
259     * Toggles the radio on or off on particular subId.
260     * @param subId user preferred subId.
261     */
262    void toggleRadioOnOffUsingSubId(long subId);
263
264    /**
265     * Set the radio to on or off
266     */
267    boolean setRadio(boolean turnOn);
268
269    /**
270     * Set the radio to on or off on particular subId.
271     * @param subId user preferred subId.
272     */
273    boolean setRadioUsingSubId(long subId, boolean turnOn);
274
275    /**
276     * Set the radio to on or off unconditionally
277     */
278    boolean setRadioPower(boolean turnOn);
279
280    /**
281     * Request to update location information in service state
282     */
283    void updateServiceLocation();
284
285    /**
286     * Request to update location information for a subscrition in service state
287     * @param subId user preferred subId.
288     */
289    void updateServiceLocationUsingSubId(long subId);
290
291    /**
292     * Enable location update notifications.
293     */
294    void enableLocationUpdates();
295
296    /**
297     * Enable location update notifications.
298     * @param subId user preferred subId.
299     */
300    void enableLocationUpdatesUsingSubId(long subId);
301
302    /**
303     * Disable location update notifications.
304     */
305    void disableLocationUpdates();
306
307    /**
308     * Disable location update notifications.
309     * @param subId user preferred subId.
310     */
311    void disableLocationUpdatesUsingSubId(long subId);
312
313    /**
314     * Allow mobile data connections.
315     */
316    boolean enableDataConnectivity();
317
318    /**
319     * Disallow mobile data connections.
320     */
321    boolean disableDataConnectivity();
322
323    /**
324     * Report whether data connectivity is possible.
325     */
326    boolean isDataConnectivityPossible();
327
328    Bundle getCellLocation();
329
330    /**
331     * Returns the neighboring cell information of the device.
332     */
333    List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg);
334
335     int getCallState();
336
337    /**
338     * Returns the call state for a subId.
339     */
340     int getCallStateUsingSubId(long subId);
341
342     int getDataActivity();
343     int getDataState();
344
345    /**
346     * Returns the current active phone type as integer.
347     * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
348     * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
349     */
350    int getActivePhoneType();
351
352    /**
353     * Returns the current active phone type as integer for particular subId.
354     * Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
355     * and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE
356     * @param subId user preferred subId.
357     */
358    int getActivePhoneTypeUsingSubId(long subId);
359
360    /**
361     * Returns the CDMA ERI icon index to display
362     */
363    int getCdmaEriIconIndex();
364
365    /**
366     * Returns the CDMA ERI icon index to display on particular subId.
367     * @param subId user preferred subId.
368     */
369    int getCdmaEriIconIndexUsingSubId(long subId);
370
371    /**
372     * Returns the CDMA ERI icon mode,
373     * 0 - ON
374     * 1 - FLASHING
375     */
376    int getCdmaEriIconMode();
377
378    /**
379     * Returns the CDMA ERI icon mode on particular subId,
380     * 0 - ON
381     * 1 - FLASHING
382     * @param subId user preferred subId.
383     */
384    int getCdmaEriIconModeUsingSubId(long subId);
385
386    /**
387     * Returns the CDMA ERI text,
388     */
389    String getCdmaEriText();
390
391    /**
392     * Returns the CDMA ERI text for particular subId,
393     * @param subId user preferred subId.
394     */
395    String getCdmaEriTextUsingSubId(long subId);
396
397    /**
398     * Returns true if OTA service provisioning needs to run.
399     * Only relevant on some technologies, others will always
400     * return false.
401     */
402    boolean needsOtaServiceProvisioning();
403
404    /**
405      * Returns the unread count of voicemails
406      */
407    int getVoiceMessageCount();
408
409    /**
410     * Returns the unread count of voicemails for a subId.
411     * @param subId user preferred subId.
412     * Returns the unread count of voicemails
413     */
414    int getVoiceMessageCountUsingSubId(long subId);
415
416    /**
417      * Returns the network type for data transmission
418      */
419    int getNetworkType();
420
421    /**
422     * Returns the network type of a subId.
423     * @param subId user preferred subId.
424     * Returns the network type
425     */
426    int getNetworkTypeUsingSubId(long subId);
427
428    /**
429      * Returns the network type for data transmission
430      */
431    int getDataNetworkType();
432
433    /**
434      * Returns the data network type of a subId
435      * @param subId user preferred subId.
436      * Returns the network type
437      */
438    int getDataNetworkTypeUsingSubId(long subId);
439
440    /**
441      * Returns the network type for voice
442      */
443    int getVoiceNetworkType();
444
445    /**
446      * Returns the voice network type of a subId
447      * @param subId user preferred subId.
448      * Returns the network type
449      */
450    int getVoiceNetworkTypeUsingSubId(long subId);
451
452    /**
453     * Return true if an ICC card is present
454     */
455    boolean hasIccCard();
456
457    /**
458     * Return true if an ICC card is present for a subId.
459     * @param slotId user preferred slotId.
460     * Return true if an ICC card is present
461     */
462    boolean hasIccCardUsingSlotId(long slotId);
463
464    /**
465     * Return if the current radio is LTE on CDMA. This
466     * is a tri-state return value as for a period of time
467     * the mode may be unknown.
468     *
469     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
470     * or {@link PHone#LTE_ON_CDMA_TRUE}
471     */
472    int getLteOnCdmaMode();
473
474    /**
475     * Return if the current radio is LTE on CDMA. This
476     * is a tri-state return value as for a period of time
477     * the mode may be unknown.
478     *
479     * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
480     * or {@link PHone#LTE_ON_CDMA_TRUE}
481     */
482    int getLteOnCdmaModeUsingSubId(long subId);
483
484    /**
485     * Returns the all observed cell information of the device.
486     */
487    List<CellInfo> getAllCellInfo();
488
489    /**
490     * Sets minimum time in milli-seconds between onCellInfoChanged
491     */
492    void setCellInfoListRate(int rateInMillis);
493
494    /**
495     * get default sim
496     * @return sim id
497     */
498    int getDefaultSim();
499
500    /**
501     * Opens a logical channel to the ICC card.
502     *
503     * Input parameters equivalent to TS 27.007 AT+CCHO command.
504     *
505     * @param AID Application id. See ETSI 102.221 and 101.220.
506     * @return The logical channel id which is set to -1 on error.
507     */
508    int iccOpenLogicalChannel(String AID);
509
510    /**
511     * Closes a previously opened logical channel to the ICC card.
512     *
513     * Input parameters equivalent to TS 27.007 AT+CCHC command.
514     *
515     * @param channel is the channel id to be closed as retruned by a
516     *            successful iccOpenLogicalChannel.
517     * @return true if the channel was closed successfully.
518     */
519    boolean iccCloseLogicalChannel(int channel);
520
521    /**
522     * Transmit an APDU to the ICC card over a logical channel.
523     *
524     * Input parameters equivalent to TS 27.007 AT+CGLA command.
525     *
526     * @param channel is the channel id to be closed as retruned by a
527     *            successful iccOpenLogicalChannel.
528     * @param cla Class of the APDU command.
529     * @param instruction Instruction of the APDU command.
530     * @param p1 P1 value of the APDU command.
531     * @param p2 P2 value of the APDU command.
532     * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
533     *            is sent to the SIM.
534     * @param data Data to be sent with the APDU.
535     * @return The APDU response from the ICC card with the status appended at
536     *            the end. If an error occurs, an empty string is returned.
537     */
538    String iccTransmitApduLogicalChannel(int channel, int cla, int instruction,
539            int p1, int p2, int p3, String data);
540
541    /**
542     * Send ENVELOPE to the SIM and returns the response.
543     *
544     * @param contents  String containing SAT/USAT response in hexadecimal
545     *                  format starting with command tag. See TS 102 223 for
546     *                  details.
547     * @return The APDU response from the ICC card, with the last 4 bytes
548     *         being the status word. If the command fails, returns an empty
549     *         string.
550     */
551    String sendEnvelopeWithStatus(String content);
552
553    /**
554     * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
555     * Used for device configuration by some CDMA operators.
556     *
557     * @param itemID the ID of the item to read.
558     * @return the NV item as a String, or null on any failure.
559     */
560    String nvReadItem(int itemID);
561
562    /**
563     * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
564     * Used for device configuration by some CDMA operators.
565     *
566     * @param itemID the ID of the item to read.
567     * @param itemValue the value to write, as a String.
568     * @return true on success; false on any failure.
569     */
570    boolean nvWriteItem(int itemID, String itemValue);
571
572    /**
573     * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
574     * Used for device configuration by some CDMA operators.
575     *
576     * @param preferredRoamingList byte array containing the new PRL.
577     * @return true on success; false on any failure.
578     */
579    boolean nvWriteCdmaPrl(in byte[] preferredRoamingList);
580
581    /**
582     * Perform the specified type of NV config reset. The radio will be taken offline
583     * and the device must be rebooted after the operation. Used for device
584     * configuration by some CDMA operators.
585     *
586     * @param resetType the type of reset to perform (1 == factory reset; 2 == NV-only reset).
587     * @return true on success; false on any failure.
588     */
589    boolean nvResetConfig(int resetType);
590
591    /*
592     * Get the preferred network type.
593     * Used for device configuration by some CDMA operators.
594     *
595     * @return the preferred network type, defined in RILConstants.java.
596     */
597    int getPreferredNetworkType();
598
599    /**
600     * Set the preferred network type.
601     * Used for device configuration by some CDMA operators.
602     *
603     * @param networkType the preferred network type, defined in RILConstants.java.
604     * @return true on success; false on any failure.
605     */
606    boolean setPreferredNetworkType(int networkType);
607
608    /**
609     * Set the CDMA subscription source.
610     * Used for device supporting both NV and RUIM for CDMA.
611     *
612     * @param subscriptionType the subscription type, 0 for RUIM, 1 for NV.
613     * @return true on success; false on any failure.
614     */
615    boolean setCdmaSubscription(int subscriptionType);
616
617    /**
618     * User enable/disable Mobile Data.
619     *
620     * @param enable true to turn on, else false
621     */
622    void setDataEnabled(boolean enable);
623
624    /**
625     * Get the user enabled state of Mobile Data.
626     *
627     * @return true on enabled
628     */
629    boolean getDataEnabled();
630
631    /**
632     * Get P-CSCF address from PCO after data connection is established or modified.
633     */
634    String[] getPcscfAddress();
635
636    /**
637     * Set IMS registration state
638     */
639    void setImsRegistrationState(boolean registered);
640
641}
642
643