From 42b21c3333f97877648daf90a9daaa86334a8d79 Mon Sep 17 00:00:00 2001 From: takuo Date: Fri, 30 Apr 2010 07:11:53 +0900 Subject: [PATCH] Parse custom text header and ignore it. Some MMS carrier append own custom header as text into PduData. We should parse it and ignore it at the moment. Change-Id: I4d6cf20f5cf99172ebbe310ab18101316eb04c77 --- core/java/com/google/android/mms/pdu/PduParser.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/java/com/google/android/mms/pdu/PduParser.java b/core/java/com/google/android/mms/pdu/PduParser.java index 60b35cf9d4c55..1cd118b56ac62 100644 --- a/core/java/com/google/android/mms/pdu/PduParser.java +++ b/core/java/com/google/android/mms/pdu/PduParser.java @@ -200,7 +200,18 @@ public class PduParser { PduHeaders headers = new PduHeaders(); while (keepParsing && (pduDataStream.available() > 0)) { + pduDataStream.mark(1); int headerField = extractByteValue(pduDataStream); + /* parse custom text header */ + if ((headerField >= TEXT_MIN) && (headerField <= TEXT_MAX)) { + pduDataStream.reset(); + byte [] bVal = parseWapString(pduDataStream, TYPE_TEXT_STRING); + if (LOCAL_LOGV) { + Log.v(LOG_TAG, "TextHeader: " + new String(bVal)); + } + /* we should ignore it at the moment */ + continue; + } switch (headerField) { case PduHeaders.MESSAGE_TYPE: {