在src下先建立包名为com.android.internal.telephony(右键src > new > package,create package-info.java打钩),然后右键刚建的com.android.internal.telephony(右键com.android.internal.telephony > new > File,文件名为ITelephony.aidl)

ITelephony.aidl 内容:

/*
* 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.
*/

package com.android.internal.telephony;

import android.os.Bundle;
import java.util.List;
import android.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.
*
* {@hide}
*/
interface ITelephony {

/**
* Dial a number. This doesn't place the call. It displays
* the Dialer screen.
* @param number the number to be dialed. If null, this
* would display the Dialer screen with no number pre-filled.
*/
void dial(String number);

/**
* Place a call to the specified number.
* @param number the number to be called.
*/
void call(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.
*
* @return true if the call screen was shown.
*/
boolean showCallScreen();

/**
* Variation of showCallScreen() that also specifies whether the
* DTMF dialpad should be initially visible when the InCallScreen
* comes up.
*
* @param showDialpad if true, make the dialpad visible initially,
* otherwise hide the dialpad initially.
* @return true if the call screen was shown.
*
* @see showCallScreen
*/
boolean showCallScreenWithDialpad(boolean showDialpad);

/**
* End call or go to the Home screen
*
* @return whether it hung up
*/
boolean endCall();

/**
* 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).
*/
void answerRingingCall();

/**
* 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.)
*/
void silenceRinger();

/**
* Check if we are in either an active or holding call
* @return true if the phone state is OFFHOOK.
*/
boolean isOffhook();

/**
* Check if an incoming phone call is ringing or call waiting.
* @return true if the phone state is RINGING.
*/
boolean isRinging();

/**
* Check if the phone is idle.
* @return true if the phone state is IDLE.
*/
boolean isIdle();

/**
* Check to see if the radio is on or not.
* @return returns true if the radio is on.
*/
boolean isRadioOn();

/**
* Check if the SIM pin lock is enabled.
* @return true if the SIM pin lock is enabled.
*/
boolean isSimPinEnabled();

/**
* Cancels the missed calls notification.
*/
void cancelMissedCallsNotification();

/**
* Supply a pin to unlock the SIM. Blocks until a result is determined.
* @param pin The pin to check.
* @return whether the operation was a success.
*/
boolean supplyPin(String pin);

/**
* Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
* without SEND (so <code>dial</code> is not appropriate).
*
* @param dialString the MMI command to be executed.
* @return true if MMI command is executed.
*/
boolean handlePinMmi(String dialString);

/**
* Toggles the radio on or off.
*/
void toggleRadioOnOff();

/**
* Set the radio to on or off
*/
boolean setRadio(boolean turnOn);

/**
* Request to update location information in service state
*/
void updateServiceLocation();

/**
* Enable location update notifications.
*/
void enableLocationUpdates();

/**
* Disable location update notifications.
*/
void disableLocationUpdates();

/**
* Enable a specific APN type.
*/
int enableApnType(String type);

/**
* Disable a specific APN type.
*/
int disableApnType(String type);

/**
* Allow mobile data connections.
*/
boolean enableDataConnectivity();

/**
* Disallow mobile data connections.
*/
boolean disableDataConnectivity();

/**
* Report whether data connectivity is possible.
*/
boolean isDataConnectivityPossible();

Bundle getCellLocation();

/**
* Returns the neighboring cell information of the device.
*/
List<NeighboringCellInfo> getNeighboringCellInfo();

int getCallState();
int getDataActivity();
int getDataState();
}

ITelephony.aidl的更多相关文章

  1. start and end call use itelephony and how to pick up a call

    Bluetooth Headset service: 但想想而已. 没有蓝牙耳机如何调用它来接听电话.想想有点搞笑. 网上扒的通过添加一个ITelephony.aidl来反射,注意aidl的写法,如果 ...

  2. Android通过AIDL和反射调用系统拨打电话和挂断电话

