㈠ android怎么实现自动接听和挂断电话功能
android 实现来电自动接听和自动挂断的方法:
第一步:准备应用环境需要的系统包和aidl文件。
(1)在应用中创建包:android.telephony
将android系统框架下的\framework\telephony\java\android\telephony目录中的NeighboringCellInfo.aidl文件复制到上面创建的包(android.telephony )中;
(2)在应用中创建包:com.android.internal.telephony
将android系统框架下的\framework\telephony\java\com\android\internal\telephony目录中的ITelephony.aidl文件复制到上面创建的包(com.android.internal.telephony )中。
第二步:创建一个获取ITelephony的方法
PhoneUtils.java
package com.zhouzijing.android.demo;
import java.lang.reflect.Method;
import com.android.internal.telephony.ITelephony;
import android.telephony.TelephonyManager;
public class PhoneUtils {
/**
* 根据传入的TelephonyManager来取得系统的ITelephony实例.
* @param telephony
* @return 系统的ITelephony实例
* @throws Exception
*/
public static ITelephony getITelephony(TelephonyManager telephony) throws Exception {
Method getITelephonyMethod = telephony.getClass().getDeclaredMethod("getITelephony");
getITelephonyMethod.setAccessible(true);//私有化函数也能使用
return (ITelephony)getITelephonyMethod.invoke(telephony);
}
}
第三步:创建电话广播拦截器
MyPhoneBroadcastReceiver.java
package com.zhouzijing.android.demo;
import com.android.internal.telephony.ITelephony;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
import android.util.Log;
public class MyPhoneBroadcastReceiver extends BroadcastReceiver {
private final static String TAG = MyPhone.TAG;
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.i(TAG, "[Broadcast]"+action);
//呼入电话
if(action.equals(MyPhone.B_PHONE_STATE)){
Log.i(TAG, "[Broadcast]PHONE_STATE");
doReceivePhone(context,intent);
}
}
/**
* 处理电话广播.
* @param context
* @param intent
*/
public void doReceivePhone(Context context, Intent intent) {
String phoneNumber = intent.getStringExtra(
TelephonyManager.EXTRA_INCOMING_NUMBER);
TelephonyManager telephony = (TelephonyManager)context.getSystemService(
Context.TELEPHONY_SERVICE);
int state = telephony.getCallState();
switch(state){
case TelephonyManager.CALL_STATE_RINGING:
Log.i(TAG, "[Broadcast]等待接电话="+phoneNumber);
try {
ITelephony iTelephony = PhoneUtils.getITelephony(telephony);
iTelephony.answerRingingCall();//自动接通电话
//iTelephony.endCall();//自动挂断电话
} catch (Exception e) {
Log.e(TAG, "[Broadcast]Exception="+e.getMessage(), e);
}
break;
case TelephonyManager.CALL_STATE_IDLE:
Log.i(TAG, "[Broadcast]电话挂断="+phoneNumber);
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
Log.i(TAG, "[Broadcast]通话中="+phoneNumber);
break;
}
}
}
第四部:注册电话广播拦截器
MyPhone.java
package com.zhouzijing.android.demo;
import android.app.Activity;
import android.content.IntentFilter;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.view.View;
public class MyPhone extends Activity {
public final static String TAG = "MyPhone";
public final static String B_PHONE_STATE = TelephonyManager.ACTION_PHONE_STATE_CHANGED;
private MyPhoneBroadcastReceiver mBroadcastReceiver;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.my_phone);
}
//按钮1-注册广播
public void registerThis(View v) {
Log.i(TAG, "registerThis");
mBroadcastReceiver = new MyPhoneBroadcastReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(B_PHONE_STATE);
intentFilter.setPriority(Integer.MAX_VALUE);
registerReceiver(mBroadcastReceiver, intentFilter);
}
//按钮2-撤销广播
public void unregisterThis(View v) {
Log.i(TAG, "unregisterThis");
unregisterReceiver(mBroadcastReceiver);
}
}
第5步:在AndroidManifest.xml配置权限
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
其中:
iTelephony.answerRingingCall();//自动接通电话
必须有权限 android.permission.MODIFY_PHONE_STATE
iTelephony.endCall();//自动挂断电话
必须有权限 android.permission.CALL_PHONE。
㈡ android framework的opt/telephony是什么进程
本文代码以MTK平台Android 6.0为分析对象,与Google原生AOSP有些许差异,请读者知悉。
PhoneApp(包名com.android.phone)主要代码位于
packages/services/Telephony/
frameworks/opt/telephony/
frameworks/base/telephony/
com.android.phone进程是persistent的,在开机过程中被ActivityManagerService自动启动,下图为该进程启动将要涉及到的类(以GSMPhone为例),图中类之间的关系表达可能不太准确,仅供参考。
㈢ android开发 itelephony有什么方法
android4.0之后应用程序无法再获得Home键消息,这样是对滴,但如果想自己写Launcher就得对Home键相关的一些消息进行处理了。Home消息是在androidframwork中处理的,我们找到Home键处理相关的代码(不想细看的可以直接看最后)frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java中的PhoneWindowManager.函数中有以下内容//,soapplications//canneverbreakit,althoughifkeyguardison,wedolet//ithandleit,//timeout.if(keyCode==KeyEvent.KEYCODE_HOME){//Ifwehavereleasedthehomekey,anddidn'tdoanythingelse//whileitwaspressed,thenitistimetogohome!if(mHomePressed&&!down){mHomePressed=false;if(!canceled){//Ifanincomingcallisringing,HOMEistotallydisabled.//(,//.)booleanincomingRinging=false;try{ITelephonytelephonyService=getTelephonyService();if(telephonyService!=null){incomingRinging=telephonyService.isRinging();//是否正好有电话打进来}}catch(RemoteExceptionex){Log.w(TAG,"()",ex);}if(incomingRinging){Log.i(TAG,"IgnoringHOME;there'saringingincomingcall.");//来电中的时候可以看到打印个消息就完了}else{launchHomeFromHotKey();//可以看到这里有launchHome,应该是这里通知了Launcher程序,继续往下看}}else{Log.i(TAG,"IgnoringHOME;eventcanceled.");}return-1;}//Ifasystemwindowhasfocus,thenitdoesn'tmakesense//.//这一段没有看的很明白,不过很明显没有对Home键处理,只是判断了一些情况然后返回了WindowManager.LayoutParamsattrs=win!=null?win.getAttrs():null;if(attrs!=null){finalinttype=attrs.type;if(type==WindowManager.LayoutParams.TYPE_KEYGUARD||type==WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG){//the"app"iskeyguard,sogiveitthekeyreturn0;}finalinttypeCount=WINDOW_TYPES_WHERE_HOME_DOESNT_WORK.length;for(inti=0;ilaunchhomeactionwasdetected.Taketheappropriateaction*.*/voidlaunchHomeFromHotKey(){if(mKeyguardMediator.isShowingAndNotHidden()){//don'tlaunchhomeifkeyguardshowing//这个keyguard不知道是什么东东,反正它启动了就不响应Home键,系统已经处理了,跟Launcher没关系}elseif(!mHideLockScreen&&mKeyguardMediator.isInputRestricted()){//wheninkeyguardrestrictedmode,mustfirstverifyunlock//.verifyUnlock(newOnKeyguardExitResult(){(booleansuccess){if(success){try{ActivityManagerNative.getDefault().stopAppSwitches();//关闭这个东东}catch(RemoteExceptione){}sendCloseSystemWindows(SYSTEM_DIALOG_REASON_HOME_KEY);//关闭这个东东startDockOrHome();//启动Dock或者Home很明显这三个函数都很重要一个一个去看看}}});}else{//nokeyguardstufftoworryabout,justlaunchhome!//这里跟上面是一样处理的try{ActivityManagerNative.getDefault().stopAppSwitches();}catch(RemoteExceptione){}sendCloseSystemWindows(SYSTEM_DIALOG_REASON_HOME_KEY);startDockOrHome();}}进入sendCloseSystemWindows,startDockOrHome两个函数看看voidsendCloseSystemWindows(){sendCloseSystemWindows(mContext,null);}voidsendCloseSystemWindows(Stringreason){sendCloseSystemWindows(mContext,reason);}(Contextcontext,Stringreason){if(ActivityManagerNative.isSystemReady()){try{ActivityManagerNative.getDefault().closeSystemDialogs(reason);//又是调用这个了}catch(RemoteExceptione){}}}voidstartDockOrHome(){Intentdock=createHomeDockIntent();if(dock!=null){try{mContext.startActivity(dock);//启动HomeDock这个Dock好像是自定义的主界面,这里就不管了return;}catch(ActivityNotFoundExceptione){}}mContext.startActivity(mHomeIntent);//启动HomeIntent(其实就是发一个Intent消息到主界面)}我们再看看mHomeIntent是怎么定义的IntentmHomeIntent;mHomeIntent=newIntent(Intent.ACTION_MAIN,null);mHomeIntent.addCategory(Intent.CATEGORY_HOME);mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);Launcher中接受Intent的地方在Launcher2\Launcher2\src\com\android\launcher2\launcher.javaprotectedvoidonNewIntent(Intentintent){}函数中这里就不分析了,先试试能不能接受到再说。nnd搞了半天Launcher根本没接受Home键,按Home键时farmwork直接给Launcher调到最前面来了。
㈣ android开发怎么监控来电并监听
实现如下广播,并且在AndroidManifest中进行注册
public class PhoneReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
System.out.println("action"+intent.getAction());
//如果是去电
if(intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)){
String phoneNumber = intent
.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
Log.d(TAG, "call OUT:" + phoneNumber);
}else{
//查了下android文档,貌似没有专门用于接收来电的action,所以,非去电即来电.
//如果我们想要监听电话的拨打状况,需要这么几步 :
* 第一:获取电话服务管理器TelephonyManager manager = this.getSystemService(TELEPHONY_SERVICE);
* 第二:通过TelephonyManager注册我们要监听的电话状态改变事件。manager.listen(new MyPhoneStateListener(),
* PhoneStateListener.LISTEN_CALL_STATE);这里的PhoneStateListener.LISTEN_CALL_STATE就是我们想要
* 监听的状态改变事件,初次之外,还有很多其他事件哦。
* 第三步:通过extends PhoneStateListener来定制自己的规则。将其对象传递给第二步作为参数。
* 第四步:这一步很重要,那就是给应用添加权限。android.permission.READ_PHONE_STATE
TelephonyManager tm = (TelephonyManager)context.getSystemService(Service.TELEPHONY_SERVICE);
tm.listen(listener, PhoneStateListener.LISTEN_CALL_STATE);
//设置一个监听器
}
}
PhoneStateListener listener=new PhoneStateListener(){
@Override
public void onCallStateChanged(int state, String incomingNumber) {
//注意,方法必须写在super方法后面,否则incomingNumber无法获取到值。
super.onCallStateChanged(state, incomingNumber);
switch(state){
case TelephonyManager.CALL_STATE_IDLE:
System.out.println("挂断");
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
System.out.println("接听");
break;
case TelephonyManager.CALL_STATE_RINGING:
System.out.println("响铃:来电号码"+incomingNumber);
//输出来电号码
break;
}
}
㈤ android中怎么实现,来电的自动接听,并且使
android 实现来电自动接听和自动挂断的方法:
第一步:准备应用环境需要的系统包和aidl文件。
(1)在应用中创建包:android.telephony
将android系统框架下的\framework\telephony\java\android\telephony目录中的NeighboringCellInfo.aidl文件复制到上面创建的包(android.telephony )中;
(2)在应用中创建包:com.android.internal.telephony
将android系统框架下的\framework\telephony\java\com\android\internal\telephony目录中的ITelephony.aidl文件复制到上面创建的包(com.android.internal.telephony )中。
第二步:创建一个获取ITelephony的方法
PhoneUtils.java
package com.zhouzijing.android.demo;
㈥ android.telephony.telephonymanager怎么反射调用
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
/**
* 返回电话状态
*
* CALL_STATE_IDLE 无任何状态时
* CALL_STATE_OFFHOOK 接起电话时
* CALL_STATE_RINGING 电话进来时
*/
tm.getCallState();
//返回当前移动终端的位置
CellLocation location=tm.getCellLocation();
//请求位置更新,如果更新将产生广播,接收对象为注册LISTEN_CELL_LOCATION的对象,需要的permission名称为ACCESS_COARSE_LOCATION。
location.requestLocationUpdate();
㈦ 如何导入com.android.internal.telephony
果你要定制一个Android系统,你想用你自己的Launcher(Home)作主界面来替换Android自己的Home,而且不希望用户安装的Launcher来替换掉你的Launcher. 我们可以通过修改Framework来实现这样的功能。 这里以Android2.1的源代码为例来实际说明。 1)首先了解一下Android的启动过程。 Android系统的启动先从Zygote开始启动,然后......(中间的过程就不说了).....一直到了SystemServer(framework)这个地方,看到这段代码: /** * This method is called from Zygote to initialize the system. This will cause the native * services (SurfaceFlinger, AudioFlinger, etc..) to be started. After that it will call back * up into init2() to start the Android services. */ native public static void init1(String[] args); public static void main(String[] args) { if (SamplingProfilerIntegration.isEnabled()) { SamplingProfilerIntegration.start(); timer = new Timer(); timer.schele(new TimerTask() { @Override public void run() { SamplingProfilerIntegration.writeSnapshot("system_server"); } }, SNAPSHOT_INTERVAL, SNAPSHOT_INTERVAL); } // The system server has to run all of the time, so it needs to be // as efficient as possible with its memory usage. VMRuntime.getRuntime().setTargetHeapUtilization(0.8f); System.loadLibrary("android_servers"); init1(args); } public static final void init2() { Log.i(TAG, "Entered the Android system server!"); Thread thr = new ServerThread(); thr.setName("android.server.ServerThread"); thr.start(); } } 从SystemServer的main函数开始启动各种服务。 首先启动init1,然后启动init2. 从上面的注释可以看到:init1这个方法时被Zygote调用来初始化系统的,init1会启动native的服务如SurfaceFlinger,AudioFlinger等等,这些工作做完以后会回调init2来启动Android的service。 这里我们主要来关注init2的过程。 init2中启动ServerThread线程, ServerThread中启动了一系列的服务,比如这些: ActivityManagerService EntropyService PowerManagerService TelephonyRegistry PackageManagerService AccountManagerService BatteryService HardwareService Watchdog SensorService BluetoothService StatusBarService ClipboardService InputMethodManagerService NetStatService ConnectivityService AccessibilityManagerService NotificationManagerService MountService DeviceStorageMonitorService LocationManagerService SearchManagerService FallbackCheckinService WallpaperManagerService AudioService BackupManagerService AppWidgetService 这些大大小小的服务起来以后,开始 ((ActivityManagerService)ActivityManagerNative.getDefault()).systemReady() 在systemReady后开始开始启动Launcher。 在寻找Launcher的时候是根据HOME的filter(在Manifest中定义的<category android:name="android.intent.category.HOME" />)来过滤。 然后根据filter出来的HOME来启动,如果只有一个HOME,则启动这个HOME,如果用户自己装了HOME,那就会弹出来一个列表供用户选择。 我们现在希望从这里弹出我们自己定制的Launcher,同时也不希望弹出选择HOME的界面,我们不希望用户修改我们的home,比如我们的home上放了好多广告,以及强制安装的程序,不希望用户把它干掉。 我们可以通过这样来实现: 2) 定义一个私有的filter选项,然后用这个选项来过滤HOME. 一般情况下我们使用Manifest中定义的<category android:name="android.intent.category.HOME"来过滤的,我们现在增加一个私有的HOME_FIRST过滤。 在Intent.java(frameworks/base/core/java/android/content/Intent.java)中添加两行代码 //lixinso:添加CATEGORY_HOME_FIRST @SdkConstant(SdkConstantType.INTENT_CATEGORY) public static final String CATEGORY_HOME_FIRST = "android.intent.category.HOME_FIRST"; 3)修改和CATEGORY_HOME相关的所有的地方,都改成HOME_FIRST,主要是framework中的这几个地方: frameworks/base/services/java/com/android/server/am/ActivityManagerService.java中 //intent.addCategory(Intent.CATEGORY_HOME); 改成intent.addCategory(Intent.CATEGORY_HOME_FIRST); //lixinso: //if (r.intent.hasCategory(Intent.CATEGORY_HOME)) { 改成if (r.intent.hasCategory(Intent.CATEGORY_HOME_FIRST)) { //lixinso: Intent.CATEGORY_HOME -> Intent.CATEGORY_HOME_FIRST frameworks/base/services/java/com/android/server/am/HistoryRecorder.java中 // _intent.hasCategory(Intent.CATEGORY_HOME) && 改成 _intent.hasCategory(Intent.CATEGORY_HOME_FIRST) && //lixinso: Intent.CATEGORY_HOME->Intent.CATEGORY_HOME_FIRST frameworks/policies/base/mid/com/android/internal/policy/impl/MidWindowManager.java中 //mHomeIntent.addCategory(Intent.CATEGORY_HOME); 改成 mHomeIntent.addCategory(Intent.CATEGORY_HOME_FIRST); //lixinso frameworks/policies/base/mid/com/android/internal/policy/impl/RecentApplicationsDialog.java中 //new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME),0); 改成 new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME_FIRST),0); //lixinso frameworks/policies/base/phone/com/android/internal/policy/impl/PhoneWindowManager.java中 //mHomeIntent.addCategory(Intent.CATEGORY_HOME); 改成 mHomeIntent.addCategory(Intent.CATEGORY_HOME_FIRST); //lixinso frameworks/policies/base/phone/com/android/internal/policy/impl/RecentApplicationsDialog.java中 //ResolveInfo homeInfo = pm.resolveActivity(new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME),0); 改成 ResolveInfo homeInfo = pm.resolveActivity(new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME_FIRST),0); //lixinso 4) 写一个自己的Launcher. 可以参考android sample中的Launcher,或者android源代码中的 /packages/apps/Launcher 来写。 在Launcher中标记其是不是Launcher的最关键的代码时Manifest中的filter:android:name="android.intent.category.HOME" 现在我们定义了自己的filter,那么,我们在我们自己写的Launcher中将Manifest改为: <application android:process="android.process.acore3" android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".FirstAppActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME_FIRST" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.MONKEY" /> </intent-filter> </activity> </application> 然后将编译好的apk放到/out/target/proct/generic/system/app目录下。 5)将Android自带的Launcher删除掉,包括源代码(packages/apps/Launcher)和apk(/out/target/proct/generic/system/app/Launcher.apk)。 6) 做完这些工作,就可以重新编译Android了,我们可以编译修改过的几个相关的包。 如果之前编译过了Android源码,可以用mmm命令来编译部分的改动。 这里需要这样编译: $ . build/envsetup.sh $ mmm frameworks/base $ mmm frameworks/base/services/java $ mmm frameworks/policies/base/mid $ mmm frameworks/policies/base/phone 7) 编译完成后重新生成img文件。 $ make snod 8) 现在可以启动Android模拟器来看效果了。 首先设置环境变量: $ export ANDROID_PRODUCT_OUT= ./out/target/proct/generic 然后切换到 $ cd ./out/host/linux-x86/bin 运行 $ ./emulator 这样我们启动的模拟器里面用的image就是我们刚才编译好的自己定制的东西了。 从模拟器上可以看到启动的Launcher是我们自己的Launcher,不会出现默认的Launcher了,也不会出现选择界面。 9)我们再验证一下,如果用户装上了一个其他的Launcher(Home)会怎么样。 从网上找一个一般的Launcher或者自己写一个一般的Launcher装上去,重新启动,不会出现选择界面。 按HOME键也不会出来两个HOME来选择。
㈧ android 手机启动时,telephony 相关的都做了哪些事情
先看一段注释:
/* Once created UiccController registers with RIL for "on" and "unsol_sim_status_changed"
* notifications. When such notification arrives UiccController will call
* getIccCardStatus (GET_SIM_STATUS). Based on the response of GET_SIM_STATUS
* request appropriate tree of uicc objects will be created.
*
* Following is class diagram for uicc classes:
*
* UiccController
* #
* |
* UiccCard
* # #
* | ------------------
* UiccCardApplication CatService
* # #
* | |
* IccRecords IccFileHandler
* ^ ^ ^ ^ ^ ^ ^ ^
* SIMRecords---- | | | | | | ---SIMFileHandler
* RuimRecords----- | | | | ----RuimFileHandler
* IsimUiccRecords--- | | -----UsimFileHandler
* | ------CsimFileHandler
* ----IsimFileHandler
*
* Legend: # stands for Composition
* ^ stands for Generalization
*/
这是UiccController.java文件开头对UiccController的注释,意思很明显UiccController是对Android SIM卡管理的控制器。
下面是SIM卡初始化序列图:
UiccController的初始化是在phone进程启动的时候,PhoneFactory调用makeDefaultPhone()创建默认的Phone,然后走MTK双卡流程中,调用MTKPhoneFactory.makeDefaultPhone()创建的,
{
for (int l2 = 0; l2 < PhoneConstants.GEMINI_SIM_NUM; l2++)
if (j1 == l2)
ai[l2] = j;
else
ai[l2] = 1;
I = new RIL(context, ai[0], l, 0);
J = new RIL(context, ai[1], l, 1);
}
UiccController.make(context, I, 0);
UiccController.make(context, J, 1);
GSMPhone agsmphone[] = new GSMPhone[PhoneConstants.GEMINI_SIM_NUM];
上面是反编译MTK的static_gemini_intermediates库看到的,在RIL创建完成时,使用UiccController.make()初始化:
public static UiccController make(Context c, CommandsInterface ci, int simId) {
synchronized (mLock) {
if (FeatureOption.MTK_GEMINI_SUPPORT) {
if(mInstance[simId] != null) {
throw new RuntimeException("UiccController.make() should only be called once");
}
mInstance[simId] = new UiccController(c, ci, simId);
return mInstance[simId];
} else {
if (mInstance[0] != null) {
throw new RuntimeException("UiccController.make() should only be called once");
}
mInstance[0] = new UiccController(c, ci);
return mInstance[0];
}
}
}
UiccController的创建使用了单例模式,使用时调用getInstance()获取,
public static UiccController getInstance(int simId) {
synchronized (mLock) {
if (FeatureOption.MTK_GEMINI_SUPPORT) {
if(mInstance[simId] == null) {
throw new RuntimeException(
"UiccController.getInstance can't be called before make()");
}
return mInstance[simId];
} else {
if (mInstance[0] == null) {
throw new RuntimeException(
"UiccController.getInstance can't be called before make()");
}
return mInstance[0];
}
}
}
private UiccController(Context c, CommandsInterface ci, int simId) {
if (DBG) log("Creating UiccController simId " + simId);
mContext = c;
mCi = ci;
mSimId = simId;
mCi.registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, null);
// TODO remove this once modem correctly notifies the unsols
mCi.registerForOn(this, EVENT_ICC_STATUS_CHANGED, null);
mCi.registerForVirtualSimOn(this, EVENT_VIRTUAL_SIM_ON, null);
mCi.registerForVirtualSimOff(this, EVENT_VIRTUAL_SIM_OFF, null);
mCi.registerForSimMissing(this, EVENT_SIM_MISSING, null);
mCi.registerForSimRecovery(this, EVENT_SIM_RECOVERY, null);
mCi.registerForSimPlugOut(this, EVENT_SIM_PLUG_OUT, null);
mCi.registerForSimPlugIn(this, EVENT_SIM_PLUG_IN, null);
mCi.registerForInvalidSimDetected(this, EVENT_INVALID_SIM_DETECTED, null);
IntentFilter filter = new IntentFilter();
filter.addAction("android.intent.action.ACTION_SHUTDOWN_IPO");
filter.addAction(GeminiPhone.EVENT_INITIALIZATION_FRAMEWORK_DONE);
filter.addAction(TelephonyIntents.ACTION_SIM_INFO_UPDATE);
filter.addAction(ACTION_RESET_MODEM);
mContext.registerReceiver(mIntentReceiver, filter);
}
㈨ com.android.providers.telephony是什么程序、
是android开发中的一个工具包,提供一些必要的服务,例如:
Android系统采用SQLite数据库方式存储所有接收到的短信,短信的SQLite数据库文件位于:
/data/data/com.android.providers.telephony/databases/mmssms.db
备份Android短信数据库到SD卡上,可以使用adb工具连接手机,然后使用如下命令
busybox cp /data/data/com.android.providers.telephony/databases/mmssms.db /sdcard
如果busybox cp命令不行,还可以使用cat命令:
cat /data/data/com.android.providers.telephony/databases/mmssms.db > /sdcard/mmssms.db
㈩ 深入理解android telephony原理剖析与最佳实践 是android 什么版本de
卷1主要讲的一些Android世界的由来和一些学习底层库所需掌握的知识,然后讲了音频Audiolinger和图像Surfacelinger,和一些其他的服务,对应用层和框架层开发意义不大。卷2主要讲的是框架层Framework的知识,对系统开发有帮助。卷3主要讲和UI相关的,对应用帮助最大就是这本书了,里面也讲了很多系统开发相关的知识。