/** Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*http://www.apache.org/licenses/LICENSE-2.0*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.*/
packagecom.android.internal.telephony;importandroid.os.Bundle;importjava.util.List;importandroid.telephony.NeighboringCellInfo;/*** Interface used to interact with the phone. Mostly this is used by the
* TelephonyManager class. A few places are still using this directly.
* Please clean them up if possible and use TelephonyManager insteadl.
*
* [email protected]}*/
interfaceITelephony {/*** Dial a number. This doesn‘t place the call. It displays
* the Dialer screen.
*@paramnumber the number to be dialed. If null, this
* would display the Dialer screen with no number pre-filled.*/
voiddial(String number);/*** Place a call to the specified number.
*@paramnumber the number to be called.*/
voidcall(String number);/*** If there is currently a call in progress, show the call screen.
* The DTMF dialpad may or may not be visible initially, depending on
* whether it was up when the user last exited the InCallScreen.
*
*@returntrue if the call screen was shown.*/
booleanshowCallScreen();/*** Variation of showCallScreen() that also specifies whether the
* DTMF dialpad should be initially visible when the InCallScreen
* comes up.
*
*@paramshowDialpad if true, make the dialpad visible initially,
* otherwise hide the dialpad initially.
*@returntrue if the call screen was shown.
*
*@seeshowCallScreen*/
boolean showCallScreenWithDialpad(booleanshowDialpad);/*** End call if there is a call in progress, otherwise does nothing.
*
*@returnwhether it hung up*/
booleanendCall();/*** Answer the currently-ringing call.
*
* If there‘s already a current active call, that call will be
* automatically put on hold. If both lines are currently in use, the
* current active call will be ended.
*
* TODO: provide a flag to let the caller specify what policy to use
* if both lines are in use. (The current behavior is hardwired to
* "answer incoming, end ongoing", which is how the CALL button
* is specced to behave.)
*
* TODO: this should be a oneway call (especially since it‘s called
* directly from the key queue thread).*/
voidanswerRingingCall();/*** Silence the ringer if an incoming call is currently ringing.
* (If vibrating, stop the vibrator also.)
*
* It‘s safe to call this if the ringer has already been silenced, or
* even if there‘s no incoming call. (If so, this method will do nothing.)
*
* TODO: this should be a oneway call too (see above).
* (Actually *all* the methods here that return void can
* probably be oneway.)*/
voidsilenceRinger();/*** Check if we are in either an active or holding call
*@returntrue if the phone state is OFFHOOK.*/
booleanisOffhook();/*** Check if an incoming phone call is ringing or call waiting.
*@returntrue if the phone state is RINGING.*/
booleanisRinging();/*** Check if the phone is idle.
*@returntrue if the phone state is IDLE.*/
booleanisIdle();/*** Check to see if the radio is on or not.
*@returnreturns true if the radio is on.*/
booleanisRadioOn();/*** Check if the SIM pin lock is enabled.
*@returntrue if the SIM pin lock is enabled.*/
booleanisSimPinEnabled();/*** Cancels the missed calls notification.*/
voidcancelMissedCallsNotification();/*** Supply a pin to unlock the SIM. Blocks until a result is determined.
*@parampin The pin to check.
*@returnwhether the operation was a success.*/
booleansupplyPin(String pin);/*** Supply puk to unlock the SIM and set SIM pin to new pin.
* Blocks until a result is determined.
*@parampuk The puk to check.
* pin The new pin to be set in SIM
*@returnwhether the operation was a success.*/
booleansupplyPuk(String puk, String pin);/*** Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
* without SEND (so dial
is not appropriate).
*
*@paramdialString the MMI command to be executed.
*@returntrue if MMI command is executed.*/
booleanhandlePinMmi(String dialString);/*** Toggles the radio on or off.*/
voidtoggleRadioOnOff();/*** Set the radio to on or off*/
boolean setRadio(booleanturnOn);/*** Request to update location information in service state*/
voidupdateServiceLocation();/*** Enable location update notifications.*/
voidenableLocationUpdates();/*** Disable location update notifications.*/
voiddisableLocationUpdates();/*** Enable a specific APN type.*/
intenableApnType(String type);/*** Disable a specific APN type.*/
intdisableApnType(String type);/*** Allow mobile data connections.*/
booleanenableDataConnectivity();/*** Disallow mobile data connections.*/
booleandisableDataConnectivity();/*** Report whether data connectivity is possible.*/
booleanisDataConnectivityPossible();
Bundle getCellLocation();/*** Returns the neighboring cell information of the device.*/ListgetNeighboringCellInfo();intgetCallState();intgetDataActivity();intgetDataState();/*** Returns the current active phone type as integer.
* Returns TelephonyManager.PHONE_TYPE_CDMA if RILConstants.CDMA_PHONE
* and TelephonyManager.PHONE_TYPE_GSM if RILConstants.GSM_PHONE*/
intgetActivePhoneType();/*** Returns the CDMA ERI icon index to display*/
intgetCdmaEriIconIndex();/*** Returns the CDMA ERI icon mode,
* 0 - ON
* 1 - FLASHING*/
intgetCdmaEriIconMode();/*** Returns the CDMA ERI text,*/String getCdmaEriText();/*** Returns true if OTA service provisioning needs to run.
* Only relevant on some technologies, others will always
* return false.*/
booleanneedsOtaServiceProvisioning();/*** Returns the unread count of voicemails*/
intgetVoiceMessageCount();/*** Returns the network type*/
intgetNetworkType();/*** Return true if an ICC card is present*/
booleanhasIccCard();/*** Return if the current radio is LTE on CDMA. This
* is a tri-state return value as for a period of time
* the mode may be unknown.
*
*@return{@linkPhone#LTE_ON_CDMA_UNKNOWN}, {@linkPhone#LTE_ON_CDMA_FALSE}
* or {@linkPHone#LTE_ON_CDMA_TRUE}*/
intgetLteOnCdmaMode();
}