cdma短信Qcril分析

本文详细解析了在Android QCRIL中发送CDMA短信的过程。从RIL.java的RIL_REQUEST_CDMA_SEND_SMS请求开始,经过qcril.c的onRequest处理,包括请求检查、参数存储、日志打印、QMI相关操作,最终调用qcril_qmi_sms_unsolicited_indication_cb_helper进行响应处理,并通过qcril_sms_convert_mt_cdma_sms_to_RIL_format将QMI格式的短信转化为RIL格式,完成发送流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、发送短信

RIL.java发送RIL_REQUEST_CDMA_SEND_SMS 请求后,qcril.c进入onRequest进行处理。

[00063/02]MSG    02:35:24.035Android QCRIL/High                       qcril.c  05445  RIL[1][main] onRequest: UI --- RIL_REQUEST_CDMA_SEND_SMS (87) ---> RIL [RID 1, token id 11424, data len 372]

在onRequest中,先检查该request是否支持。qcril_request_check_if_suppressed判断该request是否在qcril_request_suppress_list列表中。

[00063/00]MSG    02:35:24.035Android QCRIL/Low                        qcril.c  11222  RIL[1][main] qcril_request_check_if_suppressed: function exit with ret 0

下面会先后判断是否RIL_REQUEST_DIAL或RIL_REQUEST_SETUP_DATA_CALL、RIL_REQUEST_RADIO_POWER或RIL_REQUEST_SCREEN_STATE、RIL_REQUEST_SET_MUTE。(这里暂时不分析这几个request,先略过)。如果不是这几个request,则QCRIL_LOG_CF_PKT_RIL_REQ(这个是干什么的,与QCRIL_LOG_DEBUG有什么区别)

 

[00063/02]MSG    02:35:24.035Android QCRIL/High                       qcril.c  05508  RIL[1][main] onRequest: data stream received from telephony

qcril_qmi_print_hex打印qmi日志。

接下来会针对RIL_REQUEST_OEM_HOOK_RAW进行处理(这里略过)。

接下来开始处理request,先调用qmi_ril_fw_android_request_flow_control_info_lock来设置锁。

[00063/02]MSG    02:35:24.036Android QCRIL/High                       qcril.c  05550  RIL[1][main] onRequest: android request id 87

[00063/02]MSG    02:35:24.036Android QCRIL/High                       qcril.c  05557  RIL[1][main] onRequest: handling caps 51200060 hex

 

调用qmi_ril_fw_create_android_live_params_copy函数存储参数到android_request_param_copy中。

  QCRIL_LOG_FUNC_ENTRY();//打印函数进入的日志:

[00063/00]MSG    02:35:24.036Android QCRIL/Low                        qcril.c  09503  RIL[1][main] qmi_ril_fw_create_android_live_params_copy: function entry

[00063/02]MSG    02:35:24.036Android QCRIL/High                       qcril.c  09504  RIL[1][main] qmi_ril_fw_create_android_live_params_copy: a-r-id 87, a-data 0xabf7afd0, a-data-len 372

[00063/01]MSG    02:35:24.036Android QCRIL/Medium                     qcril.c  10447  RIL[1][main] qmi_ril_fw_create_android_live_params_copy: .. params for Android request id 87 are of complex structure and cloned to 0xab60d900 length 372

  QCRIL_LOG_FUNC_RETURN_WITH_RET( (int)res );//打印函数退出日志

[00063/00]MSG    02:35:24.036Android QCRIL/Low                        qcril.c  10460  RIL[1][main] qmi_ril_fw_create_android_live_params_copy: function exit with ret 2

 

QCRIL_LOG_DEBUG( "method %d, datalen %d", (int)request_param_method, datalen );

[00063/02]MSG    02:35:24.037Android QCRIL/High                       qcril.c  05576  RIL[1][main] onRequest: method 2, datalen 372

 

调用qmi_ril_fw_android_request_flow_control_find_busy_kind(?这个函数)

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08760  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_busy_kind: function entry

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08797  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_busy_kind: function exit with ret 0

 

[00063/02]MSG    02:35:24.037Android QCRIL/High                       qcril.c  05665  RIL[1][main] onRequest: clean family 0

 

//qmi_ril_fw_android_request_flow_control_find_request_for_execution

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08858  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_request_for_execution: function entry

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08838  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_outstanding_request_within_kind: function exit with ret 0

[00063/00]MSG    02:35:24.037Android QCRIL/Low                        qcril.c  08945  RIL[1][main] qmi_ril_fw_android_request_flow_control_find_request_for_execution: function exit with ret 0

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05678  RIL[1][main] onRequest: already waiting for exec 0

 

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05713  RIL[1][main] onRequest: android_request_param_holder af665400 hex

