Specify charset encoding UTF-8 for image-only MMS

When a Pixel phone receives a MMS that contains only an image and no
text, it will replace the image data with a text string (e.g., filename)
in the bMessage (if the MAP client specified "no attachments" option).
However, the Pixel does not set the charset encoding to UTF-8 in this
case, even though the message body now contains text.

This is due to the attachment-to-text replacement occuring after the
charset logic has already run. This CL moves the attachment-to-text
replacement from the end of the process (i.e., during encoding) to the
beginning (i.e., after the MMS parts are pulled from the Content
Provider).

Tag: #compatibility

Bug: 157240717
Test: Pair a Pixel phone to the carkit, and send an image-only MMS to
the Pixel. Examine the raw bMessage from the Pixel to the carkit in
snoop/HCI logs and verify it now contains "CHARSET:UTF-8".

Change-Id: I3a618461cb9f6e0e1a8a60e1a0a4532cd85c0348
1 file changed