22851197 Messaging Application crash with unsupported type's URI

This bug and AOSP patch arrived last July. Supposedly, I
merged the change, but it's certainly not fixed in bugler, nor in various
copies of PduPersister in Android's master. Fixing all the locations
now.

Test: manual - sent/received MMS's to verify the change didn't break
existing behavior.

Bug: 22851197
Change-Id: Ia79bd9951b1820ebc42baf0eef38667753d77ab9
This commit is contained in:
Tom Taylor
2017-02-23 10:41:40 -08:00
parent 5a41083bb4
commit e0f37bb8e1
@@ -1248,7 +1248,8 @@ public class PduPersister {
for (int i = 0; i < partsNum; i++) {
final PduPart part = body.getPart(i);
final Uri partUri = part.getDataUri();
if ((partUri == null) || !partUri.getAuthority().startsWith("mms")) {
if ((partUri == null) || TextUtils.isEmpty(partUri.getAuthority())
|| !partUri.getAuthority().startsWith("mms")) {
toBeCreated.add(part);
} else {
toBeUpdated.put(partUri, part);