Closed Bug 883019 Opened 6 years ago Closed 6 years ago

B2G MMS: Remove content length from all part headers.

Categories

(Core :: DOM: Device Interfaces, defect, P1, minor)

ARM
Gonk (Firefox OS)
defect

Tracking

()

RESOLVED FIXED
1.1 QE3 (26jun)
blocking-b2g leo+
Tracking Status
firefox23 --- wontfix
firefox24 --- wontfix
firefox25 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix
b2g-v1.1hd --- fixed

People

(Reporter: leo.bugzilla.gaia, Assigned: ctai)

References

Details

(Whiteboard: [fixed-in-birch] [TD-345341])

Attachments

(2 files)

1. Title: The received MMS doesn't display image attached from Gallery.
2. Precondition: SMS app should be working
3. Tester's Action:  (1) Create a new message
      (2) Attach a photo chosen from Gallery ( JPG 160x120,  JPG 640x480, GIF 160x120, Animated GIF 160x120, WBMP 160x120)
(3)Send the MMS with Images to multiple clients
4. Detailed Symptom (ENG.) : Images are not displayed in some clients
5. Expected: Each Client should display MMS message with proper images sent.
6. Reproducibility: Y
1) Frequency Rate : 100%
7. Gaia Master/v1-train: Reproduced on v1-train
8. Gaia Revision:  f25d5e8552e6d395435047de1d767889129701c3
9. Personal email id: sasikala.paruchuri8@gmail.com
blocking-b2g: --- → leo+
Whiteboard: [TD - 345341]
Target Milestone: --- → 1.1 QE3 (24jun)
Whiteboard: [TD - 345341] → [TD-345341]
Hi, Paul, could you please help verify this? Thanks!
This gaia revision seems to be quite old (may 31), I remember hitting this issue a while back and I'm not able to reproduce it now.

Can you try to reproduce with an up to date Gaia v1-train ?
I've rebuilt an up-to-date v1-train, on Inari, sent an image from Gallery via MMS to two clients, and:
 - the image is shown on the thread
 - every client has the image downloaded properly

Please, could you try to reproduce it on up to date v1-train ? And give better steps to reproduce, « Images are not displayed in some clients » is quite vague :)
Flags: needinfo?(sasikala.paruchuri8)
Gaia Revision:  f25d5e8552e6d395435047de1d767889129701c3
It's at 5/31

