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

Commit fca752b9 authored by Christian Gustafsson's avatar Christian Gustafsson Committed by Android Git Automerger
Browse files

am 70f74b79: Assemble WAP datagram correctly when segments arrive out of order

Merge commit '70f74b79' into eclair-plus-aosp

* commit '70f74b79':
  Assemble WAP datagram correctly when segments arrive out of order
parents 6aab672a 70f74b79
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -299,13 +299,15 @@ final class CdmaSMSDispatcher extends SMSDispatcher {


        // Build up the data stream
        // Build up the data stream
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        for (int i = 0; i < totalSegments-1; i++) {
        for (int i = 0; i < totalSegments; i++) {
            // reassemble the (WSP-)pdu
            // reassemble the (WSP-)pdu
            output.write(pdus[i], 0, pdus[i].length);
            if (i == segment) {
        }

                // This one isn't in the DB, so add it
                // This one isn't in the DB, so add it
                output.write(pdu, index, pdu.length - index);
                output.write(pdu, index, pdu.length - index);
            } else {
                output.write(pdus[i], 0, pdus[i].length);
            }
        }


        byte[] datagram = output.toByteArray();
        byte[] datagram = output.toByteArray();
        // Dispatch the PDU to applications
        // Dispatch the PDU to applications