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

Commit 3f8122d8 authored by Jordan Patterson's avatar Jordan Patterson
Browse files

Merge fix for PduParser.java - Part 1

It looks like there was a merge issue in PduParser.java that duplicated
some code when the gingerbread code was merged.  The change in
gingerbread essentially put the entire PduPart.P_CONTENT_DISPOSITION in
an if statement, and set it to positive for all devices.

This fixes MMS problems on the Nexus One, and possibly other phones.
The second part reverts the config.xml change on supersonic, as it
should now work with the default code.

Change-Id: I47b0f17327f906055e1d358226b5db0ddfb2241f
parent fa489205
Loading
Loading
Loading
Loading
+30 −47
Original line number Diff line number Diff line
@@ -1559,6 +1559,15 @@ public class PduParser {
                         * Attachment = <Octet 129>
                         * Inline = <Octet 130>
                         */

                        /*
                         * some carrier mmsc servers do not support content_disposition
                         * field correctly
                         */
                        boolean contentDisposition = Resources.getSystem().getBoolean(com
                                .android.internal.R.bool.config_mms_content_disposition_support);

                        if (contentDisposition) {
                          int len = -1;
                          boolean validDispositionLength = true;
                          pduDataStream.mark(1);
@@ -1587,7 +1596,8 @@ public class PduParser {
                            } else {
                                pduDataStream.reset();
                                /* Token-text */
                                part.setContentDisposition(parseWapString(pduDataStream, TYPE_TEXT_STRING));
                                part.setContentDisposition(parseWapString(pduDataStream
                                        , TYPE_TEXT_STRING));
                            }
                          } else {
                              pduDataStream.reset();
@@ -1595,33 +1605,6 @@ public class PduParser {
                              part.setContentDisposition(parseWapString(pduDataStream, TYPE_TEXT_STRING));
                          }

                        /*
                         * some carrier mmsc servers do not support content_disposition
                         * field correctly
                         */
                        boolean contentDisposition = Resources.getSystem().getBoolean(com
                                .android.internal.R.bool.config_mms_content_disposition_support);

                        if (contentDisposition) {
                            len = parseValueLength(pduDataStream);
                            pduDataStream.mark(1);
                            thisStartPos = pduDataStream.available();
                            thisEndPos = 0;
                            value = pduDataStream.read();

                            if (value == PduPart.P_DISPOSITION_FROM_DATA ) {
                                part.setContentDisposition(PduPart.DISPOSITION_FROM_DATA);
                            } else if (value == PduPart.P_DISPOSITION_ATTACHMENT) {
                                part.setContentDisposition(PduPart.DISPOSITION_ATTACHMENT);
                            } else if (value == PduPart.P_DISPOSITION_INLINE) {
                                part.setContentDisposition(PduPart.DISPOSITION_INLINE);
                            } else {
                                pduDataStream.reset();
                                /* Token-text */
                                part.setContentDisposition(parseWapString(pduDataStream
                                        , TYPE_TEXT_STRING));
                            }
                        }

                          /* get filename parameter and skip other parameters */
                          thisEndPos = pduDataStream.available();
@@ -1643,7 +1626,7 @@ public class PduParser {

                          tempPos = pduDataStream.available();
                          lastLen = length - (startPos - tempPos);

                        }
                        break;
                    default:
                        if (LOCAL_LOGV) {