zoukankan      html  css  js  c++  java
  • Android 源码阅读之SMS

    主界面:

    com.android.mms.ui.ConversationList.java  [extends ListActivity]

    点击新建信息:onListItemClick -〉 position == 0 -〉createNewMessage()-〉 startActivity[ComposeMessageActivity]

    com.android.mms.ui.ComposeMessageActivity.java

    点击发送按钮:onClick -> mSendButton -> confirmSendMessageIfNeeded()  -> sendMessage(true) ->

    mWorkingMessage.setPhoneId(phoneId); mWorkingMessage.send(mDebugRecipients);

    com.android.mms.data.WorkingMessage.java

    send:如果是彩信 sendMmsWork 如果是短信preSendSmsWorker

    -------------------------------------------------------------------------------------------------------

    短信流程:

    preSendSmsWorker -〉 sendSmsWorker -〉SmsMessageSender.sendMessage(threadId)

    com.android.mms.transaction.SmsMessageSender.java

    sendMessage -> queueMessage ->

    mContext.sendBroadcast[SmsReceiverService.ACTION_SEND_MESSAGE, SmsReceiver.class]

    com.android.mms.transaction.SmsReceiver.java

    com.android.mms.transaction.SmsReceiverService.java

    handleMessage -> ACTION_SEND_MESSAGE -> handleSendMessage -> sendFirstQueuedMessage ->

    SmsSingleRecipientSender.sendMessage

    com.android.mms.transaction.SmsSingleRecipientSender.java

    sendMessage -> SmsManager.sendMultipartTextMessage

    进入Framework层

    frameworks/base/telephony/java/android/telephony/SmsManager.java

    sendMultipartTextMessage -> 一条短信是不是需要分多个部分(太长)?

    ISms.sendMultipartText | ISms.sendText

    frameworks/base/telephony/java/com/android/internal/telephony/IccSmsInterfaceManager.java

    sendText -> CdmaSMSDispatcher.sendText | GsmSMSDispatcher.sendText

    [cdma]

    frameworks/base/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java

    sendText -> sendSubmitPdu -> sendRawPdu ->

    sendSms | sendMessage

    sendSms -> CommandsInterface.sendCdmaSms

    frameworks/base/telephony/java/com/android/internal/telephony/RIL.java

    sendCdmaSms -> RIL_REQUEST_CDMA_SEND_SMS

    hardware/ril_c/reference-ril/reference-cpb71.c

    case RIL_REQUEST_CDMA_SEND_SMS: requestSendCdmaSMS -> at_send_command

    [gsm]

    frameworks/base/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java

    sendText -> sendRawPdu ->

    sendSms | sendMessage

    sendSms -> CommandInterface.sendSMS

    frameworks/base/telephony/java/com/android/internal/telephony/RIL.java

    sendSMS -> RIL_REQUEST_SEND_SMS

  • 相关阅读:
    SpringAOP--动态数据源
    SpringAOP--代理
    SpringAOP--aop使用
    Kafka03--Kafka消费者使用方式
    Kafka02--Kafka生产者简要原理
    Kafka01--Kafka生产者使用方式
    SpringBoot中的日志使用:
    LCS&&LRC&&LIS问题
    解决Idea.exe无法启动问题(idea2017.3版本)
    七牛云简单实用-uploadManager.put(..)抛出异常
  • 原文地址:https://www.cnblogs.com/jimwind/p/2679810.html
Copyright © 2011-2022 走看看