Lines Matching refs:att
749 public synchronized void onChange(final Context context, final Attachment att) {
750 debugTrace("onChange() for Attachment: #%d", att.mId);
751 DownloadRequest req = mDownloadQueue.findRequestById(att.mId);
752 final long priority = getAttachmentPriority(att);
755 att.mId);
764 if (mDownloadsInProgress.containsKey(att.mId)) {
765 debugTrace("Attachment #%d was already in the queue", att.mId);
770 LogUtils.d(LOG_TAG, "Attachment #%d is a new download request", att.mId);
771 req = new DownloadRequest(context, att);
772 final AttachmentInfo attachInfo = new AttachmentInfo(context, att);
774 LogUtils.w(LOG_TAG, "Attachment #%d is not eligible for download", att.mId);
777 if (((att.mFlags & Attachment.FLAG_DOWNLOAD_USER_REQUEST) != 0) ||
778 ((att.mFlags & Attachment.FLAG_POLICY_DISALLOWS_DOWNLOAD) != 0)) {
779 LogUtils.w(LOG_TAG, "Attachment #%d cannot be downloaded ever", att.mId);
789 markAttachmentAsFailed(att);
803 att.mId, req.mPriority, req.mCreatedTime);
811 * @param att The attachment that failed to download.
813 void markAttachmentAsFailed(final Attachment att) {
816 cv.put(AttachmentColumns.FLAGS, att.mFlags &= ~flags);
818 att.update(this, cv);
823 * @param att The attachment that was downloaded.
825 void markAttachmentAsCompleted(final Attachment att) {
828 cv.put(AttachmentColumns.FLAGS, att.mFlags &= ~flags);
830 att.update(this, cv);
927 final Attachment att = new Attachment();
928 att.restore(c);
929 final Account account = Account.restoreAccountWithId(this, att.mAccountKey);
933 debugTrace("Found orphaned attachment #%d", att.mId);
934 EmailContent.delete(this, Attachment.CONTENT_URI, att.mId);
939 final AttachmentInfo info = new AttachmentInfo(this, att);
943 if (att.mContentId != null || canPrefetchForAccount(account, cacheDir)) {
944 final Integer tryCount = mAttachmentFailureMap.get(att.mId);
948 "Too many failed attempts for attachment #%d ", att.mId);
952 final DownloadRequest req = new DownloadRequest(this, att);
963 LogUtils.w(LOG_TAG, "Skipping attachment #%d, it is ineligible", att.mId);
1210 * @param att the Attachment
1213 private static int getAttachmentPriority(final Attachment att) {
1215 final int flags = att.mFlags;
1334 final Attachment att = Attachment.restoreAttachmentWithId(this, req.mAttachmentId);
1335 if (att == null) {
1337 } else if (att.mFileName != null) {
1338 final String fileName = att.mFileName;
1347 if (att.getContentUri() != null) {
1348 pw.print(" ContentUri: " + att.getContentUri());
1351 if (att.mMimeType != null) {
1352 pw.print(att.mMimeType);
1357 pw.println(" Size: " + att.mSize);