Fix display for inlined and non-inlined attachments
b/11069575 The problem is that the UI_MESSAGE query strips out any inlined attachments, but the UI_ATTACHMENTS query does not. This means that we display all attachments at the bottom, regardless of whether or not they're inlined, but the formatting is wrong because when we measured we only had the non-inlined attachments. Maybe we should not display the inlined attachments at the bottom, but right now if we do that, it's impossible to save an inlined image. So for now, I'm just making UI_MESSAGE query keep the inlined attachments so that both queries have the same behavior. Change-Id: I155f5bb74dbfbc8dbf02b56dca58fbca3da5da78
This commit is contained in:
parent
26c8e7551d
commit
fc8a57bb29
@ -2520,9 +2520,22 @@ public class EmailProvider extends ContentProvider {
|
|||||||
ArrayList<com.android.mail.providers.Attachment> uiAtts =
|
ArrayList<com.android.mail.providers.Attachment> uiAtts =
|
||||||
new ArrayList<com.android.mail.providers.Attachment>();
|
new ArrayList<com.android.mail.providers.Attachment>();
|
||||||
for (Attachment att : atts) {
|
for (Attachment att : atts) {
|
||||||
if (att.mContentId != null && att.getContentUri() != null) {
|
// TODO: This code is intended to strip out any inlined attachments (which
|
||||||
continue;
|
// would have a non-null contentId) so that they will not display at the bottom
|
||||||
}
|
// along with the non-inlined attachments.
|
||||||
|
// The problem is that the UI_ATTACHMENTS query does not behave the same way,
|
||||||
|
// which causes crazy formatting.
|
||||||
|
// There is an open question here, should attachments that are inlined
|
||||||
|
// ALSO appear in the list of attachments at the bottom with the non-inlined
|
||||||
|
// attachments?
|
||||||
|
// Either way, the two queries need to behave the same way.
|
||||||
|
// As of now, they will. If we decide to stop this, then we need to enable
|
||||||
|
// the code below, and then also make the UI_ATTACHMENTS query behave
|
||||||
|
// the same way.
|
||||||
|
//
|
||||||
|
// if (att.mContentId != null && att.getContentUri() != null) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
com.android.mail.providers.Attachment uiAtt =
|
com.android.mail.providers.Attachment uiAtt =
|
||||||
new com.android.mail.providers.Attachment();
|
new com.android.mail.providers.Attachment();
|
||||||
uiAtt.setName(att.mFileName);
|
uiAtt.setName(att.mFileName);
|
||||||
@ -4023,7 +4036,7 @@ public class EmailProvider extends ContentProvider {
|
|||||||
*/
|
*/
|
||||||
// TODO(pwestbro): once the Attachment contains the cached uri, the second parameter can be
|
// TODO(pwestbro): once the Attachment contains the cached uri, the second parameter can be
|
||||||
// removed
|
// removed
|
||||||
// TODO(mhibdon): if the UI Attachment containded the account key, the third parameter could
|
// TODO(mhibdon): if the UI Attachment contained the account key, the third parameter could
|
||||||
// be removed.
|
// be removed.
|
||||||
private static Attachment convertUiAttachmentToAttachment(
|
private static Attachment convertUiAttachmentToAttachment(
|
||||||
com.android.mail.providers.Attachment uiAtt, String cachedFile, long accountKey) {
|
com.android.mail.providers.Attachment uiAtt, String cachedFile, long accountKey) {
|
||||||
|
Loading…
Reference in New Issue
Block a user