Merge commit 'fca752b9d8306c53afb4d362dbcd0921d16baec1' * commit 'fca752b9d8306c53afb4d362dbcd0921d16baec1': Assemble WAP datagram correctly when segments arrive out of order
This commit is contained in:
committed by
Android Git Automerger
commit
bbc8064e62
@@ -299,14 +299,16 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
|
||||
|
||||
// Build up the data stream
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
for (int i = 0; i < totalSegments-1; i++) {
|
||||
for (int i = 0; i < totalSegments; i++) {
|
||||
// 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
|
||||
output.write(pdu, index, pdu.length - index);
|
||||
} else {
|
||||
output.write(pdus[i], 0, pdus[i].length);
|
||||
}
|
||||
}
|
||||
|
||||
// This one isn't in the DB, so add it
|
||||
output.write(pdu, index, pdu.length - index);
|
||||
|
||||
byte[] datagram = output.toByteArray();
|
||||
// Dispatch the PDU to applications
|
||||
switch (destinationPort) {
|
||||
|
||||
Reference in New Issue
Block a user