【正文】
oid/mms/data/private void sendMmsWorker(Conversation conv, Uri mmsUri, PduPersisterpersister, SlideshowModel slideshow, SendReq sendReq) { // Mark the message as discarded because it is off the marketafter being sent.s different } preSendSmsWorker(conv, msgText)。 }else { }).start()。 public void run() { final PduPersister persister = (mContext)。 // because we will be doing it off of the main thread, which will if ((, )) { * Send this message over the network.4. src//android/mms/data//** } finish()。 //重新添加收件人監(jiān)聽 //發(fā)送信息—》 removeRecipientsListeners()。 } new Intent(,null), //判斷電話是否處于緊急撥號模式,得到的inEcm一般為空 // TODO: expose this in telephony layer for SDK build .setPositiveButton(, new CancelSendingListener()) .setIcon() .setNegativeButton(, new CancelSendingListener()) if ((isMms)) {//是否含有不合法的收件人MMS發(fā)送流程(代碼版)1. if ((v == mSendButton) amp。 //是否需要以彩信形式發(fā)送 (isMms))。 new (this) .setMessage() sendMessage(true)。 }} (TAG, sendMessage)。 if (bCheckEcmMode) { startActivityForResult( (TAG, Cannot find EmergencyCallbackModeExitDialog, e)。 } // them back once the recipient list has settled. ()。 if (mExitOnSent) {//如果mExitOnSent為true,信息發(fā)送完成后退出Activity Will call back with onMessageSent() once * it has been dispatched to the telephonystack. public void send() { // Make local copies of the bits we need for sending a message, //如果第一次發(fā)送,此時mmsUri為null,如果是重發(fā),則是草稿箱的地址 mMessageUri =content://mms/drafts/1 final SlideshowModel slideshow = mSlideshow。 final SendReq sendReq = makeSendReq(conv,mSubject)。 new Thread(new Runnable() { ()。 sendMmsWorker(conv, mmsUri, persister, slideshow, sendReq)。 } public void run() {//發(fā)送信息》t have too many outstanding unsent message. long totalPendingSize = 0。 while (()) { }else{ } finally { ()。 // recipient set. if ((, )) { (TAG, mmsUri = + mmsUri)。 (TAG, updateDraftMmsMessage)。 updateDraftMmsMessage(mmsUri,persister, slideshow, sendReq)。 } // Be paranoid and clean any draft SMS up. // Resize all the resizeable attachments (. pictures) to fit error = MESSAGE_SIZE_EXCEEDED。 } catch (MmsException e1) { // delete the copy which was previously saved in MMS drafts.t over the limits in message countpublic boolean sendMessage(long token) throws MmsException {date39。 (()/ 1000L)。 (mMessageUri, sendReq)。 (mMessageUri, )。 ((mMessageUri), token)。 (new Intent(mContext, ))。 (TAG, onStartCommand)。 if (intent == null) { networkAvailable= + !noNetwork)。 } ())。 if (cursor != null) { (TAG, onStart: no pending messages. Stoppingservice.)。 } if ((, )) { getApplicationContext())。 } while (()) { // If it39。 // we should retry it in spite of current ( // fallthrough transactionType, ())。 // FIXME: We use the same startId for all MMs. ()。 } (this)。 stopSelfIfIdle(startId)。 } // For launching NotificationTransaction and test purpose. Message msg = (EVENT_TRANSACTION_REQUEST)。 = serviceId。 = txnBundle。 (TAG, launchTransaction: sending message + msg)。 }9. src//android/mms/transaction/private final class ServiceHandler extends Handler { public void handleMessage(Messagemsg) { if (()) { int result =beginMmsConnectivity()。 if (result != ){ return。 } sendMessageDelayed(obtainMessage(EVENT_CONTINUE_MMS_CONNECTIVITY), return。 } NetworkInfo info = ()。 if ((, )) { )) { type isnot TYPE_MOBILE_MMS, bail)。 } ,())。 if ((, )) { return。 } // Set a timer to keep renewing our lease on the MMSconnection APN_EXTENSION_WAIT)。 case EVENT_TRANSACTION_REQUEST://響應(yīng)請求 TransactionBundle args= (TransactionBundl