Commit Graph

552 Commits

Author SHA1 Message Date
Anthony Lee 3d16e5d4b9 Move over to the new AttachmentService.
Change-Id: I4a687b003884ea6a92a755fcbf394001bfc96a38
2014-06-25 09:56:29 -07:00
Tony Mantler 5f24f6f2e5 Merge "Return settings fragment class for account" into ub-mail-master 2014-06-23 21:44:43 +00:00
Tony Mantler 2eecdd1a50 Don't leak cursors
b/15830514

Change-Id: I91f452fc7c14a076d7f9078ec066215b28ddc3c3
2014-06-23 13:38:22 -07:00
Tony Mantler 876c8e1408 Return settings fragment class for account
b/9566150

Change-Id: Ia88f09d651284ff8f25a1784dc9a93ee30e6ea52
2014-06-20 14:32:15 -07:00
Paul Westbrook 4038f464de Enable supression of combined account
This enables the client of the provider to suppress the email combined
account.  Later, the UI can enable a combined account that spans all of
the account types

Change-Id: I77e201f751019240af2274a1f74e2124b9889aab
2014-06-20 00:09:07 -07:00
Tony Mantler c8d8a8445e Listen for relevant shared preferences changes
b/9566150

Change-Id: If6005de568330d12e2838220b815467d58276d71
2014-06-16 13:30:25 -07:00
Tony Mantler 988ad6e002 Move all general prefs values to UnifiedEmail
b/9566150

Change-Id: Id7058586c71c3c1cc4933dc28532a02df90c29bc
2014-06-12 16:23:52 -07:00
Alan Lau 8183be889f am 9773c96d: Return the order key in the conversation cursor.
* commit '9773c96d83f126b8418b192bcf46f939f44fdb44':
  Return the order key in the conversation cursor.
2014-06-12 17:11:50 +00:00
Alan Lau 9773c96d83 Return the order key in the conversation cursor.
For Email the order key is the message timestamp, Gmail sortMessageId.  The
order key is then used as the sort key for notificatin api, and because it is
stable, notification bridger can avoid bridging duplicate notifications and
reodering the email card bundle on the watch.

Bug 15563260

Change-Id: Ie68f45de91cc42c58238b7cdc0ae828048e22a46
2014-06-11 16:16:41 -07:00
Tony Mantler 51af59fc66 Remove unused preferences and dead code
Change-Id: Ica8bd735a91417ed44bd547ab7176832745d729e
2014-06-10 11:29:17 -07:00
Martin Hibdon 92a059ece4 Merge "Revert "Get rid of deleteAccountPIMData from IEmailService"" into ub-mail-master 2014-05-21 20:43:10 +00:00
Martin Hibdon c5f5a14ae9 Revert "Get rid of deleteAccountPIMData from IEmailService"
This reverts commit cf2178c4fa.

Change-Id: I9b05dd7a29a2d2edf64529ca28e2305737a43115
2014-05-21 20:41:37 +00:00
Martin Hibdon 9598c1e817 Merge "Get rid of deleteAccountPIMData from IEmailService" into ub-mail-master 2014-05-21 20:31:08 +00:00
Martin Hibdon cf2178c4fa Get rid of deleteAccountPIMData from IEmailService
This doesn't need to be part of the service because the
implementation doesn't need to be different between any
of the different protocols.

Change-Id: Ifddf16dd3ccaf397029f08f6d4283d9a5630f717
2014-05-21 12:18:29 -07:00
James Lemieux 837aba39d5 Sanitize HTML email bodies in Android Email
b/14567151

Sanitizes HTML email bodies on demand as they are requested from
EmailMessageCursor. Also alters Account settings to indicate that emails can be
assumed to be sanitized and transform scripts can be applied to the email
bodies.