[00063/00]MSG    02:35:24.038Android QCRIL/Low                        qcril.c  09313  RIL[1][main] qmi_ril_fw_android_request_flow_control_overview_request_review_holders: function entry

[00063/00]MSG    02:35:24.038Android QCRIL/Low                        qcril.c  09358  RIL[1][main] qmi_ril_fw_android_request_flow_control_overview_request_review_holders: function exit

 

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05725  RIL[1][main] onRequest: pending req kind 0x0 hex, awaitingexec req kind 0x0 hex

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05753  RIL[1][main] onRequest: token under exec 11424

 

//调用qmi_ril_fw_android_request_flow_control_info_unlock()解锁

 

[00063/02]MSG    02:35:24.038Android QCRIL/High                       qcril.c  05762  RIL[1][main] onRequest: pre-exec token id 11424, a-r-id 87, audit 0, nrender 0

 

//调用qmi_ril_fw_android_request_render_execution

[00063/00]MSG    02:35:24.040Android QCRIL/Low                        qcril.c  08392  RIL[1][main] qmi_ril_fw_android_request_render_execution: function entry

[00063/02]MSG    02:35:24.040Android QCRIL/High                       qcril.c  08404  RIL[1][main] qmi_ril_fw_android_request_render_execution: rendering exec for token id 11424

    //调用qcril_execute_event

[00063/00]MSG    02:35:24.040Android QCRIL/Low                        qcril.c  06116  RIL[1][main] qcril_execute_event: function entry

      //do dispatch internally

      QCRIL_LOG_INFO("Dispatching event/android request..");

      error = qcril_dispatch_event( entry_ptr, params_ptr );

[00063/01]MSG    02:35:24.040Android QCRIL/Medium                     qcril.c  06233  RIL[1][main] qcril_execute_event: Dispatching event/android request..

 

进入qcril_qmi_sms.c的qcril_sms_request_cdma_send_sms方法

[00063/00]MSG    02:35:24.040Android QCRIL/Low                qcril_qmi_sms.c  03085  RIL[1][main] qcril_sms_request_cdma_send_sms: function entry

qcril_sms_request_cdma_send_sms的处理:

第一步:获取LTE_SMS状态和voLTE状态(分别通过方法qcril_qmi_nas_fetch_lte_sms_status和qcril_qmi_nas_is_voice_over_lte_registered,这两个方法都是根据nas_cached_info值来判断,qcril_qmi_nas.c文件中)

    qcril_qmi_nas_fetch_lte_sms_status( &lte_sms_status_valid, &lte_sms_status);

    is_voice_over_lte = qcril_qmi_nas_is_voice_over_lte_registered();

[00063/00]MSG    02:35:24.040Android QCRIL/Low                qcril_qmi_nas.c  43095  RIL[1][main] qcril_qmi_nas_is_voice_over_lte_registered: function exit with ret 0 //voLTE未注册

第二步:检查3gpp2 的wms service服务是否没有OK(下面日志显示已经OK),并且voLTE也没有注册,    此时返回失败

if (!wms_ready_atleast_limited_3gpp2() &&

        !(is_voice_over_lte && lte_sms_status_valid && (NAS_SMS_STATUS_1X_V01 == lte_sms_status))

       )

[00063/00]MSG    02:35:24.040Android QCRIL/Low                qcril_qmi_sms.c  08301  RIL[1][main] wms_ready_atleast_limited_3gpp2: function entry

[00063/02]MSG    02:35:24.040Android QCRIL/High               qcril_qmi_sms.c  08318  RIL[1][main] wms_ready_atleast_limited_3gpp2: WMS service is ready for atleast limited/full 3GPP2, WMS_SERVICE_READY_STATUS_3GPP_AND_3GPP2

[00063/00]MSG    02:35:24.040Android QCRIL/Low                qcril_qmi_sms.c  08327  RIL[1][main] wms_ready_atleast_limited_3gpp2: function exit with ret 1

第三步:检查SMS数据是否为NULL,是则返回failure。

第四步:在IMS未注册时,检查MO SMS通路是否被封锁。是则返回failere。通过方法qmi_ril_block_mo_sms_on_1x进行判断。

[00063/00]MSG    02:35:24.040Android QCRIL/Low                qcril_qmi_sms.c  07956  RIL[1][main] qmi_ril_block_mo_sms_on_1x: function entry

[00063/01]MSG    02:35:24.046Android QCRIL/Medium             qcril_qmi_sms.c  07962  RIL[1][main] qmi_ril_block_mo_sms_on_1x: transport layer info status block 0, valid 0 value 0

[

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值