Home | History | Annotate | Download | only in provider

Lines Matching refs:ATTACHMENT

84 import com.android.emailcommon.provider.EmailContent.Attachment;
186 "vnd.android.cursor.item/email-attachment";
229 private static final int ATTACHMENT = ATTACHMENT_BASE;
298 array.put(ATTACHMENT_BASE >> BASE_SHIFT, Attachment.TABLE_NAME);
748 case ATTACHMENT:
844 case ATTACHMENT:
845 return "vnd.android.cursor.dir/email-attachment";
854 Cursor c = db.query(Attachment.TABLE_NAME, MIME_TYPE_PROJECTION,
938 case ATTACHMENT:
979 case ATTACHMENT:
986 LogUtils.w(TAG, new Throwable(), "attachment with blank location");
1004 // This implies adding an attachment to a message.
1008 return insert(Attachment.CONTENT_URI, values); // Recurse
1016 resultUri = ContentUris.withAppendedId(Attachment.CONTENT_URI, longId);
1135 // insert into this URI causes an attachment to be added to the message
1138 // A specific attachment
1139 sURIMatcher.addURI(EmailContent.AUTHORITY, "attachment", ATTACHMENT);
1140 // A specific attachment (the header information)
1141 sURIMatcher.addURI(EmailContent.AUTHORITY, "attachment/#", ATTACHMENT_ID);
1143 sURIMatcher.addURI(EmailContent.AUTHORITY, "attachment/message/#",
1145 sURIMatcher.addURI(EmailContent.AUTHORITY, "attachment/cachedFile",
1374 case ATTACHMENT:
1458 c = db.query(Attachment.TABLE_NAME, projection,
1475 // Map the columns of our attachment table to the columns defined in
1478 c = db.query(Attachment.TABLE_NAME,
2097 // Notify on individual attachment
2099 Attachment att = Attachment.restoreAttachmentWithId(context, attId);
2205 case ATTACHMENT:
2211 if (match == ATTACHMENT) {
2214 LogUtils.w(TAG, new Throwable(), "attachment with blank location");
2414 uri.getQueryParameter(Attachment.CACHED_FILE_QUERY_PARAM);
2422 LogUtils.d(TAG, "Opening attachment %s", cachedFilePath);
2555 * Notify the service that an attachment has changed.
3049 * Class that holds the sqlite query and the attachment (JSON) value (which might be null)
3094 Attachment[] atts = Attachment.restoreAttachmentsWithMessageId(context, messageId);
3096 ArrayList<com.android.mail.providers.Attachment> uiAtts =
3097 new ArrayList<com.android.mail.providers.Attachment>();
3098 for (Attachment att : atts) {
3115 com.android.mail.providers.Attachment uiAtt =
3116 new com.android.mail.providers.Attachment();
3125 attachmentJson = com.android.mail.providers.Attachment.toJSONArray(uiAtts);
3138 * HACK: override the attachment uri to contain a query parameter
3139 * This forces the message footer to reload the attachment display when the message is
4013 * Generate the "attachment list" SQLite query, given a projection from UnifiedEmail
4022 // MAKE SURE THESE VALUES STAY IN SYNC WITH GEN QUERY ATTACHMENT
4027 .append(Attachment.TABLE_NAME)
4057 * Generate the "single attachment" SQLite query, given a projection from UnifiedEmail
4069 .append(" FROM ").append(Attachment.TABLE_NAME)
4076 * Generate the "single attachment by Content ID" SQLite query, given a projection from
4088 .append(" FROM ").append(Attachment.TABLE_NAME)
4098 * Attachment row, produces the Content URI for the attachment
4101 final String uriPrefix = Attachment.ATTACHMENT_PROVIDER_URI_PREFIX;
4285 final Attachment att = Attachment.restoreAttachmentWithId(mContext, id);
4300 // content uri from the attachment
4313 if (TextUtils.equals(authority, Attachment.ATTACHMENT_PROVIDER_AUTHORITY)) {
4724 // we don't have easy access to the attachment ID (which is buried in the cursor
4787 * Convert a UIProvider attachment to an EmailProvider attachment (for sending); we only need
4789 * @param uiAtt the UIProvider attachment to convert
4791 * @return the EmailProvider attachment
4793 // TODO(pwestbro): once the Attachment contains the cached uri, the second parameter can be
4795 // TODO(mhibdon): if the UI Attachment contained the account key, the third parameter could
4797 private static Attachment convertUiAttachmentToAttachment(
4798 com.android.mail.providers.Attachment uiAtt, String cachedFile, long accountKey) {
4799 final Attachment att = new Attachment();
4806 "content://" + EmailContent.AUTHORITY + "/attachment/cachedFile").buildUpon();
4807 cachedFileBuilder.appendQueryParameter(Attachment.CACHED_FILE_QUERY_PARAM, cachedFile);
4928 final List<com.android.mail.providers.Attachment> uiAtts =
4929 com.android.mail.providers.Attachment.fromJSONArray(
4931 final ArrayList<Attachment> atts = new ArrayList<Attachment>();
4935 for (com.android.mail.providers.Attachment uiAtt: uiAtts) {
4938 // If it's one of ours, retrieve the attachment and add it to the list
4940 final Attachment att = Attachment.restoreAttachmentWithId(context, attId);
4942 // We must clone the attachment into a new one for this message; easiest to
4947 final Attachment attClone = new Attachment(p);
4949 // Clear the messageKey (this is going to be a new attachment)
4955 attClone.mFlags |= Attachment.FLAG_DOWNLOAD_FORWARD;
4961 // Cache the attachment. This will allow us to send it, if the permissions are
4966 // Convert external attachment to one of ours and add to the list
4987 ContentUris.withAppendedId(Attachment.MESSAGE_ID_URI, msg.mId))
5149 Attachment attachment =
5150 Attachment.restoreAttachmentWithId(context, attachmentId);
5151 if (attachment == null) {
5162 attachment.mFlags &= ~Attachment.FLAG_DOWNLOAD_USER_REQUEST);
5163 attachment.update(context, values);
5175 attachment.mFlags | Attachment.FLAG_DOWNLOAD_USER_REQUEST);
5179 LogUtils.w(TAG, new Throwable(), "attachment with blank location");
5182 attachment.update(context, values);
5186 // If this is an inline attachment, notify message has changed
5187 if (!TextUtils.isEmpty(attachment.mContentId)) {
5188 notifyUI(UIPROVIDER_MESSAGE_NOTIFIER, attachment.mMessageKey);