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