Change-Id: I789e6de3569ae8c7d2c21f0b5aa590d7638a1467
2014-05-20 16:26:58 -07:00
Tony Mantler c1265d2090 Merge "Move email bodies to files" into ub-mail-master 2014-05-15 16:43:00 +00:00
James Lemieux b3db04b80b Stop EmailProvider from zealously and uselessly notifying of changes
EmailConversationCursor eagerly marks all messages in the current mailbox
as being seen. Most of the time it is a redundant operation, but nothing
prevents the provider from broadcasting notifications and all of the
observers from dutifully reacting to the notification. A good deal of
work is avoided now that we only notify when rows in our database have
actually been altered.

Change-Id: Ie91e6aebaf9c2899510f3818586d582073954d16
2014-05-14 15:38:35 -07:00
Tony Mantler 82a207132b Move account backup/restore to userdata in AccountManager
Change-Id: Iea9f2a1b1f2d87e07d63cbb1df5a0d6355ea4031
2014-05-14 15:15:49 -07:00
Tony Mantler 7525feb244 Move email bodies to files
Change-Id: Icfd0c4ab2ad25cc02b45cf41e7a205c17948ef2c
2014-05-14 13:27:49 -07:00
Tony Mantler e8a3c14f28 Fix URI comparison
b/14914981

The framework may make copies of the URI objects before they're passed in,
so we should use .equals() instead of pointer equality.

Change-Id: Ia443e96c81d53829ac6cfce70cebc098861f1c78
2014-05-14 11:32:20 -07:00
Tony Mantler 2f288864b6 Fetch email bodies using ContentResolver#openInputStream
This brings us further along the path to storing email bodies
outside of the database.

Change-Id: I96296114ade0d561df724878ed92999306bcd176
2014-05-08 15:50:57 -07:00
Tony Mantler 91e8e6f709 Null check EmailServiceInfo
b/14567915

Change-Id: I4780835a7f195f1a825a1538f9f1b939e2be4214
2014-05-05 13:59:39 -07:00
Tony Mantler 4db2d1cf74 Escape string values passed into SQL
b/14562987

Change-Id: Ibefd8d1d7418fffe4467abdae0cf978228d303a0
2014-05-05 10:51:44 -07:00
Tony Mantler f837c474a4 resolved conflicts for merge of 0d7c7091 to ub-mail-master
Change-Id: Id754089f16146daf0c07f77208d55c2406c997c5
2014-05-01 15:27:21 -07:00
Tony Mantler 0d7c709125 Always return a valid Uri for account inbox
Also don't return virtual folders unless real folders exist

b/14319452

Change-Id: Id5f62f5ccc4d5488ae467df741b0598a158ceb81
2014-05-01 15:05:15 -07:00
James Lemieux 8cfbfb50bb Inline images are not displayed for IMAP and POP emails
b/11998344

This solution covers these use cases:

1) Inline images in the Email app.
2) Inline images in .eml attachments in the Email and Gmail apps.

The solution here was to override shouldInterceptRequest(...) in
the WebViewClients and resolve any cid urls that are encountered
within the email body.

EmailProvider and EmlAttachmentProvider both gained the ability to
query for an Attachment object using a message ID and cid (which
is stored in the database column: contentId).

With this new query in place, it was straightforward to fetch the
Attachment in the WebViewClient and then obtain an InputStream to
the file that backs the Attachment to return back to the WebView.

Change-Id: I865a74fc291915c0d66a7492763a5f5682365b92
2014-04-22 11:29:19 -07:00
Andrew Sapperstein 592a85d97d am 1bb18931: Send PLID with message instead of conversation.
* commit '1bb18931e29dfe55a9b3368bd2393ac57c5fdebb':
  Send PLID with message instead of conversation.
2014-04-17 17:20:04 +00:00
Tony Mantler 9caaebb142 Bypass the cursor completely when passing message within EmailContent contexts
We should investigate using PFDs when passing to the UI layer too, for consistency

Change-Id: I21ad1987926b93af20287ae8e49bfc7a4ad99570
2014-04-16 16:49:29 -07:00
Andrew Sapperstein 1bb18931e2 Send PLID with message instead of conversation.
Fixes b/13748439. Sending with conversation required
server-side changes and wasn't actually more memory efficient.
Arguably it would be less efficient.

