diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index ebdbba549..033e3688c 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -863,6 +863,9 @@ public class EmailProvider extends ContentProvider { flags = values.getAsInteger(Attachment.FLAGS); } // Report all new attachments to the download service + if (TextUtils.isEmpty(values.getAsString(Attachment.LOCATION))) { + LogUtils.w(TAG, new Throwable(), "attachment with blank location"); + } mAttachmentService.attachmentChanged(getContext(), longId, flags); break; } @@ -1875,6 +1878,12 @@ public class EmailProvider extends ContentProvider { case ACCOUNT: case HOSTAUTH: case POLICY: + if (match == ATTACHMENT) { + if (values.containsKey(AttachmentColumns.LOCATION) && + TextUtils.isEmpty(values.getAsString(AttachmentColumns.LOCATION))) { + LogUtils.w(TAG, new Throwable(), "attachment with blank location"); + } + } result = db.update(tableName, values, selection, selectionArgs); break; @@ -4700,6 +4709,12 @@ public class EmailProvider extends ContentProvider { destinationValue == null ? 0 : destinationValue); values.put(AttachmentColumns.FLAGS, attachment.mFlags | Attachment.FLAG_DOWNLOAD_USER_REQUEST); + + if (values.containsKey(AttachmentColumns.LOCATION) && + TextUtils.isEmpty(values.getAsString(AttachmentColumns.LOCATION))) { + LogUtils.w(TAG, new Throwable(), "attachment with blank location"); + } + attachment.update(context, values); result = 1; } diff --git a/src/com/android/email/service/AttachmentDownloadService.java b/src/com/android/email/service/AttachmentDownloadService.java index 357e9e3e8..2aeccea3c 100644 --- a/src/com/android/email/service/AttachmentDownloadService.java +++ b/src/com/android/email/service/AttachmentDownloadService.java @@ -59,7 +59,7 @@ import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; public class AttachmentDownloadService extends Service implements Runnable { - public static final String TAG = "AttachmentService"; + public static final String TAG = LogUtils.TAG; // Minimum wait time before retrying a download that failed due to connection error private static final long CONNECTION_ERROR_RETRY_MILLIS = 10 * DateUtils.SECOND_IN_MILLIS; @@ -714,7 +714,7 @@ public class AttachmentDownloadService extends Service implements Runnable { } if (statusCode != EmailServiceStatus.IN_PROGRESS) { LogUtils.d(TAG, ">> Attachment " + attachmentId + ": " + code); - } else if (progress >= (req.lastProgress + 15)) { + } else if (progress >= (req.lastProgress + 10)) { LogUtils.d(TAG, ">> Attachment " + attachmentId + ": " + progress + "%"); } }