Home
last modified time | relevance | path

Searched refs:attachment (Results 1 – 25 of 48) sorted by relevance

12

/packages/apps/UnifiedEmail/src/com/android/mail/photo/
DMailPhotoViewController.java172 final Attachment attachment = getCurrentAttachment(); in updateActionItems() local
174 if (attachment != null && mSaveItem != null && mShareItem != null) { in updateActionItems()
175 mSaveItem.setEnabled(!attachment.isDownloading() in updateActionItems()
176 && attachment.canSave() && !attachment.isSavedToExternal()); in updateActionItems()
177 final boolean canShare = attachment.canShare(); in updateActionItems()
180 mDownloadAgainItem.setEnabled(attachment.canSave() && attachment.isDownloading()); in updateActionItems()
183 attachment.getContentType())); in updateActionItems()
234 final Attachment attachment = getCurrentAttachment(); in updateActionBar() local
237 mMailActivity.getContext(), attachment.size); in updateActionBar()
244 if (attachment.isSavedToExternal()) { in updateActionBar()
[all …]
/packages/apps/UnifiedEmail/src/com/android/mail/providers/
DEmlAttachmentProvider.java153 final Attachment attachment = mUriAttachmentMap.get(attachmentsUri); in query() local
154 if (TextUtils.equals(cid, attachment.partId)) { in query()
155 addRow(cursor, attachment); in query()
242 final Attachment attachment = mUriAttachmentMap.get(uri); in addRow() local
246 if (attachment.getContentType().startsWith(type)) { in addRow()
247 addRow(cursor, attachment); in addRow()
252 addRow(cursor, attachment); in addRow()
259 private static void addRow(MatrixCursor cursor, Attachment attachment) { in addRow() argument
261 .add(attachment.getName()) // displayName in addRow()
262 .add(attachment.size) // size in addRow()
[all …]
/packages/apps/UnifiedEmail/src/com/android/mail/compose/
DAttachmentsView.java100 private void addAttachment(final Attachment attachment) { in addAttachment() argument
101 mAttachments.add(attachment); in addAttachment()
104 if (attachment.isInlineAttachment()) { in addAttachment()
116 if (AttachmentTile.isTiledAttachment(attachment)) { in addAttachment()
118 mTileGrid.addComposeTileFromAttachment(attachment); in addAttachment()
122 deleteAttachment(attachmentTile, attachment); in addAttachment()
129 new AttachmentComposeView(getContext(), attachment); in addAttachment()
134 deleteAttachment(attachmentView, attachment); in addAttachment()
150 final Attachment attachment) { in deleteAttachment() argument
151 mAttachments.remove(attachment); in deleteAttachment()
[all …]
DAttachmentComposeView.java41 public AttachmentComposeView(Context c, Attachment attachment) { in AttachmentComposeView() argument
43 mAttachment = attachment; in AttachmentComposeView()
48 attachStr = attachment.toJSON().toString(2); in AttachmentComposeView()
50 attachStr = attachment.toString(); in AttachmentComposeView()
57 factory.inflate(R.layout.attachment, this); in AttachmentComposeView()
/packages/apps/UnifiedEmail/src/com/android/mail/ui/
DAttachmentTile.java69 public static boolean isTiledAttachment(final Attachment attachment) { in isTiledAttachment() argument
70 return ImageUtils.isImageMimeType(attachment.getContentType()); in isTiledAttachment()
109 protected void render(Attachment attachment, AttachmentPreviewCache attachmentPreviewCache) { in render() argument
110 if (attachment == null) { in render()
116 mAttachment = attachment; in render()
120 " contentUri=%s MIME=%s flags=%d", attachment.getName(), attachment.state, in render()
121 attachment.destination, attachment.downloadedSize, attachment.contentUri, in render()
122 attachment.getContentType(), attachment.flags); in render()
124 if ((attachment.flags & Attachment.FLAG_DUMMY_ATTACHMENT) != 0) { in render()
128 || !TextUtils.equals(attachment.getName(), prevAttachment.getName())) { in render()
[all …]
DAttachmentTileGrid.java81 for (Attachment attachment : list) { in configureGrid()
82 addMessageTileFromAttachment(attachment, index++, loaderResult); in configureGrid()
86 private void addMessageTileFromAttachment(Attachment attachment, int index, in addMessageTileFromAttachment() argument
99 attachmentTile.render(attachment, index, this, loaderResult); in addMessageTileFromAttachment()
102 public ComposeAttachmentTile addComposeTileFromAttachment(Attachment attachment) { in addComposeTileFromAttachment() argument
107 attachmentTile.render(attachment, this); in addComposeTileFromAttachment()
253 public void set(Attachment attachment, Bitmap preview) { in set() argument
254 final String attachmentIdentifier = attachment.getIdentifierUri().toString(); in set()
257 attachmentIdentifier, new AttachmentPreview(attachment, preview)); in set()
265 public Bitmap get(Attachment attachment) { in get() argument
[all …]
DThumbnailLoadTask.java52 AttachmentBitmapHolder holder, Attachment attachment, Attachment prevAttachment) { in setupThumbnailPreview() argument
55 final Bitmap cached = cache.get(attachment); in setupThumbnailPreview()
64 if (attachment == null || width == 0 || height == 0 in setupThumbnailPreview()
65 || !ImageUtils.isImageMimeType(attachment.getContentType())) { in setupThumbnailPreview()
70 final Uri thumbnailUri = attachment.thumbnailUri; in setupThumbnailPreview()
71 final Uri contentUri = attachment.contentUri; in setupThumbnailPreview()
72 final Uri uri = attachment.getIdentifierUri(); in setupThumbnailPreview()
/packages/apps/UnifiedEmail/src/com/android/mail/utils/
DAttachmentUtils.java89 public static String getDisplayType(final Context context, final Attachment attachment) { in getDisplayType() argument
90 if ((attachment.flags & Attachment.FLAG_DUMMY_ATTACHMENT) != 0) { in getDisplayType()
98 final String contentType = attachment.getContentType(); in getDisplayType()
105 String extension = Utils.getFileExtension(attachment.getName()); in getDisplayType()
173 public static String cacheAttachmentUri(Context context, Attachment attachment, in cacheAttachmentUri() argument
178 if (attachment.size > 0) { in cacheAttachmentUri()
179 final long usableSpace = cacheDir.getUsableSpace() - attachment.size; in cacheAttachmentUri()
182 usableSpace, totalSpace, attachment); in cacheAttachmentUri()
193 && attachment.contentUri != null ? (AssetFileDescriptor) attachmentFds in cacheAttachmentUri()
194 .getParcelable(attachment.contentUri.toString()) in cacheAttachmentUri()
[all …]
/packages/apps/Email/tests/src/com/android/email/mail/transport/
DSmtpSenderUnitTests.java147 Attachment attachment = setupSimpleAttachment(mProviderContext, message.mId); in testSendMessageWithEmptyAttachment() local
148 attachment.save(mProviderContext); in testSendMessageWithEmptyAttachment()
154 expectSimpleAttachment(mockTransport, attachment); in testSendMessageWithEmptyAttachment()
195 Attachment attachment = new Attachment(); in setupSimpleAttachment() local
196 attachment.mFileName = "the file.jpg"; in setupSimpleAttachment()
197 attachment.mMimeType = "image/jpg"; in setupSimpleAttachment()
198 attachment.mSize = 0; in setupSimpleAttachment()
199 attachment.mContentId = null; in setupSimpleAttachment()
200 attachment.setContentUri("content://com.android.email/1/1"); in setupSimpleAttachment()
201 attachment.mMessageKey = messageId; in setupSimpleAttachment()
[all …]
/packages/apps/Email/provider_src/com/android/email/service/
DAttachmentService.java201 private DownloadRequest(final Context context, final Attachment attachment) { in DownloadRequest() argument
202 mAttachmentId = attachment.mId; in DownloadRequest()
203 final Message msg = Message.restoreMessageWithId(context, attachment.mMessageKey); in DownloadRequest()
210 mPriority = getAttachmentPriority(attachment); in DownloadRequest()
508 ContentValues getAttachmentUpdateValues(final Attachment attachment, in getAttachmentUpdateValues() argument
511 if (attachment != null) { in getAttachmentUpdateValues()
518 attachment.mSize * progress / 100); in getAttachmentUpdateValues()
546 final Attachment attachment = in loadAttachmentStatus() local
548 final ContentValues values = getAttachmentUpdateValues(attachment, statusCode, in loadAttachmentStatus()
551 attachment.update(AttachmentService.this, values); in loadAttachmentStatus()
[all …]
DEmailServiceStub.java128 Attachment attachment = in loadAttachment() local
130 if (attachment == null) { in loadAttachment()
135 final long messageId = attachment.mMessageKey; in loadAttachment()
138 EmailContent.Message.restoreMessageWithId(mContext, attachment.mMessageKey); in loadAttachment()
146 if (Utility.attachmentExists(mContext, attachment) in loadAttachment()
147 && attachment.mUiState == UIProvider.AttachmentState.SAVED) { in loadAttachment()
197 storePart.setSize((int)attachment.mSize); in loadAttachment()
199 attachment.mLocation); in loadAttachment()
202 attachment.mMimeType, in loadAttachment()
203 attachment.mFileName)); in loadAttachment()
[all …]
/packages/apps/Messaging/src/com/android/messaging/ui/
DMultiAttachmentLayout.java71 boolean onAttachmentClick(MessagePartData attachment, Rect viewBoundsOnScreen, in onAttachmentClick() argument
233 final MessagePartData attachment = iterator.next(); in buildViews() local
238 if (previousView.attachment.equals(attachment) && in buildViews()
239 !(previousView.attachment instanceof PendingAttachmentData)) { in buildViews()
248 attachment, this, AttachmentPreviewFactory.TYPE_MULTIPLE, in buildViews()
261 attachmentWrapper = new ViewWrapper(view, attachment); in buildViews()
278 AttachmentPreview.tryAnimateViewIn(attachment, attachmentWrapper.view); in buildViews()
317 mPreviewViews.get(i).attachment, in onMeasure()
369 if (!(viewWrapper.attachment instanceof MediaPickerMessagePartData)) { in trySlideAttachmentView()
400 public View findViewForAttachment(final MessagePartData attachment) { in findViewForAttachment() argument
[all …]
DAttachmentPreview.java237 final MessagePartData attachment = combinedAttachments.get(0); in onAttachmentsChanged() local
245 attachment instanceof MediaPickerMessagePartData) { in onAttachmentsChanged()
247 .findViewForAttachment(attachment); in onAttachmentsChanged()
251 attachment instanceof MediaPickerMessagePartData) { in onAttachmentsChanged()
252 ((MediaPickerMessagePartData) attachment).setStartRect(currentRect); in onAttachmentsChanged()
260 layoutInflater, attachment, mAttachmentView, in onAttachmentsChanged()
265 tryAnimateViewIn(attachment, attachmentView); in onAttachmentsChanged()
318 public boolean onAttachmentClick(final MessagePartData attachment, in onAttachmentClick() argument
325 if (!(attachment instanceof PendingAttachmentData) && attachment.isImage()) { in onAttachmentClick()
326 mComposeMessageView.displayPhoto(attachment.getContentUri(), viewBoundsOnScreen); in onAttachmentClick()
/packages/apps/UnifiedEmail/src/com/android/mail/browse/
DMessageAttachmentBar.java119 public void render(Attachment attachment, Account account, ConversationMessage message, in render() argument
125 mAttachment = attachment; in render()
136 mSaveClicked = !attachment.isDownloading() ? false : mSaveClicked; in render()
139 " contentUri=%s MIME=%s flags=%d", attachment.getName(), attachment.state, in render()
140 attachment.destination, attachment.downloadedSize, attachment.contentUri, in render()
141 attachment.getContentType(), attachment.flags); in render()
143 final String attachmentName = attachment.getName(); in render()
144 if ((attachment.flags & Attachment.FLAG_DUMMY_ATTACHMENT) != 0) { in render()
151 if (prevAttachment == null || attachment.size != prevAttachment.size) { in render()
153 AttachmentUtils.convertToHumanReadableSize(getContext(), attachment.size)); in render()
[all …]
DAttachmentActionHandler.java84 public void setAttachment(Attachment attachment) { in setAttachment() argument
85 mAttachment = attachment; in setAttachment()
124 Attachment attachment, int destination, int rendition, int additionalPriority, in startDownloadingAttachment() argument
133 mCommandHandler.sendCommand(attachment.uri, params); in startDownloadingAttachment()
143 public void startRedownloadingAttachment(Attachment attachment) { in startRedownloadingAttachment() argument
146 params.put(AttachmentColumns.DESTINATION, attachment.destination); in startRedownloadingAttachment()
148 mCommandHandler.sendCommand(attachment.uri, params); in startRedownloadingAttachment()
283 Attachment attachment, FragmentManager fm) { in handleOption1() argument
DMessageFooterView.java186 for (Attachment attachment : attachments) { in renderAttachments()
190 if (!attachment.isInlineAttachment() || mCallbacks.isSecure()) { in renderAttachments()
191 if (AttachmentTile.isTiledAttachment(attachment)) { in renderAttachments()
192 tiledAttachments.add(attachment); in renderAttachments()
194 barAttachments.add(attachment); in renderAttachments()
226 for (Attachment attachment : barAttachments) { in renderBarAttachments()
227 final Uri id = attachment.getIdentifierUri(); in renderBarAttachments()
238 barAttachmentView.render(attachment, account, mMessageHeaderItem.getMessage(), in renderBarAttachments()
DAttachmentProgressDialogFragment.java39 static AttachmentProgressDialogFragment newInstance(Attachment attachment) { in newInstance() argument
44 args.putParcelable(ATTACHMENT_KEY, attachment); in newInstance()
117 public boolean isShowingDialogForAttachment(Attachment attachment) { in isShowingDialogForAttachment() argument
119 && Objects.equal(attachment.getIdentifierUri(), mAttachment.getIdentifierUri()); in isShowingDialogForAttachment()
/packages/apps/Messaging/src/com/android/messaging/datamodel/data/
DDraftMessageData.java186 for (final MessagePartData attachment : mAttachments) { in createMessageWithCurrentAttachments()
187 message.addPart(attachment); in createMessageWithCurrentAttachments()
340 private boolean addOneAttachmentNoNotify(final MessagePartData attachment) { in addOneAttachmentNoNotify() argument
341 Assert.isTrue(attachment.isAttachment()); in addOneAttachmentNoNotify()
343 if (reachedLimit || containsAttachment(attachment.getContentUri())) { in addOneAttachmentNoNotify()
345 attachment.destroyAsync(); in addOneAttachmentNoNotify()
348 addAttachment(attachment, null /*pendingAttachment*/); in addOneAttachmentNoNotify()
353 private void addAttachment(final MessagePartData attachment, in addAttachment() argument
355 if (attachment != null && attachment.isSinglePartOnly()) { in addAttachment()
385 if (attachment != null) { in addAttachment()
[all …]
/packages/apps/Email/emailcommon/src/com/android/emailcommon/internet/
DRfc822Output.java215 Attachment attachment) throws IOException, MessagingException { in writeOneAttachment() argument
217 attachment.mMimeType + ";\n name=\"" + attachment.mFileName + "\""); in writeOneAttachment()
221 if ((attachment.mFlags & Attachment.FLAG_ICS_ALTERNATIVE_PART) == 0) { in writeOneAttachment()
224 + "\n filename=\"" + attachment.mFileName + "\";" in writeOneAttachment()
225 + "\n size=" + Long.toString(attachment.mSize)); in writeOneAttachment()
227 if (attachment.mContentId != null) { in writeOneAttachment()
228 writeHeader(writer, "Content-ID", attachment.mContentId); in writeOneAttachment()
236 if (attachment.mContentBytes != null) { in writeOneAttachment()
237 inStream = new ByteArrayInputStream(attachment.mContentBytes); in writeOneAttachment()
240 final String cachedFile = attachment.getCachedFileUri(); in writeOneAttachment()
[all …]
/packages/apps/Messaging/src/com/android/messaging/ui/attachmentchooser/
DAttachmentGridView.java59 public boolean isItemSelected(final MessagePartData attachment) { in isItemSelected() argument
60 return !mUnselectedSet.contains(attachment); in isItemSelected()
64 public void onItemClicked(final AttachmentGridItemView view, final MessagePartData attachment) { in onItemClicked() argument
67 if (attachment.isImage()) { in onItemClicked()
68 mHost.displayPhoto(UiUtils.getMeasuredBoundsOnScreen(view), attachment.getContentUri()); in onItemClicked()
73 public void onItemCheckedChanged(AttachmentGridItemView view, MessagePartData attachment) { in onItemCheckedChanged() argument
75 if (isItemSelected(attachment)) { in onItemCheckedChanged()
76 mUnselectedSet.add(attachment); in onItemCheckedChanged()
78 mUnselectedSet.remove(attachment); in onItemCheckedChanged()
DAttachmentGridItemView.java38 boolean isItemSelected(MessagePartData attachment); in isItemSelected() argument
39 void onItemCheckedChanged(AttachmentGridItemView view, MessagePartData attachment); in onItemCheckedChanged() argument
40 void onItemClicked(AttachmentGridItemView view, MessagePartData attachment); in onItemClicked() argument
92 public void bind(final MessagePartData attachment, final HostInterface hostInterface) { in bind() argument
93 Assert.isTrue(attachment.isAttachment()); in bind()
96 if (mAttachmentData == null || !mAttachmentData.equals(attachment)) { in bind()
97 mAttachmentData = attachment; in bind()
/packages/apps/Email/emailcommon/src/com/android/emailcommon/utility/
DAttachmentUtilities.java396 public static void saveAttachment(Context context, InputStream in, Attachment attachment) { in saveAttachment() argument
397 final Uri uri = ContentUris.withAppendedId(Attachment.CONTENT_URI, attachment.mId); in saveAttachment()
399 final long attachmentId = attachment.mId; in saveAttachment()
400 final long accountId = attachment.mAccountKey; in saveAttachment()
406 if (attachment.mUiDestination == UIProvider.AttachmentDestination.CACHE) { in saveAttachment()
411 if (TextUtils.isEmpty(attachment.mFileName)) { in saveAttachment()
421 File file = Utility.createUniqueFile(downloads, attachment.mFileName); in saveAttachment()
432 final String mimeType = TextUtils.isEmpty(attachment.mMimeType) ? in saveAttachment()
434 attachment.mMimeType; in saveAttachment()
439 long id = dm.addCompletedDownload(attachment.mFileName, attachment.mFileName, in saveAttachment()
/packages/apps/Email/provider_src/com/android/email/
DAttachmentInfo.java91 public AttachmentInfo(Context context, Attachment attachment) { in AttachmentInfo() argument
92 this(context, attachment.mId, attachment.mSize, attachment.mFileName, attachment.mMimeType, in AttachmentInfo()
93 attachment.mAccountKey, attachment.mFlags); in AttachmentInfo()
/packages/apps/Messaging/src/com/android/messaging/ui/conversation/
DConversationFragment.java677 final MessagePartData attachment) { in selectMessage() argument
685 mSelectedAttachment = attachment; in selectMessage()
1252 final MessagePartData attachment, final Rect imageBounds, final boolean longPress) { in onAttachmentClick() argument
1254 selectMessage(messageView, attachment); in onAttachmentClick()
1261 if (attachment.isImage()) { in onAttachmentClick()
1262 displayPhoto(attachment.getContentUri(), imageBounds, false /* isDraft */); in onAttachmentClick()
1265 if (attachment.isVCard()) { in onAttachmentClick()
1266 UIIntents.get().launchVCardDetailActivity(getActivity(), attachment.getContentUri()); in onAttachmentClick()
1338 for (final AttachmentToSave attachment : mAttachmentsToSave) { in doInBackgroundTimed()
1339 final boolean isImageOrVideo = ContentType.isImageType(attachment.contentType) in doInBackgroundTimed()
[all …]
/packages/apps/Email/tests/src/com/android/email/service/
DAttachmentServiceTests.java453 final EmailContent.Attachment attachment = new EmailContent.Attachment(); in testServiceCallbackAttachmentCompleteUpdate() local
454 attachment.mSize = 1000; in testServiceCallbackAttachmentCompleteUpdate()
459 attachmentService.mServiceCallback.getAttachmentUpdateValues(attachment, in testServiceCallbackAttachmentCompleteUpdate()
466 final EmailContent.Attachment attachment = new EmailContent.Attachment(); in testServiceCallbackAttachmentErrorUpdate() local
467 attachment.mSize = 1000; in testServiceCallbackAttachmentErrorUpdate()
472 attachmentService.mServiceCallback.getAttachmentUpdateValues(attachment, in testServiceCallbackAttachmentErrorUpdate()
479 final EmailContent.Attachment attachment = new EmailContent.Attachment(); in testServiceCallbackAttachmentInProgressUpdate() local
480 attachment.mSize = 1000; in testServiceCallbackAttachmentInProgressUpdate()
485 attachmentService.mServiceCallback.getAttachmentUpdateValues(attachment, in testServiceCallbackAttachmentInProgressUpdate()

12