Please try latest build, this bug supposed to be fixed in later version
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 877727
Will test this in mentioned version.
Thanks
Flags: needinfo?(sasikala.paruchuri8)
This bug is about not able to receive MMS message from other phone, for example, symbian, motorola,...
Please help to attach device list which can't receive for investigating.
Status: RESOLVED → REOPENED
Flags: needinfo?(sasikala.paruchuri8)
Resolution: DUPLICATE → ---
Hi Paul,
Please find the list of devices where the images are not shown.
NOKIA (NOK), MOTOROLA (NOK), SAMSUNG (OK).
Thanks,
(In reply to Paul Yang from comment #7)
> This bug is about not able to receive MMS message from other phone, for
> example, symbian, motorola,...
> Please help to attach device list which can't receive for investigating.
Flags: needinfo?(sasikala.paruchuri8)
(In reply to Paul Yang from comment #7)
> This bug is about not able to receive MMS message from other phone, for
> example, symbian, motorola,...
> Please help to attach device list which can't receive for investigating.

Is it sending or receiving from Firefox OS that is broken ? The first comment on this bug states that it is sending from firefox os that fails, and now you are talking about reception from other phones.
Flags: needinfo?(pauly)
After investigation, some MMS server changes message content and then receiver can't retrieve it. ni? from ctai

(In reply to Alexandre LISSY :gerard-majax from comment #9)
> (In reply to Paul Yang from comment #7)
> > This bug is about not able to receive MMS message from other phone, for
> > example, symbian, motorola,...
> > Please help to attach device list which can't receive for investigating.
> 
> Is it sending or receiving from Firefox OS that is broken ? The first
> comment on this bug states that it is sending from firefox os that fails,
> and now you are talking about reception from other phones.
Flags: needinfo?(pauly) → needinfo?(ctai)
(In reply to Paul Yang: pyang: pyang@mozilla.com from comment #10)
> After investigation, some MMS server changes message content and then
> receiver can't retrieve it. ni? from ctai
> 
> (In reply to Alexandre LISSY :gerard-majax from comment #9)
> > (In reply to Paul Yang from comment #7)
> > > This bug is about not able to receive MMS message from other phone, for
> > > example, symbian, motorola,...
> > > Please help to attach device list which can't receive for investigating.
> > 
> > Is it sending or receiving from Firefox OS that is broken ? The first
> > comment on this bug states that it is sending from firefox os that fails,
> > and now you are talking about reception from other phones.

Okay thanks for this clarification, we'll wait for ctai reply :)
After more investigations, here are the all clues. There are two kind of SIM card I tested. One is from CHT, the other is Taiwanmobile. The problem is caused by the MMS Proxy in some operator(in this case, Taiwanmobile) will change the "cid" in the smil when receiving MMS.

Here is the cases:
Case 1: FFOS with Taiwanmobile send to FFOS with Taiwanmobile. Logs:

Taiwanmobile Send:
06-26 11:16:01.958 I/Gecko   (  108): -@- MmsService: part 0:
06-26 11:16:01.958 I/Gecko   (  108): -@- MmsService: headers = {"content-type":{"media":"application/smil","params":{"name":"smil.xml","charset":{"charset":"utf-8"}}},"content-length":345,"content-location":"smil.xml","content-id":"<smil>"}
06-26 11:16:01.958 I/Gecko   (  108): -@- MmsService: content = "<smil><head><layout><root-layout width=\"320px\" height=\"480px\"/><region id=\"Image\" left=\"0px\" top=\"0px\" width=\"320px\" height=\"320px\" fit=\"meet\"/><region id=\"Text\" left=\"0px\" top=\"320px\" width=\"320px\" height=\"160px\" fit=\"meet\"/></layout></head><body><par dur=\"5000ms\"><img src=\"resources320x480FXOSShadows.png\" region=\"Image\"/></par></body></smil>"
06-26 11:16:01.958 I/Gecko   (  108): -@- MmsService: part 1:
06-26 11:16:01.958 I/Gecko   (  108): -@- MmsService: headers = {"content-type":{"media":"image/jpeg","params":{"name":"resources320x480FXOSShadows.png"}},"content-length":50051,"content-location":"resources320x480FXOSShadows.png","content-id":"<resources320x480FXOSShadows.png>"}
06-26 11:16:01.958 I/Gecko   (  108): -@- MmsService: content = {}

Taiwanmobile retrievedMessage:
06-26 11:16:14.941 I/Gecko   (  108): -@- MmsService: part 0:
06-26 11:16:14.941 I/Gecko   (  108): -@- MmsService: headers = {"content-type":{"media":"application/smil","params":{"name":"smil.xml","charset":{"charset":"utf-8"}}},"content-length":345,"content-location":"smil.xml","content-id":"<0000>"}
06-26 11:16:14.941 I/Gecko   (  108): -@- MmsService: content = "<smil>\n  <head>\n    <layout>\n      <root-layout height=\"480px\" width=\"320px\"/>\n      <region fit=\"meet\" height=\"320px\" id=\"Image\" left=\"0px\" top=\"0px\" width=\"320px\"/>\n      <region fit=\"meet\" height=\"160px\" id=\"Text\" left=\"0px\" top=\"320px\" width=\"320px\"/>\n    </layout>\n  </head>\n  <body>\n    <par dur=\"5000ms\">\n      <img region=\"Image\" src=\"cid:349\"/>\n    </par>\n  </body>\n</smil>\n"
06-26 11:16:14.941 I/Gecko   (  108): -@- MmsService: part 1:
06-26 11:16:14.941 I/Gecko   (  108): -@- MmsService: headers = {"content-type":{"media":"image/jpeg","params":{"name":"resources320x480FXOSShadows.png"}},"content-length":50051,"content-location":"resources320x480FXOSShadows.png","content-id":"<349>"}

Case 2:Android with Taiwanmobile send to FFOS with Taiwanmobile. The message will shows "The image file XXXX was deleted". Logs: 

Sent from Android with CHT, Taiwanmobile received:
06-26 11:23:09.725 I/Gecko   (  108): -@- MmsService: part 0:
06-26 11:23:09.725 I/Gecko   (  108): -@- MmsService: headers = {"content-type":{"media":"application/smil","params":{"name":"smil.xml"}},"content-length":376,"content-id":"<0000>","content-location":"smil.xml"}
06-26 11:23:09.725 I/Gecko   (  108): -@- MmsService: content = "<smil> \n  <head> \n    <layout> \n      <root-layout height=\"320\" width=\"240\"/>  \n      <region fit=\"meet\" height=\"220\" id=\"Image\" left=\"0\" top=\"0\" width=\"240\"/>  \n      <region fit=\"meet\" height=\"100\" id=\"Text\" left=\"0\" top=\"220\" width=\"240\"/> \n    </layout> \n  </head>  \n  <body> \n    <par dur=\"5000ms\">\n      <text src=\"cid:450\" region=\"Text\"/>\n    </par>\n  </body> \n</smil>\n"
06-26 11:23:09.725 I/Gecko   (  108): -@- MmsService: part 1:
06-26 11:23:09.725 I/Gecko   (  108): -@- MmsService: headers = {"content-type":{"media":"text/plain","params":{"charset":{"charset":"utf-8"},"name":"Attch766.txt"}},"content-length":67,"content-id":"<450>"}

In conclusion, we might need to find a way to deal with it in SMIL part.
Flags: needinfo?(ctai)
Assignee: nobody → gnarf37
To summarize our small investigation what seems to be happening on Android is that the XML parser used to read the incoming message is failing to parse the message properly. We found this in the logcat:

E/Mms:media(  986): StringIndexOutOfBoundsException
E/Mms/slideshow(  986): No part found for the model.
E/Mms/slideshow(  986): java.lang.IllegalArgumentException: No part found for the model.
E/Mms/slideshow(  986): 	at com.android.mms.model.MediaModelFactory.findPart(MediaModelFactory.java:110)
E/Mms/slideshow(  986): 	at com.android.mms.model.MediaModelFactory.getMediaModel(MediaModelFactory.java:49)
E/Mms/slideshow(  986): 	at com.android.mms.model.SlideshowModel.createFromPduBody(SlideshowModel.java:294)
E/Mms/slideshow(  986): 	at com.android.mms.ui.MessageItem.<init>(MessageItem.java:309)
E/Mms/slideshow(  986): 	at com.android.mms.ui.MessageListAdapter.getCachedMessageItem(MessageListAdapter.java:428)
E/Mms/slideshow(  986): 	at com.android.mms.ui.MessageListAdapter.bindView(MessageListAdapter.java:313)

Looking at the corresponding Android code it appears that the XML parser is failing to return the source of the image because of the first exception being thrown (StringIndexOutOfBoundsException) and the code trying to retrieve the image gets a null reference instead of the actual source URI and fails (IllegalArgumentException).

Now our best clue of why this is happening is in the log in comment 12. The message we send has the "content-length" field set to 345. The message delivered by Taiwanmobile keeps the same value in the "content-length" field but introduces whitespace characters in the actual content longer. The resulting content is 424 characters long. If I cut it at 345 this is the section that's left out:

     <text src=\"cid:450\" region=\"Text\"/>\n    </par>\n  </body> \n</smil>\n

Which is probably what the Android XML parser is also dropping.
We want to try a few things based on not sending a content-length, or utf-8 encoding because we have detected that these are some differences between what iphone/android send vs what we get from ffos -- ctai was going to look into this
Even I comment out the content-length and utf-8 encoding. The Taiwan mobile still fill the wrong content-length. Please see below logs.

Send:
06-27 10:56:31.766 I/Gecko   (  109): -@- MmsService: part 0:
06-27 10:56:31.766 I/Gecko   (  109): -@- MmsService: headers = {"content-type":{"media":"application/smil","params":{"name":"smil.xml"}},"content-location":"smil.xml","content-id":"<smil>"}
06-27 10:56:31.766 I/Gecko   (  109): -@- MmsService: content = "<smil><head><layout><root-layout width=\"320px\" height=\"480px\"/><region id=\"Image\" left=\"0px\" top=\"0px\" width=\"320px\" height=\"320px\" fit=\"meet\"/><region id=\"Text\" left=\"0px\" top=\"320px\" width=\"320px\" height=\"160px\" fit=\"meet\"/></layout></head><body><par dur=\"5000ms\"><text src=\"text_0.txt\" region=\"Text\"/></par><par dur=\"5000ms\"><img src=\"resources320x480FXOSBlueMountains.png\" region=\"Image\"/></par></body></smil>"


receive:

06-27 10:56:44.008 I/Gecko   (  109): -@- MmsService: headers = {"content-type":{"media":"application/smil","params":{"name":"smil.xml"}},"content-length":459,"content-location":"smil.xml","content-id":"<0000>"}
06-27 10:56:44.008 I/Gecko   (  109): -@- MmsService: content = "<smil>\n  <head>\n    <layout>\n      <root-layout height=\"480px\" width=\"320px\"/>\n      <region fit=\"meet\" height=\"320px\" id=\"Image\" left=\"0px\" top=\"0px\" width=\"320px\"/>\n      <region fit=\"meet\" height=\"160px\" id=\"Text\" left=\"0px\" top=\"320px\" width=\"320px\"/>\n    </layout>\n  </head>\n  <body>\n    <par dur=\"5000ms\">\n      <text region=\"Text\" src=\"cid:558\"/>\n    </par>\n    <par dur=\"5000ms\">\n      <img region=\"Image\" src=\"cid:559\"/>\n    </par>\n  </body>\n</smil>\n"
(In reply to Chia-hung Tai [:ctai :ctai_mozilla :cht] from comment #15)
> Even I comment out the content-length and utf-8 encoding. The Taiwan mobile
> still fill the wrong content-length. Please see below logs.

Is it? If I take the string in the received message and compute its length with the web console it tells me it's 459 characters long which corresponds to the content-length field. Could you double-check it?
I am wrong...content-length is correct. But still have exception in Android phone.
06-27 11:21:13.441 E/Mms:media( 2254): No part found for the model, cid:672
06-27 11:21:13.441 E/Mms/slideshow( 2254): No part found for the model.
06-27 11:21:13.441 E/Mms/slideshow( 2254): java.lang.IllegalArgumentException: No part found for the model.


(In reply to Chia-hung Tai [:ctai :ctai_mozilla :cht] from comment #15)
> Even I comment out the content-length and utf-8 encoding. The Taiwan mobile
> still fill the wrong content-length. Please see below logs.
> 
> Send:
> 06-27 10:56:31.766 I/Gecko   (  109): -@- MmsService: part 0:
> 06-27 10:56:31.766 I/Gecko   (  109): -@- MmsService: headers =
> {"content-type":{"media":"application/smil","params":{"name":"smil.xml"}},
> "content-location":"smil.xml","content-id":"<smil>"}
> 06-27 10:56:31.766 I/Gecko   (  109): -@- MmsService: content =
> "<smil><head><layout><root-layout width=\"320px\" height=\"480px\"/><region
> id=\"Image\" left=\"0px\" top=\"0px\" width=\"320px\" height=\"320px\"
> fit=\"meet\"/><region id=\"Text\" left=\"0px\" top=\"320px\" width=\"320px\"
> height=\"160px\" fit=\"meet\"/></layout></head><body><par
> dur=\"5000ms\"><text src=\"text_0.txt\" region=\"Text\"/></par><par
> dur=\"5000ms\"><img src=\"resources320x480FXOSBlueMountains.png\"
> region=\"Image\"/></par></body></smil>"
> 
> 
> receive:
> 
> 06-27 10:56:44.008 I/Gecko   (  109): -@- MmsService: headers =
> {"content-type":{"media":"application/smil","params":{"name":"smil.xml"}},
> "content-length":459,"content-location":"smil.xml","content-id":"<0000>"}
> 06-27 10:56:44.008 I/Gecko   (  109): -@- MmsService: content = "<smil>\n 
> <head>\n    <layout>\n      <root-layout height=\"480px\"
> width=\"320px\"/>\n      <region fit=\"meet\" height=\"320px\" id=\"Image\"
> left=\"0px\" top=\"0px\" width=\"320px\"/>\n      <region fit=\"meet\"
> height=\"160px\" id=\"Text\" left=\"0px\" top=\"320px\" width=\"320px\"/>\n 
> </layout>\n  </head>\n  <body>\n    <par dur=\"5000ms\">\n      <text
> region=\"Text\" src=\"cid:558\"/>\n    </par>\n    <par dur=\"5000ms\">\n   
> <img region=\"Image\" src=\"cid:559\"/>\n    </par>\n  </body>\n</smil>\n"
Looks like now sms have the similar issue. please see http://www.nowsms.com/discus/messages/485/33299.html
I'm dropping out of this one -- I'll still be happy to throw in my thoughts, but I'm completely out of ideas.
Assignee: gnarf37 → nobody
Depends on: 887646
Try to debug from Android phone.
Assignee: nobody → ctai
Component: Gaia::SMS → DOM: Device Interfaces
Product: Boot2Gecko → Core
Summary: [MMS] The received MMS doesn't display image attached from Gallery → B2G MMS: Remove content length from all part headers.
After debug from Android, I found the root cause of this issue.
The root cause is when Android parse the part header, if the first one is not in the cases "content location, content id, dep content disposition, content disposition", Android will skip the parsing of header. It happens on TWN-Mobile because the MMS proxy in TWN-Mobile will change the src from content-location based to cid based in SMIL.
The solution is remove the content-length in the part headers which not recognized by the part parser in Android.
Attachment #770604 - Flags: review?(vyang)
This is slide show for the picture from MMS which sent from FX OS. The device is Nexus 4 with the latest Android master source code.
Comment on attachment 770604 [details] [diff] [review]
Patch v1.0

Review of attachment 770604 [details] [diff] [review]:
-----------------------------------------------------------------

GJ!
Attachment #770604 - Flags: review?(vyang) → review+
https://hg.mozilla.org/projects/birch/rev/1e8dda00db40
Whiteboard: [TD-345341] → [fixed-in-birch] [TD-345341]
https://hg.mozilla.org/mozilla-central/rev/1e8dda00db40
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.