diff --git a/email2/emailcommon/src/com/android/emailcommon/internet/MimeUtility.java b/email2/emailcommon/src/com/android/emailcommon/internet/MimeUtility.java index fed601190..b96e01e59 100644 --- a/email2/emailcommon/src/com/android/emailcommon/internet/MimeUtility.java +++ b/email2/emailcommon/src/com/android/emailcommon/internet/MimeUtility.java @@ -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(); diff --git a/email2/src/com/android/email/NotificationController.java b/email2/src/com/android/email/NotificationController.java index 6b65d05f6..c0073f261 100644 --- a/email2/src/com/android/email/NotificationController.java +++ b/email2/src/com/android/email/NotificationController.java @@ -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);