去电流程分析---之一

1,去电流程分析

1.1 app dialer

拨号盘界面有关拨号的部分由DialpadFragment.java实现,无论是单卡还是双卡,当点击拨号按键时,最后都会调用

handleDialButtonPressed方法进行处理,调用流程图如下,


在handleDialButtonPressed方法中,首先进行号码的有效性检查,然后调用DialerUtils的startActivityWithErrorToast的方法进行处理,

final Intent intent = CallUtil.getCallIntent(number);
if (!isDigitsShown && !PhoneNumberUtils.isEmergencyNumber(number)) {
       // must be dial conference add extra
      intent.putExtra(EXTRA_DIAL_CONFERENCE_URI, true);
}
intent.putExtra(ADD_PARTICIPANT_KEY, mAddParticipant && isPhoneInUse());
if (subcription != INVALID_SUBSCRIPTION) {
    intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subcription);
}
DialerUtils.startActivityWithErrorToast(getActivity(), intent);
hideAndClearDialpad(false);//隐藏拨号盘

CallUtil的getCallIntent获取的intent,

final Intent intent = new Intent(Intent.ACTION_CALL, uri);

 DialerUtils的startActivityWithErrorToast方法在此就是启动一个Activity,

context.startActivity(intent);

这样,在dialer进程中就处理完成了。

1.2 services telecom

telecom 中的AndroidManifest有关定义如下,

package="com.android.server.telecom"
coreApp="true"
android:sharedUserId="android.uid.system"

并且,在UserCallActivity下面,定义了intent-filter等信息,

<intent-filter>
   <action android:name="android.intent.action.CALL" />
   <category android:name="android.intent.category.DEFAULT" />
   <data android:scheme="tel" />
</intent-filter>

因此, Intent.ACTION_CALL 会启动UserCallActivity,调用流程图如下,


UserCallActivity的onCreate方法如下,

new UserCallIntentProcessor(this, userHandle).processIntent(getIntent(),
                getCallingPackage(), true /* hasCallAppOp*/);

创建并调用UserCallIntentProcessor对象的processIntent方法,主要是一些检查,

if (!canCallNonEmergency && !TelephonyUtil.shouldProcessAsEmergency(mContext, handle)) {
     showErrorDialogForRestrictedOutgoingCa
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值