am c085911e: Merge "Add logging to see why attachments fail to load" into jb-ub-mail-ur10

* commit 'c085911eeeb18059be403b1a506d50f2cc807b43':
  Add logging to see why attachments fail to load
This commit is contained in:
Martin Hibdon 2013-10-31 18:26:30 -07:00 committed by Android Git Automerger
commit 2d49f0df50
2 changed files with 17 additions and 2 deletions

View File

@ -864,6 +864,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;
}
@ -1876,6 +1879,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;
@ -4705,6 +4714,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;
}

View File

@ -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 + "%");
}
}