Home | History | Annotate | Download | only in provider

Lines Matching refs:Attachment

24 import com.android.emailcommon.provider.EmailContent.Attachment;
93 Account account1 = ProviderTestUtils.setupAccount("attachment-query", false, mMockContext);
102 // attachment we add will be id=1 and the 2nd will have id=2. This could fail on
112 // Test with no attachment found - should return null
116 // Add a couple of attachment entries. Note, query() just uses the DB, and does not
118 Attachment newAttachment1 = ProviderTestUtils.setupAttachment(message1Id, "file1", 100,
125 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message1Id, "file2", 200,
132 Attachment newAttachment3 = ProviderTestUtils.setupAttachment(message1Id, "file3", 300,
226 // 1 attachment in inbox
237 Attachment.CONTENT_URI, AttachmentInfo.PROJECTION,
238 EmailContent.Attachment.PRECACHE_SELECTION,
239 null, Attachment.RECORD_ID + " DESC");
248 Attachment.CONTENT_URI, AttachmentInfo.PROJECTION,
249 EmailContent.Attachment.PRECACHE_INBOX_SELECTION,
250 null, Attachment.RECORD_ID + " DESC");
277 // Test with no attachment found - should return null
281 // Add a couple of attachment entries. Note, getType() just uses the DB, and does not
283 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message1Id, "file2", 100,
288 Attachment newAttachment3 = ProviderTestUtils.setupAttachment(message1Id, "file3", 100,
293 Attachment newAttachment4 = ProviderTestUtils.setupAttachment(message1Id, "file4.doc", 100,
298 Attachment newAttachment5 = ProviderTestUtils.setupAttachment(message1Id, "file5.xyz", 100,
303 Attachment newAttachment6 = ProviderTestUtils.setupAttachment(message1Id, "file6", 100,
350 // attachment we add will be id=1 and the 2nd will have id=2. This could fail on
356 // Test with no attachment found
360 fail("Should throw an exception on a missing attachment entry");
365 // Add an attachment (but no associated file)
366 Attachment newAttachment = ProviderTestUtils.setupAttachment(message1Id, "file", 100,
371 // Test with an attached database, attachment entry found, but no attachment found
374 fail("Should throw an exception on a missing attachment file");
379 // Create an "attachment" by copying an image resource into a file
381 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message1Id, "file", 100,
391 // Test with an attached database, attachment entry found - returns a file
416 // attachment we add will be id=1 and the 2nd will have id=2. This could fail on
424 // Test with an attached database, but no attachment found
428 // Add an attachment (but no associated file)
429 Attachment newAttachment = ProviderTestUtils.setupAttachment(message1Id, "file", 100,
434 // Test with an attached database, attachment entry found, but no attachment found
438 // Create an "attachment" by copying an image resource into a file
440 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message1Id, "file", 100,
450 // Test with an attached database, attachment entry found - returns a thumbnail
458 // Add an attachment entry.
459 Attachment newAttachment = ProviderTestUtils.setupAttachment(messageId, "file", 100,
475 Account account1 = ProviderTestUtils.setupAccount("attachment-query", false, mMockContext);
484 // Test with no attachment found - should return input
498 // When the attachment is found, return the stored content_uri value
513 * Test the functionality of deleting all attachment files for a given message.
516 Account account1 = ProviderTestUtils.setupAccount("attachment-query", false, mMockContext);
519 final long message1Id = 1; // 1 attachment, 1 file
521 final long message3Id = 3; // 1 attachment, missing file
524 // Add attachment entries for various test messages
525 Attachment newAttachment1 = ProviderTestUtils.setupAttachment(message1Id, "file1", 100,
527 Attachment newAttachment2 = ProviderTestUtils.setupAttachment(message2Id, "file2", 200,
529 Attachment newAttachment3 = ProviderTestUtils.setupAttachment(message2Id, "file3", 100,
531 Attachment newAttachment4 = ProviderTestUtils.setupAttachment(message3Id, "file4", 100,
539 // Confirm 3 attachment files found
551 // Message 3 has no attachment files so no files should be deleted
556 // Message 2 has 2 attachment files so this should delete 2 files
561 // Message 1 has 1 attachment file so this should delete the last file
584 // Confirm four attachment files found
589 // Command the deletion of mailbox 1 - we should lose 3 attachment files
594 // Command the deletion of mailbox 2 - we should lose 1 attachment file
629 // Confirm eleven attachment files found
637 // Command the deletion of account 1 - we should lose 4 attachment files
642 // Command the deletion of account 2 - we should lose 7 attachment file
666 // Create attachment records & files
668 Attachment newAttachment = ProviderTestUtils.setupAttachment(message1a.mId,
675 * Create an attachment by copying an image resource into a file. Uses "real" resources
690 * Record an attachment in the attachments database
691 * @return the id of the attachment just created
693 private long addAttachmentToDb(Account forAccount, Attachment newAttachment) {
699 * Map from account, attachment ID to attachment file