2 * Copyright (C) 2007 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.internal.telephony;
19 import android.os.Bundle;
20 import java.util.List;
21 import android.telephony.NeighboringCellInfo;
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.
30 interface ITelephony {
33 * Dial a number. This doesn't place the call. It displays
35 * @param number the number to be dialed. If null, this
36 * would display the Dialer screen with no number pre-filled.
38 void dial(String number);
41 * Place a call to the specified number.
42 * @param number the number to be called.
44 void call(String number);
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.
51 * @return true if the call screen was shown.
53 boolean showCallScreen();
56 * Variation of showCallScreen() that also specifies whether the
57 * DTMF dialpad should be initially visible when the InCallScreen
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.
66 boolean showCallScreenWithDialpad(boolean showDialpad);
69 * End call if there is a call in progress, otherwise does nothing.
71 * @return whether it hung up
76 * Answer the currently-ringing call.
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.
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.)
87 * TODO: this should be a oneway call (especially since it's called
88 * directly from the key queue thread).
90 void answerRingingCall();
93 * Silence the ringer if an incoming call is currently ringing.
94 * (If vibrating, stop the vibrator also.)
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.)
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.)
103 void silenceRinger();
106 * Check if we are in either an active or holding call
107 * @return true if the phone state is OFFHOOK.
112 * Check if an incoming phone call is ringing or call waiting.
113 * @return true if the phone state is RINGING.
118 * Check if the phone is idle.
119 * @return true if the phone state is IDLE.
124 * Check to see if the radio is on or not.
125 * @return returns true if the radio is on.
130 * Check if the SIM pin lock is enabled.
131 * @return true if the SIM pin lock is enabled.
133 boolean isSimPinEnabled();
136 * Cancels the missed calls notification.
138 void cancelMissedCallsNotification();
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.
145 boolean supplyPin(String pin);
148 * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
149 * without SEND (so <code>dial</code> is not appropriate).
151 * @param dialString the MMI command to be executed.
152 * @return true if MMI command is executed.
154 boolean handlePinMmi(String dialString);
157 * Toggles the radio on or off.
159 void toggleRadioOnOff();
162 * Set the radio to on or off
164 boolean setRadio(boolean turnOn);
167 * Request to update location information in service state
169 void updateServiceLocation();
172 * Enable location update notifications.
174 void enableLocationUpdates();
177 * Disable location update notifications.
179 void disableLocationUpdates();
182 * Enable a specific APN type.
184 int enableApnType(String type);
187 * Disable a specific APN type.
189 int disableApnType(String type);
192 * Allow mobile data connections.
194 boolean enableDataConnectivity();
197 * Disallow mobile data connections.
199 boolean disableDataConnectivity();
202 * Report whether data connectivity is possible.
204 boolean isDataConnectivityPossible();
206 Bundle getCellLocation();
209 * Returns the neighboring cell information of the device.
211 List<NeighboringCellInfo> getNeighboringCellInfo();
214 int getDataActivity();
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
222 int getActivePhoneType();
225 * Returns the CDMA ERI icon index to display
227 int getCdmaEriIconIndex();
230 * Returns the CDMA ERI icon mode,
234 int getCdmaEriIconMode();
237 * Returns the CDMA ERI text,
239 String getCdmaEriText();
242 * Returns true if CDMA provisioning needs to run.
244 boolean getCdmaNeedsProvisioning();
247 * Returns the unread count of voicemails
249 int getVoiceMessageCount();
252 * Returns the network type
254 int getNetworkType();
257 * Return true if an ICC card is present
259 boolean hasIccCard();