Loading telephony/java/com/android/internal/telephony/SMSDispatcher.java +12 −2 Original line number Diff line number Diff line Loading @@ -518,6 +518,7 @@ public abstract class SMSDispatcher extends Handler { * @param address the originating address * @param referenceNumber distinguishes concatenated messages from the same sender * @param sequenceNumber the order of this segment in the message * (starting at 0 for CDMA WDP datagrams and 1 for concatenated messages). * @param messageCount the number of segments in the message * @param timestamp the service center timestamp in millis * @param destPort the destination port for the message, or -1 for no destination port Loading Loading @@ -583,7 +584,11 @@ public abstract class SMSDispatcher extends Handler { for (int i = 0; i < cursorCount; i++) { cursor.moveToNext(); int cursorSequence = cursor.getInt(SEQUENCE_COLUMN); pdus[cursorSequence - 1] = HexDump.hexStringToByteArray( // GSM sequence numbers start at 1; CDMA WDP datagram sequence numbers start at 0 if (!isCdmaWapPush) { cursorSequence--; } pdus[cursorSequence] = HexDump.hexStringToByteArray( cursor.getString(PDU_COLUMN)); // Read the destination port from the first segment (needed for CDMA WAP PDU). Loading @@ -593,7 +598,12 @@ public abstract class SMSDispatcher extends Handler { } } // This one isn't in the DB, so add it // GSM sequence numbers start at 1; CDMA WDP datagram sequence numbers start at 0 if (isCdmaWapPush) { pdus[sequenceNumber] = pdu; } else { pdus[sequenceNumber - 1] = pdu; } // Remove the parts from the database mResolver.delete(mRawUri, where, whereArgs); Loading telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java +8 −3 Original line number Diff line number Diff line Loading @@ -198,13 +198,18 @@ final class CdmaSMSDispatcher extends SMSDispatcher { protected int processCdmaWapPdu(byte[] pdu, int referenceNumber, String address) { int index = 0; int msgType = pdu[index++]; int msgType = (0xFF & pdu[index++]); if (msgType != 0) { Log.w(TAG, "Received a WAP SMS which is not WDP. Discard."); return Intents.RESULT_SMS_HANDLED; } int totalSegments = pdu[index++]; // >= 1 int segment = pdu[index++]; // >= 0 int totalSegments = (0xFF & pdu[index++]); // >= 1 int segment = (0xFF & pdu[index++]); // >= 0 if (segment >= totalSegments) { Log.e(TAG, "WDP bad segment #" + segment + " expecting 0-" + (totalSegments - 1)); return Intents.RESULT_SMS_HANDLED; } // Only the first segment contains sourcePort and destination Port int sourcePort = 0; Loading Loading
telephony/java/com/android/internal/telephony/SMSDispatcher.java +12 −2 Original line number Diff line number Diff line Loading @@ -518,6 +518,7 @@ public abstract class SMSDispatcher extends Handler { * @param address the originating address * @param referenceNumber distinguishes concatenated messages from the same sender * @param sequenceNumber the order of this segment in the message * (starting at 0 for CDMA WDP datagrams and 1 for concatenated messages). * @param messageCount the number of segments in the message * @param timestamp the service center timestamp in millis * @param destPort the destination port for the message, or -1 for no destination port Loading Loading @@ -583,7 +584,11 @@ public abstract class SMSDispatcher extends Handler { for (int i = 0; i < cursorCount; i++) { cursor.moveToNext(); int cursorSequence = cursor.getInt(SEQUENCE_COLUMN); pdus[cursorSequence - 1] = HexDump.hexStringToByteArray( // GSM sequence numbers start at 1; CDMA WDP datagram sequence numbers start at 0 if (!isCdmaWapPush) { cursorSequence--; } pdus[cursorSequence] = HexDump.hexStringToByteArray( cursor.getString(PDU_COLUMN)); // Read the destination port from the first segment (needed for CDMA WAP PDU). Loading @@ -593,7 +598,12 @@ public abstract class SMSDispatcher extends Handler { } } // This one isn't in the DB, so add it // GSM sequence numbers start at 1; CDMA WDP datagram sequence numbers start at 0 if (isCdmaWapPush) { pdus[sequenceNumber] = pdu; } else { pdus[sequenceNumber - 1] = pdu; } // Remove the parts from the database mResolver.delete(mRawUri, where, whereArgs); Loading
telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java +8 −3 Original line number Diff line number Diff line Loading @@ -198,13 +198,18 @@ final class CdmaSMSDispatcher extends SMSDispatcher { protected int processCdmaWapPdu(byte[] pdu, int referenceNumber, String address) { int index = 0; int msgType = pdu[index++]; int msgType = (0xFF & pdu[index++]); if (msgType != 0) { Log.w(TAG, "Received a WAP SMS which is not WDP. Discard."); return Intents.RESULT_SMS_HANDLED; } int totalSegments = pdu[index++]; // >= 1 int segment = pdu[index++]; // >= 0 int totalSegments = (0xFF & pdu[index++]); // >= 1 int segment = (0xFF & pdu[index++]); // >= 0 if (segment >= totalSegments) { Log.e(TAG, "WDP bad segment #" + segment + " expecting 0-" + (totalSegments - 1)); return Intents.RESULT_SMS_HANDLED; } // Only the first segment contains sourcePort and destination Port int sourcePort = 0; Loading