Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eda3c479 authored by Matthew Xie's avatar Matthew Xie Committed by Android (Google) Code Review
Browse files

Merge "Fixed missing size of incoming MMS messages" into lmp-dev

parents 81cd6c4b 089a13f6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -157,6 +157,18 @@ public class PduPart {
         return byteArray;
     }

    /**
     * @return The length of the data, if this object have data, else 0.
     */
     public int getDataLength() {
         if(mPartData != null){
             return mPartData.length;
         } else {
             return 0;
         }
     }


     /**
      * Set data uri. The data are stored as Uri.
      *
+10 −1
Original line number Diff line number Diff line
@@ -1380,6 +1380,9 @@ public class PduPersister {
        // Figure out if this PDU is a text-only message
        boolean textOnly = true;

        // Sum up the total message size
        int messageSize = 0;

        // Get body if the PDU is a RetrieveConf or SendReq.
        if (pdu instanceof MultimediaMessagePdu) {
            body = ((MultimediaMessagePdu) pdu).getBody();
@@ -1395,6 +1398,7 @@ public class PduPersister {
                }
                for (int i = 0; i < partsNum; i++) {
                    PduPart part = body.getPart(i);
                    messageSize += part.getDataLength();
                    persistPart(part, dummyId, preOpenedFiles);

                    // If we've got anything besides text/plain or SMIL part, then we've got
@@ -1410,6 +1414,11 @@ public class PduPersister {
        // Record whether this mms message is a simple plain text or not. This is a hint for the
        // UI.
        values.put(Mms.TEXT_ONLY, textOnly ? 1 : 0);
        // The message-size might already have been inserted when parsing the
        // PDU header. If not, then we insert the message size as well.
        if (values.getAsInteger(Mms.MESSAGE_SIZE) == null) {
            values.put(Mms.MESSAGE_SIZE, messageSize);
        }

        Uri res = null;
        if (existingUri) {