Searched refs:attachment (Results 1 - 25 of 31) sorted by relevance

12

/packages/apps/UnifiedEmail/src/com/android/mail/compose/
H A DAttachmentsView.java96 * 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 DAttachmentComposeView.java34 * 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 DMailPhotoViewActivity.java147 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 DAttachmentTile.java43 * 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 DAttachmentTileGrid.java70 // 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 DThumbnailLoadTask.java53 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/Exchange/src/com/android/exchange/service/
H A DEasAttachmentLoader.java68 final Attachment attachment) {
70 mAttachment = attachment;
80 * Load an attachment from the Exchange server, and write it to the content provider.
82 * @param attachmentId The local id of the attachment (i.e. its id in the database).
87 final Attachment attachment = Attachment.restoreAttachmentWithId(context, attachmentId);
88 if (attachment == null) {
89 LogUtils.d(TAG, "Could not load attachment %d", attachmentId);
94 if (attachment.mLocation == null) {
100 final Account account = Account.restoreAccountWithId(context, attachment.mAccountKey);
102 LogUtils.d(TAG, "Attachment %d has bad account key %d", attachment
67 ProgressCallback(final IEmailServiceCallback callback, final Attachment attachment) argument
152 performServerRequest(final Attachment attachment) argument
203 finishLoadAttachment(final Attachment attachment, final File file) argument
223 handleResponse(final EasResponse resp, final Attachment attachment) argument
287 load(final Attachment attachment) argument
[all...]
/packages/apps/Email/tests/src/com/android/email/mail/transport/
H A DSmtpSenderUnitTests.java132 * Test: Open and send a single message with an empty attachment (no file) (sunny day)
144 // Creates an attachment with a bogus file (so we get headers only)
145 Attachment attachment = setupSimpleAttachment(mProviderContext, message.mId);
146 attachment.save(mProviderContext);
152 expectSimpleAttachment(mockTransport, attachment);
190 * Prepare to send a simple attachment
193 Attachment attachment = new Attachment();
194 attachment.mFileName = "the file.jpg";
195 attachment.mMimeType = "image/jpg";
196 attachment
209 expectSimpleAttachment(MockTransport mockTransport, Attachment attachment) argument
[all...]
/packages/apps/UnifiedEmail/src/com/android/mail/utils/
H A DAttachmentUtils.java83 * 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 DEmlAttachmentProvider.java54 * 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 DRfc822Output.java176 // 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/Email/emailcommon/src/com/android/emailcommon/utility/
H A DAttachmentUtilities.java128 * 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
155 * Return the filename for a given attachment. This should be used by any code that is
166 * Return the directory for a given attachment. This should be used by any code that is
202 * @return A likely mime type for the attachment
253 * Resolve attachment id to content URI. Returns the resolved content URI (from the attachment
282 * In support of deleting a message, find all attachments and delete associated attachment
384 saveAttachment(Context context, InputStream in, Attachment attachment) argument
[all...]
H A DUtility.java735 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/UnifiedEmail/src/com/android/mail/browse/
H A DAttachmentProgressDialogFragment.java32 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 DMessageAttachmentBar.java54 * 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 DAttachmentActionHandler.java46 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 DMessageFooterView.java110 // 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 DMessageAttachmentTile.java52 * 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/src/com/android/email/
H A DAttachmentInfo.java37 * 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 DUtilityMediumTests.java97 // We return false with null attachment
104 Attachment attachment = ProviderTestUtils.setupAttachment(message.mId, "filename.ext",
106 attachment.mContentBytes = null;
108 assertFalse(Utility.attachmentExists(mMockContext, attachment));
110 attachment.mContentBytes = new byte[0];
112 assertTrue(Utility.attachmentExists(mMockContext, attachment));
114 attachment.mContentBytes = null;
122 assertFalse(Utility.attachmentExists(mMockContext, attachment));
130 attachment.mContentUri = "file://" + file.getAbsolutePath();
132 assertTrue(Utility.attachmentExists(mMockContext, attachment));
[all...]
/packages/apps/Email/src/com/android/email/service/
H A DAttachmentDownloadService.java77 // 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 DEmailServiceStub.java193 //1. Check if the attachment is already here and return early in that case
194 Attachment attachment =
196 if (attachment == null) {
201 final long messageId = attachment.mMessageKey;
204 EmailContent.Message.restoreMessageWithId(mContext, attachment.mMessageKey);
212 if (Utility.attachmentExists(mContext, attachment)
213 && attachment.mUiState == UIProvider.AttachmentState.SAVED) {
256 // 3. Generate a shell message in which to retrieve the attachment,
257 // and a shell BodyPart for the attachment. Then glue them together.
260 storePart.setSize((int)attachment
[all...]
/packages/apps/Bluetooth/src/com/android/bluetooth/map/
H A DBluetoothMapAppParams.java99 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 DConversationListItem.java87 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 DLegacyConversionsTests.java230 Attachment attachment = Attachment.getContent(c, Attachment.class);
231 if ("100".equals(attachment.mLocation)) {
232 checkAttachment("attachment1Part", attachments.get(0), attachment,
234 } else if ("101".equals(attachment.mLocation)) {
235 checkAttachment("attachment2Part", attachments.get(1), attachment,
238 fail("Unexpected attachment with location " + attachment.mLocation);
247 * Test that only "attachment" or "inline" attachments are captured and added.
260 // 1. Standard attachment
265 "attachment;\
[all...]

Completed in 495 milliseconds

12