Fix problem with empty content disposition

* And while we're at it, fix a repeating crash related to
  notifications.

Bug: 6561972
Change-Id: I44f2441bf7bfe4b364a605c0d7c8bae83229837a
This commit is contained in:
Marc Blank 2012-05-25 15:58:40 -07:00
parent 7c94a65c4a
commit 6fb157c90c
2 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,7 @@
package com.android.emailcommon.internet;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Base64DataException;
import android.util.Base64InputStream;
@ -408,7 +409,8 @@ public class MimeUtility {
String disposition = part.getDisposition();
String dispositionType = MimeUtility.getHeaderParameter(disposition, null);
// If a disposition is not specified, default to "inline"
boolean inline = dispositionType == null || "inline".equalsIgnoreCase(dispositionType);
boolean inline =
TextUtils.isEmpty(dispositionType) || "inline".equalsIgnoreCase(dispositionType);
// The lower-case mime type
String mimeType = part.getMimeType().toLowerCase();

View File

@ -499,7 +499,7 @@ public class NotificationController {
EmailContent.MAILBOX_NOTIFICATION_URI, mailbox.mAccountKey),
EmailContent.NOTIFICATION_PROJECTION, null, null, null);
if (messageCursor != null) {
if (messageCursor != null && messageCursor.getCount() > 0) {
try {
final int maxNumDigestItems = mContext.getResources().getInteger(
R.integer.max_num_notification_digest_items);