summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorDavid Krause <david.krause@motorola.com>2009-06-25 22:01:20 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-06-25 22:01:20 -0700
commitaec9632db02bd2c9850bd6827359cd3d6282c797 (patch)
treec296575c80436b17fb8c0ed71be91cafd849c6b7 /telephony
parent0da0ee6f5f1703643a3f9d8dcee8920e7a4fa41a (diff)
parent5c7d9e8194900a2b1699cd57f95b22ca5f7b9be2 (diff)
downloadframeworks_base-aec9632db02bd2c9850bd6827359cd3d6282c797.zip
frameworks_base-aec9632db02bd2c9850bd6827359cd3d6282c797.tar.gz
frameworks_base-aec9632db02bd2c9850bd6827359cd3d6282c797.tar.bz2
am 5c7d9e81: CDMA incoming MMS fixes
Merge commit '5c7d9e8194900a2b1699cd57f95b22ca5f7b9be2' * commit '5c7d9e8194900a2b1699cd57f95b22ca5f7b9be2': CDMA incoming MMS fixes
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/SMSDispatcher.java1
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java22
2 files changed, 16 insertions, 7 deletions
diff --git a/telephony/java/com/android/internal/telephony/SMSDispatcher.java b/telephony/java/com/android/internal/telephony/SMSDispatcher.java
index 62a5d65..890ea63 100644
--- a/telephony/java/com/android/internal/telephony/SMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/SMSDispatcher.java
@@ -78,6 +78,7 @@ public abstract class SMSDispatcher extends Handler {
protected static final String[] RAW_PROJECTION = new String[] {
"pdu",
"sequence",
+ "destination_port",
};
static final int MAIL_SEND_SMS = 1;
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
index 2d43e0d..ecdc8f6 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
@@ -168,8 +168,8 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
int index = 0;
int msgType;
- int sourcePort;
- int destinationPort;
+ int sourcePort = 0;
+ int destinationPort = 0;
msgType = pdu[index++];
if (msgType != 0){
@@ -179,11 +179,14 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
totalSegments = pdu[index++]; // >=1
segment = pdu[index++]; // >=0
- //process WDP segment
- sourcePort = (0xFF & pdu[index++]) << 8;
- sourcePort |= 0xFF & pdu[index++];
- destinationPort = (0xFF & pdu[index++]) << 8;
- destinationPort |= 0xFF & pdu[index++];
+ // Only the first segment contains sourcePort and destination Port
+ if (segment == 0) {
+ //process WDP segment
+ sourcePort = (0xFF & pdu[index++]) << 8;
+ sourcePort |= 0xFF & pdu[index++];
+ destinationPort = (0xFF & pdu[index++]) << 8;
+ destinationPort |= 0xFF & pdu[index++];
+ }
// Lookup all other related parts
StringBuilder where = new StringBuilder("reference_number =");
@@ -224,6 +227,11 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
for (int i = 0; i < cursorCount; i++) {
cursor.moveToNext();
int cursorSequence = (int)cursor.getLong(sequenceColumn);
+ // Read the destination port from the first segment
+ if (cursorSequence == 0) {
+ int destinationPortColumn = cursor.getColumnIndex("destination_port");
+ destinationPort = (int)cursor.getLong(destinationPortColumn);
+ }
pdus[cursorSequence] = HexDump.hexStringToByteArray(
cursor.getString(pduColumn));
}