ImageVerifierCode 换一换
格式:DOCX , 页数:31 ,大小:24.71KB ,
资源ID:18409040      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/18409040.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(android通话流程浅析RIL层Word格式文档下载.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

android通话流程浅析RIL层Word格式文档下载.docx

1、 if (LOGV) Log.v(TAG, Broadcasting intent + broadcastIntent + .); sendOrderedBroadcast(broadcastIntent, PERMISSION, null, null, Activity.RESULT_OK, number, null);4、Intent.ACTION_NEW_OUTGOING_CALL实际字符串为android.intent.action.NEW_OUTGOING_CALL,通过查找知道了packegs/phone下面的androidmanifest.xml中OutgoingCallRece

2、iver Receiver接收此intent消息。找到OutgoingCallReceiver,执行onReceive()函数 Intent newIntent = new Intent(Intent.ACTION_CALL, uri); newIntent.putExtra(Intent.EXTRA_PHONE_NUMBER, number); newIntent.setClass(context, InCallScreen.class); newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);5、请求拨号的java部分流程onCreate(第一

3、次)/onNewIntent(非第一次) internalResolveIntent placeCall(intent); PhoneUtils.placeCall(mPhone, number, intent.getData(); phone.dial(number); mCT.dial(newDialString); dial(dialString, CommandsInterface.CLIR_DEFAULT); cm.dial(pendingMO.address, clirMode, obtainCompleteMessage();/obtainCompleteMessage(EVEN

4、T_OPERATION_COMPLETE); send(rr); msg = mSender.obtainMessage(EVENT_SEND, rr); acquireWakeLock(); msg.sendToTarget(); RILSender.handleMessage() case EVENT_SEND: . s.getOutputStream().write(dataLength); s.getOutputStream().write(data);/从这里流程跑到下面ril.cpp中监听部份 6、请求拨号的c/c+部分流程6.1、初始化事件循环,启动串口监听,注册socket监听

5、。rild.c-main() (1)、RIL_startEventLoop /建立事件循环线程 ret = pthread_create(&s_tid_dispatch, &attr, eventLoop, NULL); /注册进程唤醒事件回调 ril_event_set (&s_wakeupfd_event, s_fdWakeupRead, true, processWakeupCallback, NULL); rilEventAddWakeup (&s_wakeupfd_event); /建立事件循环 ril_event_loop for (;) n = select(nfds, &rfd

6、s, NULL, NULL, ptv); / Check for timeouts processTimeouts(); / Check for read-ready processReadReadies(&rfds, n); / Fire away firePending(); (2)、funcs = rilInit(&s_rilEnv, argc, rilArgv);/实际是通过动态加载动态库的方式执行reference-ril.c中的RIL_Init /单独启动一个线程读取串口数据s_tid_mainloop, &attr, mainLoop, NULL); fd = open (s_d

7、evice_path, O_RDWR); ret = at_open(fd, onUnsolicited);s_tid_reader, &attr, readerLoop, &attr); RIL_requestTimedCallback(initializeCallback, NULL, &TIMEVAL_0); 在initializeCallback中执行的程序: setRadioState (RADIO_STATE_OFF); at_handshake(); /* note: we dont check errors here. Everything important will be

8、handled in onATTimeout and onATReaderClosed */ /* atchannel is tolerant of echo but it must */ /* have verbose result codes */ at_send_command(ATE0Q0V1, NULL); /* No auto-answer */ATS0=0 /注册rild socket端口事件监听到事件循环中 (3)、RIL_register(funcs); s_fdListen = android_get_control_socket(SOCKET_NAME_RIL); ret

9、 = listen(s_fdListen, 4);s_listen_event, s_fdListen, false, listenCallback, NULL);/将此端口加入事件select队列s_listen_event); 如果rild socket端口有数据来了将执行listencallback函数 listencallback /为此客户端连接创建新的监听句柄,s_fdListen继续监听其他客户端的连接。 s_fdCommand = accept(s_fdListen, (sockaddr *) &peeraddr, &socklen);s_commands_event, s_f

10、dCommand, 1, processCommandsCallback, p_rs);s_commands_event); 6.2、socket监听,收到dial的socket请求processCommandsCallback /读数据到p_record中 ret = record_stream_get_next(p_rs, &p_record, &recordlen); processCommandBuffer(p_record, recordlen); p.setData(uint8_t *) buffer, buflen); / status checked at end status