    首先在项目中添加ITelephony.aidl文件,我的如下: /* * Copyright (C) 2007 The Android Open Source Project * * Licensed ...

  3. Android跨进程訪问(AIDL服务)

    我将AndroidAIDL的学习知识总结一下和大家共享 在Android开发中,AIDL主要是用来跨进程訪问. Android系统中的进程之间不能共享内存,因此,须要提供一些机制在不同进程之间进行数据 ...

  4. java攻城狮之路(Android篇)--BroadcastReceiver&Service

    四大组件:activity 显示. contentProvider 对外暴露自己的数据给其他的应用程序.BroadcastReceiver 广播接收者,必须指定要接收的广播类型.必须明确的指定acti ...

  5. Android自动接听&挂断电话(包含怎么应对4.1以上版本的权限检

    一  前言 这两天要研究类似白名单黑名单以及手势自动接听的一些功能,所以呢,自然而然的涉及到怎么自动接听/挂断电话的功能了.对于自动接听这一块,android4.1版本及其以上的版本和之前的版本处理逻 ...

  6. Android开发之通过反射获取到挂断电话的API

    Android开发黑名单工具类,需要用到挂断电话的API,但是该API处于隐藏状态,需要通过反射得到该方法.. 步骤: 1.通过当前类获取到ServiceManager的字节码 Class< ? ...

  7. android143 360 短信电话拦截

    package com.itheima.mobileguard.services; import java.lang.reflect.Method; import android.app.Servic ...

  8. Android提供的系统服务之--TelephonyManager(电话管理器)

    Android提供的系统服务之--TelephonyManager(电话管理器) 转载请注明出处--coder-pig TelephonyManager的作用: 用于管理手机通话状态,获取电话信息(设 ...

  9. Android核心基础(手机卫士的一个知识点总结)

    注意:有些功能是需要权限的,在这里并没有写出来,在程序运行中,根据程序报的错误,添加相应的权限即可,里面的具体里面可能有一些小细节,没有明确的写出来,具体的需要在程序中自己调试,解决. 这个总结涵盖了 ...

随机推荐

  1. lambda表达式/对象引用计数

    ★lambda表达式的用法例:I=[(lambda x: x*2),(lambda y: y*3)]调用:for x in I: print x(2)输出:4,6 ★获取对象的引用次数sys.getr ...

  2. Java 集合-Arrays工具类的介绍

    2017-10-31 18:39:46 Arrrays工具类:此类包含用来操作数组(比如排序和搜索)的各种方法. 常用方法: 主要是数组的一些常用方法如: asList:将数组转成集合 binaryS ...

  3. Confluence 6 为用户管理连接 Confluence 到 Crowd

    你可以连接你的 Confluence 应用程序到 Atlassian Crowd 或 a Jira (5.3 及后续版本)来管理你的用户和用户组以及针对他们的授权. Atlassian Crowd 是 ...

  4. 使用Python生成双色球号码

    说来也是巧,今天和一个朋友聊天,说他运气不错应该买彩票,于是就想到了双色球的规则,就写了几行代码产生双色球号码,代码如下: import random,time def process_int(x): ...

  5. Educational Codeforces Round 47 (Rated for Div. 2)F. Dominant Indices 线段树合并

    题意:有一棵树,对于每个点求子树中离他深度最多的深度是多少, 题解:线段树合并快如闪电,每个节点开一个权值线段树,递归时合并即可,然后维护区间最多的是哪个权值,到x的深度就是到根的深度减去x到根的深度 ...

  6. nyoj-310-河南省第四届省赛题目-二分+dinic

    SECRET 时间限制:3000 ms  |  内存限制:65535 KB 难度:6   描述 Dr.Kong is constructing a new machine and wishes to ...

  7. JDBC连接SqlServer数据库(非默认实例)方法

    一般我们在连接数据库的时候都是用的默认实例名,今天遇到了用非默认是实例名:连接代码如下(Java): URL=jdbc:microsoft:sqlserver://192.168.1.85//DEMO ...

  8. OAF在打开的新页面中添加按钮,功能是关闭当前页面

    OAF在打开的新页面中添加按钮,功能是关闭当前页面 javascript:close()

  9. PL/SQL Developer 一段时间后变慢,且导致数据库CPU100%的问题(转)

    参考: 一段时间不用plsql developer之后重新使用会变得很慢 plsql developer连接数据库导致服务器cpu升高的案例 1.pl/sql dev 变慢的问题,建议设置如下 2. ...

  10. spark streaming 入门例子

    spark streaming 入门例子: spark shell import org.apache.spark._ import org.apache.spark.streaming._ sc.g ...