在我的概念中,Telephony是从GsmcdmaPhone这个对象往下数的Telephony层。 实际上,Telephony的概念还包括这三个部分,我认为这是Call App的模块:
/packages/services/telephony==teleservice.apk/packages/services/telecomm==telecomm.apk/frameworks/base
/packages/apps/dialer/Java/com/Android/incallui==incallui文章从框架中说明了这三个模块的关系,组织和调用传入的流程
只谈框架流程,不谈具体细节。
先看看前面的图,大致看看他们的调用关系。
如上图所示,
teleservice==telephonyframeworkphonebase; 电信和框架交互; Telecomm service/telecomm fw==Teleservice,teleservice与InCallUI的相互作用应通过telecomm层; incallui==telecomm service/telecomm fw交互; 这是一个基本的体系结构,要清楚地了解交互式消息是如何传输的,电信看起来就像是一个中间的桥梁。
电话的主要班级
TeleService的TelephonyConnection监听来自PhoneBase的呼叫状态的变化,并通过与connectionService相关的类(ConnectionServiceWrapper )进行通信
从Telecomm到InCallUI的过程从呼叫管理器传递到InCallController,最后通过InCallServiceImpl传递到InCallUI。
中间层call的转化需要经由Telecom FW。
电话的主要服务
打开电源,加载telecommserviceimpl (telecomm manager ),创建呼叫管理器和InCallController; 同时创建PhoneAccount,拦截来电信息; 来电、创建电话连接服务、创建电话连接监听呼叫状态变化; 呼叫管理器回调InCallController,通知InCallService,最终更新为InCallUI .来电流程图
callsmanagerandincallcontrollercreatebytelecomservicewhensystembootup; elecomaccountresigistrycreatepstnincomingcallnotifer,anditregisternotificationtophonebase, includingevent((event_new ) ) ) ) ) ptnincomingcallnotifierreceiveincomingcallevent,itwillettelecomservent 呼叫管理器创建呼叫实例,andsetitselfascall.listener.callsmanagergivecalltheconnectionservicewrapperreference, socallcanaccessconnectionservice.callrequestconnectionservicetocreateconnectionthencallbacktocreateconnectionresponse.when callwillletitslisteners,callsmanager,knowit.whensomethingischangedfromconnectionservice, wapperwillreceivetheeventandthentelltocallorcallsmanager.aftercreateconnectionsuccessfully, callsmanagerwillcallonsuccesision incallcontrolleraslistenerwillcalloncalladded (,andthenincallserviceadddcalllandenterincalincaterincal
telephonyconnectionservicegettheorginalconnection (framework ) first.Create GsmConnection/cdmaconnectiondependsonthephonetype.eachtelephonyconnectionregisternotificationtophonebasebythemselves,listenertothem.sothem telephonyconnectionwillreceiveandthenbroadcasttoallisteners (连接服务).alltheeventwilldeliverbylistenerlike 3360