11、 = p.readInt32(&request); status = p.readInt32 (&token);/请求队列中的序号 pRI = (RequestInfo *)calloc(1, sizeof(RequestInfo); pRI-token = token; /* 包含#include ril_commands.h语句,结构体如下: typedef struct int requestNumber; void (*dispatchFunction) (Parcel &p, struct RequestInfo *pRI); int(*responseFunction) (Parc

12、el &p, void *response, size_t responselen); CommandInfo; */pCI = &(s_commandsrequest);p_next = s_pendingRequests; s_pendingRequests = pRI;pCI-dispatchFunction(p, pRI); /假设是接收了dial指令,pRI-PCI-dispatchFunction(p,pRI),调用dispatchDial (p,pRI) dispatchDial (p,pRI) s_callbacks.onRequest(pRI-requestNumber, &

13、dial, sizeof(dial), pRI); in reference-ril.c onRequest() switch (request) case RIL_REQUEST_DIAL: requestDial(data, datalen, t); asprintf(&cmd, ATD%s%s;, p_dial-address, clir); ret = at_send_command(cmd, NULL); err = at_send_command_full (command, NO_RESULT, NULL, NULL, 0, pp_outResponse); err = at_s

14、end_command_full_nolock(command, type, responsePrefix, smspdu,timeoutMsec, sponse); err = writeline (command); /此处等待,直到收到成功应答或失败的应答,如:ok,connect,error cme等 err = pthread_cond_wait(&s_commandcond, &s_commandmutex); waiting. /* success or failure is ignored by the upper layer here. it will call GET_CU

15、RRENT_CALLS and determine success that way */ RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0); p.writeInt32 (RESPONSE_SOLICITED); p.writeInt32 (pRI- errorOffset = p.dataPosition(); p.writeInt32 (e); if (e = RIL_E_SUCCESS) /* process response on success */ ret = pRI-responseFunction(p, response, res

16、ponselen); if (ret != 0) p.setDataPosition(errorOffset); p.writeInt32 (ret); sendResponse(p); sendResponseRaw(p.data(), p.dataSize(); blockingWrite(fd, (void *)&header, sizeof(header); blockingWrite(fd, data, dataSize);6.4、串口监听收到atd命令的应答OK或no carrier等readerLoop() line = readline(); processLine(line)

17、; handleFinalResponse(line); pthread_cond_signal(&s_commandcond);/至此,前面的等待结束,接着执行RIL_onRequestComplete函数6.5、java层收到应答后的处理,以dial为例子. ril.java-RILReceiver.run() for(;) length = readRilMessage(is, buffer); p = Parcel.obtain(); p.unmarshall(buffer, 0, length); p.setDataPosition(0); processResponse(p); t

18、ype = p.readInt(); if (type = RESPONSE_SOLICITED) processSolicited (p); serial = p.readInt(); rr = findAndRemoveRequestFromList(serial); rr.mResult.sendToTarget();. CallTracker.java-handleMessage (Message msg) switch (msg.what) case EVENT_OPERATION_COMPLETE: ar = (AsyncResult)msg.obj; operationCompl

19、ete(); cm.getCurrentCalls(lastRelevantPoll);第二部分:unsolicited 消息从modem上报到java的流程。 c+部份 handleUnsolicited(line); if (s_unsolHandler != NULL) s_unsolHandler (line1, line2);/实际执行的是void onUnsolicited (const char *s, const char *sms_pdu) if (strStartsWith(s,+CRING: | strStartsWith(s,RINGNO CARRIER+CCWA )

20、RIL_onUnsolicitedResponse (RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED, NULL, 0); p.writeInt32 (RESPONSE_UNSOLICITED); p.writeInt32 (unsolResponse); ret = s_unsolResponsesunsolResponseIndex.responseFunction(p, data, datalen); ret = sendResponse(p); ret = blockingWrite(fd, (void *)& java部份 processUnsolicit

21、ed (p); response = p.readInt(); switch(response) case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED: ret = responseVoid(p); break; if (RILJ_LOGD) unsljLog(response); mCallStateRegistrants .notifyRegistrants(new AsyncResult(null, null, null);第三部分、第四部分:猫相关的各种状态的监听和通知机制通话相关的图标变换的工作原理。网络状态,edge,gprs图标的处理a、注册监听部

22、分=SystemServer.java init2() Thread thr = new ServerThread(); thr.setName(android.server.ServerThread thr.start(); ServerThread.run() com.android.server.status.StatusBarPolicy.installIcons(context, statusBar); sInstance = new StatusBarPolicy(context, service); / phone_signal mPhone = (TelephonyManager)context.getSystemSe

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1