Home | History | Annotate | Download | only in provider

Lines Matching refs:Attachment

35 import com.android.emailcommon.provider.EmailContent.Attachment;
59 super(AttachmentProvider.class, Attachment.ATTACHMENT_PROVIDER_LEGACY_URI_PREFIX);
83 Account account1 = ProviderTestUtils.setupAccount("attachment-query", false, mMockContext);
91 // attachment we add will be id=1 and the 2nd will have id=2. This could fail on
101 // Test with no attachment found - should return null
105 // Add a couple of attachment entries. Note, query() just uses the DB, and does not
107 Attachment newAttachment1 = ProviderTestUtils.setupAttachment(message1Id, "file1", 100,
114 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message1Id, "file2", 200,
121 Attachment newAttachment3 = ProviderTestUtils.setupAttachment(message1Id, "file3", 300,
215 // 1 attachment in inbox
226 Attachment.CONTENT_URI, AttachmentInfo.PROJECTION,
227 EmailContent.Attachment.PRECACHE_SELECTION,
228 null, Attachment.RECORD_ID + " DESC");
237 Attachment.CONTENT_URI, AttachmentInfo.PROJECTION,
238 EmailContent.Attachment.PRECACHE_INBOX_SELECTION,
239 null, Attachment.RECORD_ID + " DESC");
265 // Test with no attachment found - should return null
269 // Add a couple of attachment entries. Note, getType() just uses the DB, and does not
271 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message1Id, "file2", 100,
276 Attachment newAttachment3 = ProviderTestUtils.setupAttachment(message1Id, "file3", 100,
281 Attachment newAttachment4 = ProviderTestUtils.setupAttachment(message1Id, "file4.doc", 100,
286 Attachment newAttachment5 = ProviderTestUtils.setupAttachment(message1Id, "file5.xyz", 100,
291 Attachment newAttachment6 = ProviderTestUtils.setupAttachment(message1Id, "file6", 100,
337 // attachment we add will be id=1 and the 2nd will have id=2. This could fail on
343 // Test with no attachment found
347 fail("Should throw an exception on a missing attachment entry");
352 // Add an attachment (but no associated file)
353 Attachment newAttachment = ProviderTestUtils.setupAttachment(message1Id, "file", 100,
358 // Test with an attached database, attachment entry found, but no attachment found
361 fail("Should throw an exception on a missing attachment file");
366 // Create an "attachment" by copying an image resource into a file
368 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message1Id, "file", 100,
378 // Test with an attached database, attachment entry found - returns a file
402 // attachment we add will be id=1 and the 2nd will have id=2. This could fail on
410 // Test with an attached database, but no attachment found
414 // Add an attachment (but no associated file)
415 Attachment newAttachment = ProviderTestUtils.setupAttachment(message1Id, "file", 100,
420 // Test with an attached database, attachment entry found, but no attachment found
424 // Create an "attachment" by copying an image resource into a file
426 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message1Id, "file", 100,
436 // Test with an attached database, attachment entry found - returns a thumbnail
444 // Add an attachment entry.
445 Attachment newAttachment = ProviderTestUtils.setupAttachment(messageId, "file", 100,
461 Account account1 = ProviderTestUtils.setupAccount("attachment-query", false, mMockContext);
469 // Test with no attachment found - should return input
483 // When the attachment is found, return the stored content_uri value
498 * Test the functionality of deleting all attachment files for a given message.
501 Account account1 = ProviderTestUtils.setupAccount("attachment-query", false, mMockContext);
503 final long message1Id = 1; // 1 attachment, 1 file
505 final long message3Id = 3; // 1 attachment, missing file
508 // Add attachment entries for various test messages
509 Attachment newAttachment1 = ProviderTestUtils.setupAttachment(message1Id, "file1", 100,
511 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message2Id, "file2", 200,
513 Attachment newAttachment3 = ProviderTestUtils.setupAttachment(message2Id, "file3", 100,
515 Attachment newAttachment4 = ProviderTestUtils.setupAttachment(message3Id, "file4", 100,
523 // Confirm 3 attachment files found
535 // Message 3 has no attachment files so no files should be deleted
540 // Message 2 has 2 attachment files so this should delete 2 files
545 // Message 1 has 1 attachment file so this should delete the last file
567 // Confirm four attachment files found
572 // Command the deletion of mailbox 1 - we should lose 3 attachment files
577 // Command the deletion of mailbox 2 - we should lose 1 attachment file
610 // Confirm eleven attachment files found
618 // Command the deletion of account 1 - we should lose 4 attachment files
623 // Command the deletion of account 2 - we should lose 7 attachment file
647 // Create attachment records & files
649 Attachment newAttachment = ProviderTestUtils.setupAttachment(message1a.mId,
656 * Create an attachment by copying an image resource into a file. Uses "real" resources
671 * Record an attachment in the attachments database
672 * @return the id of the attachment just created
674 private long addAttachmentToDb(Account forAccount, Attachment newAttachment) {
680 * Map from account, attachment ID to attachment file