Change-Id: I8e1be03e183c65e169da5152a4763d5f80460bb9
2014-04-16 11:48:59 -07:00
Tony Mantler f678a18b69 Bypass the cursor window for email bodies
b/11787468

Change-Id: Iba5faa5b825357144d07ec4dfcf010c6af50496d
2014-04-15 15:18:17 -07:00
Tony Mantler 3dd85723a1 Cleanup in EmailContent
Change-Id: Ifa251eb206779f59ea003f99395d454c7e407bc2
2014-04-14 12:54:39 -07:00
Tony Mantler e8c4c22268 Enable Empty Trash in Email
Add markContentsSeen() and emptyFolder() to EmailConversationCursor.
Add 'purge folder' URI for delete() call in EmailProvider.

Change-Id: I2f65f877f8f4e8376eb5c2149b5051931c2ac083
2014-04-10 12:06:43 -07:00
Tony Mantler 0053401d07 Move EmailConversationCursor out of EmailProvider
Also tidy warnings in EmailProvider

Change-Id: Ib41011cc4b43adf0272be22bc7c054a99ff58309
2014-04-09 14:20:08 -07:00
Tony Mantler 2aeb498d4e Fix attachment loading for messages which have been forwarded
These attachments have a contentUri where the attachment ID is not equal
to the ID of the actual attachment.

b/13900073

Change-Id: Ic62b8165be2e80bc47eac40dc9eb5ac53c3cd6c5
2014-04-08 14:18:56 -07:00
James Lemieux f456b4f9d4 Merge "Show "To:<Names>" in sent and outbox index views" into ub-mail-algol 2014-03-31 21:11:40 +00:00
James Lemieux 974ccb1735 Fix an out-of-date comment.
The code related to the comment didn't ship as part of Kitkat MR2 and instead will go out with the platform L release.

Change-Id: Ib9ece3390005b5b0217e0c5540322802b1c096ad
2014-03-31 21:09:51 +00:00
James Lemieux 469c426376 Show "To:<Names>" in sent and outbox index views
b/13304929

The solution being delivered introduces a new folder capability:
UIProvider.FolderCapabilities.SHOW_RECIPIENTS which indicates a folder
should display "To: " in front of its participants list because it
is a folder containing outgoing mail or sent mail (thus viewing
recipients is more useful than senders). This capability is returned
for Drafts, Sent, and Outbox.

Note that extra work was required to make this function properly in
the widget we export to the launcher. See BaseWidgetProvider and
friends for details.

Change-Id: Ie7b077b8dd8934182de5e94a90fa163e8105faac
2014-03-31 12:35:15 -07:00
James Lemieux 5057d6dffb Replying to a Message with an encoded email address shows the encoded address in the to field.
b/11658428

As per Yu Ping's advice, we alter the storage of all email addresses (from, to, cc, bcc and
replyto) to be stored in *decoded* format within our database. This makes them both human
readable when inspecting the database manually and alleviates the need to repeatedly decode
them before they are displayed anywhere in our UI layers.

As part of this bugfix, I resurrected several tests related to the LegacyConversions class out of
LegacyConversionsTests and into a new (not Suppressed) test class: LegacyConversionsTest

Change-Id: Ie2e3264646e25c08c4ba74f60b3e1090c052e6c6
2014-03-27 23:25:53 +00:00
Anthony Lee a68ab80305 b/13659097. Disable EAS Policy max attachment size from EmailProvider.
Disable the code that translates the max attachment size column of
our db to the EmailProvider max attachment size column. They mean
different things as our max attachment size column refers to the max
size of any file that we can download where the EmailProvider's version
represents the max attachment size of a file that we can upload.

Change-Id: I93202766d7b1782c902f17ce20b2823aaf647ec4
2014-03-27 11:37:41 -07:00
Martin Hibdon 3f4a556d54 Fix Calendar and Contacts syncing for POP and IMAP accounts
b/11818312

Change-Id: I34b82040991506bf9099cc0df237454a8f97c764
2014-03-24 17:17:05 -07:00
Anthony Lee eba80c114e b/9564335. Add support for a maxAttachmentSize column in the Account
table and connect the data to the Settings object in the existing
location (SettingsColumns.MAX_ATTACHMENT_SIZE).

