forked from upstream-mirrors/quik
* Replaced if checks with one regular expression (will only match leading < or trailing >)
* Removed some <p> tags that Android Studio added to DocBlock
This commit is contained in:
@@ -82,21 +82,20 @@ public class MediaModelFactory {
|
|||||||
/**
|
/**
|
||||||
* This method is meant to identify the part in the given PduBody that corresponds to the given
|
* This method is meant to identify the part in the given PduBody that corresponds to the given
|
||||||
* src string.
|
* src string.
|
||||||
* <p>
|
*
|
||||||
* Essentially, a SMIL MMS is formatted as follows:
|
* Essentially, a SMIL MMS is formatted as follows:
|
||||||
* <p>
|
*
|
||||||
* 1. A smil/application part, which contains XML-like formatting for images, text, audio,
|
* 1. A smil/application part, which contains XML-like formatting for images, text, audio,
|
||||||
* slideshows, videos, etc.
|
* slideshows, videos, etc.
|
||||||
* 2. One or more parts that correspond to one of the elements that was mentioned in the
|
* 2. One or more parts that correspond to one of the elements that was mentioned in the
|
||||||
* formatting above.
|
* formatting above.
|
||||||
* <p>
|
*
|
||||||
* In the smil/application part, elements are identified by a "src" attribute in an XML-like
|
* In the smil/application part, elements are identified by a "src" attribute in an XML-like
|
||||||
* element. The challenge of this method lies in the fact that sometimes, the src string isn't
|
* element. The challenge of this method lies in the fact that sometimes, the src string isn't
|
||||||
* located at all in the part that it is meant to identify.
|
* located at all in the part that it is meant to identify.
|
||||||
* <p>
|
*
|
||||||
* We employ several methods of pairing src strings up to parts, using certain patterns we've
|
* We employ several methods of pairing src strings up to parts, using certain patterns we've
|
||||||
* seen in failed MMS messages. These are described in this method.
|
* seen in failed MMS messages. These are described in this method.
|
||||||
* <p>
|
|
||||||
* TODO TODO TODO: Create a testing suite for this!
|
* TODO TODO TODO: Create a testing suite for this!
|
||||||
*/
|
*/
|
||||||
private static PduPart findPart(final Context context, PduBody pb, String src,
|
private static PduPart findPart(final Context context, PduBody pb, String src,
|
||||||
@@ -327,12 +326,7 @@ public class MediaModelFactory {
|
|||||||
src = src.substring("cid:".length());
|
src = src.substring("cid:".length());
|
||||||
src = unescapeXML(src);
|
src = unescapeXML(src);
|
||||||
// Strip any leading < or trailing > ... they are present sometimes and causing error(s)
|
// Strip any leading < or trailing > ... they are present sometimes and causing error(s)
|
||||||
if (src.startsWith("<")) {
|
src = src.replaceAll("(^\\<)|(\\>$)", "");
|
||||||
src = src.replace("<", "");
|
|
||||||
}
|
|
||||||
if (src.endsWith(">")) {
|
|
||||||
src = src.replace(">", "");
|
|
||||||
}
|
|
||||||
if (LOCAL_LOGV) {
|
if (LOCAL_LOGV) {
|
||||||
Log.v(TAG, "Final contentId: " + src);
|
Log.v(TAG, "Final contentId: " + src);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user