/packages/apps/UnifiedEmail/src/com/android/mail/compose/ |
H A D | AttachmentsView.java | 96 * Add an attachment and update the ui accordingly. 97 * @param attachment 99 public void addAttachment(final Attachment attachment) { argument 104 mAttachments.add(attachment); 107 // If we have an attachment that should be shown in a tiled look, 109 if (AttachmentTile.isTiledAttachment(attachment)) { 111 mTileGrid.addComposeTileFromAttachment(attachment); 115 deleteAttachment(attachmentTile, attachment); 122 new AttachmentComposeView(getContext(), attachment); 127 deleteAttachment(attachmentView, attachment); 142 deleteAttachment(final View attachmentView, final Attachment attachment) argument 315 addAttachment(Account account, Attachment attachment) argument [all...] |
H A D | AttachmentComposeView.java | 34 * This view is used in the ComposeActivity to display an attachment along with its name/size 41 public AttachmentComposeView(Context c, Attachment attachment) { argument 43 mAttachment = attachment; 48 attachStr = attachment.toJSON().toString(2); 50 attachStr = attachment.toString(); 52 LogUtils.d(LOG_TAG, "attachment view: %s", attachStr); 57 factory.inflate(R.layout.attachment, this);
|
/packages/apps/UnifiedEmail/src/com/android/mail/photo/ |
H A D | MailPhotoViewActivity.java | 147 final Attachment attachment = getCurrentAttachment(); 149 if (attachment != null && mSaveItem != null && mShareItem != null) { 150 mSaveItem.setEnabled(!attachment.isDownloading() 151 && attachment.canSave() && !attachment.isSavedToExternal()); 152 mShareItem.setEnabled(attachment.canShare()); 153 mDownloadAgainItem.setEnabled(attachment.canSave() && attachment.isDownloading()); 165 // If one attachment can be saved, enable save all 225 final Attachment attachment 266 updateProgressAndEmptyViews( final PhotoViewFragment fragment, final Attachment attachment) argument 324 saveAttachment(final Attachment attachment) argument 358 shareAttachment(final Attachment attachment) argument [all...] |
/packages/apps/UnifiedEmail/src/com/android/mail/ui/ |
H A D | AttachmentTile.java | 43 * Base class for attachment tiles that handles the work of fetching and displaying the bitmaps for 65 * Returns true if the attachment should be rendered as a tile. with a large image preview. 66 * @param attachment the attachment to render 67 * @return true if the attachment should be rendered as a tile 69 public static boolean isTiledAttachment(final Attachment attachment) { argument 70 return ImageUtils.isImageMimeType(attachment.getContentType()); 100 * Render or update an attachment's view. This happens immediately upon instantiation, and 104 public void render(Attachment attachment, Uri attachmentsListUri, int index, argument 106 if (attachment 266 AttachmentPreview(Attachment attachment, Bitmap preview) argument 273 set(Attachment attachment, Bitmap preview) argument 274 get(Attachment attachment) argument [all...] |
H A D | AttachmentTileGrid.java | 70 // Adding tiles to grid and filling in attachment information 72 for (Attachment attachment : list) { 73 addMessageTileFromAttachment(attachment, index++, loaderResult); 77 private void addMessageTileFromAttachment(Attachment attachment, int index, argument 89 attachmentTile.render(attachment, mAttachmentsListUri, index, this, loaderResult); 92 public ComposeAttachmentTile addComposeTileFromAttachment(Attachment attachment) { argument 97 attachmentTile.render(attachment, null, -1, this, false); 218 * Save the preview for an attachment 221 public void set(Attachment attachment, Bitmap preview) { argument 222 final String attachmentIdentifier = attachment 233 get(Attachment attachment) argument [all...] |
H A D | ThumbnailLoadTask.java | 53 final Attachment attachment, final Attachment prevAttachment) { 56 if (attachment == null || width == 0 || height == 0 57 || !ImageUtils.isImageMimeType(attachment.getContentType())) { 62 final Uri thumbnailUri = attachment.thumbnailUri; 63 final Uri contentUri = attachment.contentUri; 51 setupThumbnailPreview( ThumbnailLoadTask task, final AttachmentBitmapHolder holder, final Attachment attachment, final Attachment prevAttachment) argument
|
/packages/apps/Email/tests/src/com/android/email/mail/transport/ |
H A D | SmtpSenderUnitTests.java | 134 * Test: Open and send a single message with an empty attachment (no file) (sunny day) 146 // Creates an attachment with a bogus file (so we get headers only) 147 Attachment attachment = setupSimpleAttachment(mProviderContext, message.mId); 148 attachment.save(mProviderContext); 154 expectSimpleAttachment(mockTransport, attachment); 192 * Prepare to send a simple attachment 195 Attachment attachment = new Attachment(); 196 attachment.mFileName = "the file.jpg"; 197 attachment.mMimeType = "image/jpg"; 198 attachment 211 expectSimpleAttachment(MockTransport mockTransport, Attachment attachment) argument [all...] |
/packages/apps/UnifiedEmail/src/com/android/mail/utils/ |
H A D | AttachmentUtils.java | 83 * Return a friendly localized file type for this attachment, or the empty string if 88 public static String getDisplayType(final Context context, final Attachment attachment) { argument 89 if ((attachment.flags & Attachment.FLAG_DUMMY_ATTACHMENT) != 0) { 90 // This is a dummy attachment, display blank for type. 97 final String contentType = attachment.getContentType(); 104 String extension = Utils.getFileExtension(attachment.getName()); 161 * Cache the file specified by the given attachment. This will attempt to use any 164 * @param attachment Attachment to be cached 167 * @return String file path for the cached attachment 169 // TODO(pwestbro): Once the attachment ha 172 cacheAttachmentUri(Context context, Attachment attachment, Bundle attachmentFds) argument 273 canDownloadAttachment(Context context, Attachment attachment) argument [all...] |
/packages/apps/UnifiedEmail/src/com/android/mail/providers/ |
H A D | EmlAttachmentProvider.java | 54 * of the regular attachment provider. 56 * One major difference is that all attachment info is stored in memory (with the 57 * exception of the attachment raw data which is stored in the cache). When 83 * Map that contains a mapping from an attachment list uri to a list of uris. 88 * Map that contains a mapping from an attachment uri to an {@link Attachment} object. 158 // add mapping from uri to attachment 161 // get list of attachment uris, creating if necessary 207 * Adds a row to the cursor for the attachment at the specific attachment {@link Uri} 208 * if the attachment' 232 addRow(MatrixCursor cursor, Attachment attachment) argument [all...] |
/packages/apps/Email/emailcommon/src/com/android/emailcommon/internet/ |
H A D | Rfc822Output.java | 176 // Move to the first attachment; this must succeed because multipart is true 178 // If we've got one attachment and it's an ics "attachment", we want to send 213 * Write a single attachment and its payload 216 Attachment attachment) throws IOException, MessagingException { 218 attachment.mMimeType + ";\n name=\"" + attachment.mFileName + "\""); 222 if ((attachment.mFlags & Attachment.FLAG_ICS_ALTERNATIVE_PART) == 0) { 224 "attachment;" 225 + "\n filename=\"" + attachment 215 writeOneAttachment(Context context, Writer writer, OutputStream out, Attachment attachment) argument [all...] |
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ |
H A D | AttachmentProgressDialogFragment.java | 32 public static final String ATTACHMENT_KEY = "attachment"; 39 static AttachmentProgressDialogFragment newInstance(Attachment attachment) { argument 42 // Supply the attachment as an argument. 44 args.putParcelable(ATTACHMENT_KEY, attachment); 89 // This needs to cancel the attachment 117 public boolean isShowingDialogForAttachment(Attachment attachment) { argument 119 && Objects.equal(attachment.getIdentifierUri(), mAttachment.getIdentifierUri());
|
H A D | MessageAttachmentBar.java | 54 * View for a single attachment in conversation view. Shows download status and allows launching 55 * intents to act on an attachment. 106 * Render or update an attachment's view. This happens immediately upon instantiation, and 110 public void render(Attachment attachment, Uri accountUri, boolean loaderResult) { argument 115 mAttachment = attachment; 121 mSaveClicked = !attachment.isDownloading() ? false : mSaveClicked; 123 LogUtils.d(LOG_TAG, "got attachment list row: name=%s state/dest=%d/%d dled=%d" + 124 " contentUri=%s MIME=%s flags=%d", attachment.getName(), attachment.state, 125 attachment [all...] |
H A D | AttachmentActionHandler.java | 46 private static final String PROGRESS_FRAGMENT_TAG = "attachment-progress"; 71 public void setAttachment(Attachment attachment) { argument 72 mAttachment = attachment; 97 * Start downloading the full size attachment set with 111 Attachment attachment, int destination, int rendition, int additionalPriority, 120 mCommandHandler.sendCommand(attachment.uri, params); 130 public void startRedownloadingAttachment(Attachment attachment) { argument 133 params.put(AttachmentColumns.DESTINATION, attachment.destination); 135 mCommandHandler.sendCommand(attachment.uri, params); 110 startDownloadingAttachment( Attachment attachment, int destination, int rendition, int additionalPriority, boolean delayDownload) argument
|
H A D | MessageFooterView.java | 110 // If this MessageFooterView is being bound to a new attachment, we need to unbind with the 117 // Destroy the loader if we are attempting to load a different attachment 148 // before the attachment loader results are in, we can still render immediately using 165 for (Attachment attachment : attachments) { 166 if (AttachmentTile.isTiledAttachment(attachment)) { 167 tiledAttachments.add(attachment); 169 barAttachments.add(attachment); 191 for (Attachment attachment : barAttachments) { 192 final Uri id = attachment.getIdentifierUri(); 203 barAttachmentView.render(attachment, mAccountUr [all...] |
H A D | MessageAttachmentTile.java | 52 * View for a single attachment in conversation view. Shows download status and allows launching 53 * intents to act on an attachment. 82 * Render or update an attachment's view. This happens immediately upon instantiation, and 87 public void render(Attachment attachment, Uri attachmentsListUri, int index, argument 89 super.render(attachment, attachmentsListUri, index, attachmentPreviewCache, loaderResult); 205 // Download if there is network. This check prevents the attachment
|
/packages/apps/Email/emailcommon/src/com/android/emailcommon/utility/ |
H A D | AttachmentUtilities.java | 128 * The maximum size of an attachment we're willing to download (either View or Save) 130 * so we should probably factor that in. A 5MB attachment will generally be around 135 * The maximum size of an attachment we're willing to upload (measured as stored on disk). 137 * so we should probably factor that in. A 5MB attachment will generally be around 169 * Return the filename for a given attachment. This should be used by any code that is 180 * Return the directory for a given attachment. This should be used by any code that is 216 * @return A likely mime type for the attachment 267 * Resolve attachment id to content URI. Returns the resolved content URI (from the attachment 296 * In support of deleting a message, find all attachments and delete associated attachment 398 saveAttachment(Context context, InputStream in, Attachment attachment) argument [all...] |
H A D | Utility.java | 735 public static boolean attachmentExists(Context context, Attachment attachment) { argument 736 if (attachment == null) { 738 } else if (attachment.mContentBytes != null) { 741 final String cachedFile = attachment.getCachedFileUri(); 759 final String contentUri = attachment.getContentUri(); 798 // If the attachment doesn't exist and isn't marked for download, we're in trouble 800 // we'll just delete the attachment and continue; this is far better than the 804 LogUtils.d(Logging.LOG_TAG, "Unloaded attachment isn't marked for download: " + 809 // the attachment has been loaded 818 // In this case, the attachment fil [all...] |
/packages/apps/Email/src/com/android/email/ |
H A D | AttachmentInfo.java | 37 * Encapsulates commonly used attachment information related to suitability for viewing and saving, 38 * based on the attachment's filename and mimetype. 58 /** No receiving intent to handle attachment type */ 75 /** Whether or not this attachment can be viewed */ 77 /** Whether or not this attachment can be saved */ 79 /** Whether or not this attachment can be installed [only true for APKs] */ 81 /** Reason(s) why this attachment is denied from being viewed */ 84 public AttachmentInfo(Context context, Attachment attachment) { argument 85 this(context, attachment.mId, attachment [all...] |
/packages/apps/Email/tests/src/com/android/emailcommon/utility/ |
H A D | UtilityMediumTests.java | 98 // We return false with null attachment 105 Attachment attachment = ProviderTestUtils.setupAttachment(message.mId, "filename.ext", 107 attachment.mContentBytes = null; 109 assertFalse(Utility.attachmentExists(mMockContext, attachment)); 111 attachment.mContentBytes = new byte[0]; 113 assertTrue(Utility.attachmentExists(mMockContext, attachment)); 115 attachment.mContentBytes = null; 123 assertFalse(Utility.attachmentExists(mMockContext, attachment)); 131 attachment.setContentUri("file://" + file.getAbsolutePath()); 133 assertTrue(Utility.attachmentExists(mMockContext, attachment)); [all...] |
/packages/apps/Email/src/com/android/email/service/ |
H A D | AttachmentDownloadService.java | 77 // Try to download an attachment in the background this many times before giving up 102 "com.android.email.AttachmentDownloadService.attachment"; 114 // A map of attachment storage used per account 119 // A map of attachment ids to the number of failed attempts to download the attachment 189 private DownloadRequest(Context context, Attachment attachment) { argument 190 attachmentId = attachment.mId; 191 Message msg = Message.restoreMessageWithId(context, attachment.mMessageKey); 198 priority = getPriority(attachment); 224 * Two download requests are equals if their attachment i [all...] |
H A D | EmailServiceStub.java | 126 //1. Check if the attachment is already here and return early in that case 127 Attachment attachment = 129 if (attachment == null) { 134 final long messageId = attachment.mMessageKey; 137 EmailContent.Message.restoreMessageWithId(mContext, attachment.mMessageKey); 145 if (Utility.attachmentExists(mContext, attachment) 146 && attachment.mUiState == UIProvider.AttachmentState.SAVED) { 189 // 3. Generate a shell message in which to retrieve the attachment, 190 // and a shell BodyPart for the attachment. Then glue them together. 193 storePart.setSize((int)attachment [all...] |
/packages/apps/Exchange/src/com/android/exchange/eas/ |
H A D | EasLoadAttachment.java | 73 * @param attachmentId The local id of the attachment (i.e. its id in the database). 108 final EmailContent.Attachment attachment) { 110 mAttachment = attachment; 120 * Encoder for Exchange 2003 attachment names. They come from the server partially encoded, 126 // These four characters are commonly received in EAS 2.5 attachment names and are 133 * Finish encoding attachment names for Exchange 2003. 145 * Finish encoding attachment names for Exchange 2003. 152 LogUtils.e(LOG_TAG, "Could not load attachment %d", mAttachmentId); 172 // First callback to let the client know that we have started the attachment load. 180 // We had an error processing an attachment, le 107 ProgressCallback(final IEmailServiceCallback callback, final EmailContent.Attachment attachment) argument 255 finishLoadAttachment(final EmailContent.Attachment attachment, final File file) argument [all...] |
/packages/apps/Bluetooth/src/com/android/bluetooth/map/ |
H A D | BluetoothMapAppParams.java | 99 private int attachment = INVALID_VALUE_PARAMETER; field in class:BluetoothMapAppParams 630 return attachment; 633 public void setAttachment(int attachment) throws IllegalArgumentException { argument 634 if (attachment < 0 || attachment > 0x0001) 636 this.attachment = attachment;
|
/packages/apps/Mms/src/com/android/mms/ui/ |
H A D | ConversationListItem.java | 87 mAttachmentView = findViewById(R.id.attachment); 184 // When there's an error icon, the attachment icon is left of the error icon. 185 // When there is not an error icon, the attachment icon is left of the date text. 214 subjectLayout.addRule(RelativeLayout.LEFT_OF, hasAttachment ? R.id.attachment :
|
/packages/apps/Email/tests/src/com/android/email/ |
H A D | LegacyConversionsTests.java | 233 Attachment attachment = Attachment.getContent(c, Attachment.class); 234 if ("100".equals(attachment.mLocation)) { 235 checkAttachment("attachment1Part", attachments.get(0), attachment, 237 } else if ("101".equals(attachment.mLocation)) { 238 checkAttachment("attachment2Part", attachments.get(1), attachment, 241 fail("Unexpected attachment with location " + attachment.mLocation); 250 * Test that only "attachment" or "inline" attachments are captured and added. 263 // 1. Standard attachment 268 "attachment;\ [all...] |