Change-Id: Iaf48995757511e1dfb65aa35ff6d81bbc47187bd

Conflicts:
	src/com/android/email/provider/DBHelper.java
2014-03-19 17:33:29 -07:00
Andrew Sapperstein 98ade11ad6 Merge "Send empty data for permalink/clipped fields." into ub-mail-master 2014-03-14 22:16:38 +00:00
James Lemieux 31ce5555b8 Move Help & feedback to Nav drawer.
b/11061485

HELP and SEND FEEDBACK are now the two bottom-most drawer
items in the Navigation drawer when it is present or in
the overflow menu when it is not present.

SEND FEEDBACK still behaves as always.

HELP has been redesigned so that it displays the help
content in a local webview rather than using an external
browser.

Change-Id: I01003f3cd6f8dedbcfb95ae87872968dfc6be48b
2014-03-12 16:56:56 -07:00
Andrew Sapperstein 07d674f9fe Send empty data for permalink/clipped fields.
b/2887917

Change-Id: I08e0317d3350732c6de9569d67d9a39b1a9ebf2e
2014-03-11 14:30:14 -07:00
James Lemieux 0dffe3afd7 Keep on getting a couldn't sign-in notification
b/11551107

This is caused by ImapConnection.doLogin() only throwing
AuthenticationFailedExceptions and not other varieties of exceptions.

While fixing this bug, I discovered that the ConversationListFooterView
that is displayed in response to a authentication failure contains a
button called "Sign In" that didn't actually do anything. I made it
navigate to the incoming account settings fragment where the user is
free to change the relevant account credentials.

Change-Id: I2c772ecab18f3e57059eceeae01de08f1fdab4c2
2014-03-07 16:38:47 -08:00
Andrew Sapperstein 803631497c Support display of chevrons in Email. b/7961430.
Change-Id: I6e19d4a942539f63b9503e1036761758715d3558
2014-03-06 21:46:24 -08:00
James Lemieux 6f4a9eb876 Mail in Sent, Drafts and Outbox should show addressees, not sender.
b/10847599

This is the second attempt at fixing this bug. The strategy has
changed entirely to accommodate GMail as well as reuse formatting
rules that squish the list of conversation participants into an
abbreviated line for display in conversation lists.

ConversationInfo used to include a List<MessageInfo> which was
used to answer questions about which senders had read which
messages in the thread. This has been removed and replaced with a
List<ParticipantInfo>. The backend should populate that list with
appropriate conversation participants (e.g. recipients of the last
message in the case of Sent, Drafts or Outbox; senders for all
other mailbox types)

Change-Id: I32dcc2a255cccaf06c5976633380b2443729f357
2014-02-05 16:00:58 -08:00
James Lemieux 8a41d9fd10 Merge "Eliminate redundant methods in Address class" into ub-mail-master 2014-01-30 19:08:04 +00:00
James Lemieux 1988228999 Hardware Search button doesn't work
b/11689324

In Jelly Bean, the hardware button has been redirected to always open Google Now by default. But
Email does run on Ice Cream Sandwich and on that platform the hardware search button should invoke
a local search of Email. The issue at play here was that IMAP accounts weren't reporting themselves
as being capable of a remote server search, even though they are in practice. Adjusting this
capability fixes the issue.

Change-Id: I829d08d3bb9c8d09beacc85fe8b5903a8565d178
2014-01-28 11:10:05 -08:00
James Lemieux 1fa303478c Eliminate redundant methods in Address class
THIS DOES NOT CHANGE ANY EXISTING FUNCTIONALITY.

Address.pack() has been removed and all calls replaced with its synonym Address.toHeader().
Address.unpack() has been renamed to Address.fromHeader() to follow the new naming convention.

In days of yore, pack() and toHeader() used to do different things. Now they are identical and
thus one is superfluous. We have standardized on toHeader() and fromHeader().

Change-Id: Iac91c966eb6c1477f8dba0dd2ae01c84b359e539
2014-01-22 16:15:57 -08:00