Commit Graph

380 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
Anthony Lee ff52eef8e6 Revamp logging & remove the threading around downloads.
There is no need to launch a new AsyncTask around adding an
attachment to the queue of downloads. We can restore the attachment
in the worker thread of AttachmentService instead. Also reworked
the logging so we can trace the flow of the AttachmentService if
we need to debug again in the future.

Change-Id: I368ebb4322bc0af0f4cadedf102959d621e5ee80
2014-06-24 15:24:47 -07:00
Martin Hibdon fb2a3a2f77 Update IEmailService
This is not yet finalized, but it's needed to fix push syncs
on exchange.

Change-Id: Iaff20aa0bdea9685ef6603de1f861d58fbab6ff1
2014-06-18 14:19:34 -07:00
Anthony Lee 39e3bd63b5 Some more cleanup and code rearrangement & added unit tests
for ServiceCallback.

Change-Id: I6017e50455df3dda9ef6ec54ffd4fbc4e9b1a2d9
2014-06-05 14:57:44 -07:00
Martin Hibdon a6e65290be Merge "Change IEmailService.sync to have two different forms" into ub-mail-master 2014-05-30 22:15:54 +00:00
Martin Hibdon 163323294e Change IEmailService.sync to have two different forms
Change-Id: Id8e770154d6116b02746cbdfb8c7cdc9358398de
2014-05-30 14:49:47 -07:00
Anthony Lee e33511699a Cleanup of AttachmentService code and enabling of DownloadQueue.
Removed unused functions, 'final'ed variables and parameters,
revisited some thread synchronization. Effectively no new code
introduced so no unit tests for this CL.

Change-Id: I714724a98d31a231ab10b0ad468b8efaa460bd1d
2014-05-30 13:26:08 -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
Anthony Lee a72a12241f Factored out Watchdog code and cleaned up other stuff.
Moved testing code to the bottom of the file. The next CL
should be the removal of the DownloadSet. Also fixed b/15003801,
so that the test will not fail.

Change-Id: Ie8320782d6b292d5a367af95d7c58d70a4213ead
2014-05-20 15:11:03 -07:00
Anthony Lee 0e49862711 Introduction of DownloadQueue and associated tests.
Also a bit of cleanup around log tags and DownloadRequest.

Change-Id: I33221f099ed691e5258e1741cf0a63381404f520
2014-05-12 13:50:50 -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 84e010a463 Clean up logging
b/14590064

Change-Id: Ib841ebecae339690c143eaf356eced58d9ac5372
2014-05-06 11:22:10 -07:00
Anthony Lee cd2495ebdd Created the new AttachmentService class.
This is a straight up copy of the AttachmentDownloadService and
a rename. All the future Attachment work will be done in this
class and we'll flip the switch when it is ready.

Change-Id: I2990cbfd1f7c8e2946c155ea1c124223d0f47ff9
2014-04-29 11:20:40 -07:00
Tony Mantler 3dd85723a1 Cleanup in EmailContent
Change-Id: Ifa251eb206779f59ea003f99395d454c7e407bc2
2014-04-14 12:54:39 -07:00
Tony Mantler 84dfa15541 Fix IMAP attachment upsync for forwarded messages
b/13883967

Change-Id: I496663144c41fa6353883bb77fa35fb14d1cfa07
2014-04-07 16:26:04 -07:00
Martin Hibdon 7ea823327f Bound the number of headers we might try to fetch
b/13545303
Prior to this change, there is no bound on the number of message
headers we might try to fetch at the same time. Now, we fetch
headers in chunks of limited size.

Change-Id: I06db96eefa8732f970c31fc3617480de40723f2d
2014-04-03 14:23:47 -07:00
Martin Hibdon 0db900d622 Merge "Allow setting of the sync window for IMAP accounts" into ub-mail-algol 2014-04-01 19:54:31 +00:00
Martin Hibdon c0d94a44ea Allow setting of the sync window for IMAP accounts
b/13362667
Really this is just for testing, the only window setting
that has any affect is SYNC_WINDOW_ALL. At some point we
should revisit the imap sync window strategy, right now
we will sync up to the oldest message currently on the
device, which is potentially a large amount of data.

Change-Id: I00dd59bd084e85bdf80f3991062b84fcd6a12362
2014-04-01 12:17:34 -07:00
Anthony Lee b6125ae385 b/13659368. Ensure properly download status for attachments on failures.
The reason why the UI is wedged is becasue it doesn't
see a state transition in the status. So now we detect the situation
where the user is trying to download an ineligible file and force
the status to indicate that it was a failure to dismiss the UI and
to show the correct error message.

Change-Id: I9264966830a317724bf2fe469ae570860ba7c2a9
2014-03-31 13:21:28 -07:00
Martin Hibdon c7031638bd Minor formatting change
b/13642247

Change-Id: I02e495142d8043c8749ab0bce21f4c7c1cea7a5f
(cherry picked from commit 64b4f7dcff)
2014-03-27 21:30:37 +00:00
Martin Hibdon 23ff99df9d Merge "Fix IMAP message upsync to include attachments." into ub-mail-algol 2014-03-27 21:30:08 +00:00
Tony Mantler 38f9991634 Fix IMAP message upsync to include attachments.
b/13138456

Change-Id: If16b619a650c640a37cb4563750a6327a5e601e6
(cherry picked from commit 0c8696c2eb)
2014-03-27 21:23:32 +00:00
Martin Hibdon e5d754e16c Fix a NPE trying to download an attachment
b/13642247

Change-Id: I4cfb7e4a3be12fdc8b8c345c1aeabd85a729d16a
(cherry picked from commit adabb4285b)
2014-03-27 21:22:28 +00:00
Martin Hibdon 3021a60bc7 Merge "Only make Calendar and Contacts syncable on Exchange" into ub-mail-master 2014-03-20 19:57:05 +00:00
Martin Hibdon 6a51abdf6e Only make Calendar and Contacts syncable on Exchange
b/11818312
We were using the existance of OPTIONS_CALENDAR_SYNC in the
bundle to indicate that syncing was possible, and it's value
to indicate whether automatic syncing should be enabled.
This is misleading.
Now, we check the serviceInfo for the account type to figure
out if sync calendar and contacts is possible, and use the
options passed in to indicate whether or not it should be
automatic.

Change-Id: I776519668c6630dc71153fb008218a7ca6357c74
2014-03-20 12:47:36 -07:00
Yu Ping Hu 8103f960d0 Add sync to IEmailService.
This supports the EasService design.

Yes, I just removed a startSync function from this interface last month. No,
I didn't quite know at the time that I'd be adding one back. :)

Change-Id: I19d9c7838473d8982560764fdba0056cba03d132
(cherry picked from commit 4a5b11d650)
2014-03-20 00:11:36 +00:00
Anthony Lee 70cb2878d7 Changed the IEmailService interface to accept and accountId in
the loadAttachment() call. This work was necessary to support
the new EasService & EasOperation infrastructure.

Change-Id: Idd507aec999596ccd4afa5f03ff2b3c2e38a9029
(cherry picked from commit efac8255ed75d22e60036e19e7a95f8407d18ad3)
2014-03-19 23:53:28 +00:00
Yu Ping Hu 701134953e Add pushModify to IEmailService.
This call lets the service know that the push settings for an
account have changed.

Change-Id: I7ed41853df6af6762c80283a2a3510ce41551657
(cherry picked from commit 446136a2278652c627068ecddff534de1ad431ab)
2014-03-19 23:51:14 +00:00
Yu Ping Hu f679cd08d1 Delete unused functions from IEmailService.aidl.
Change-Id: I131d2d3436a50c94d664fc57c6514481d9afbc97
(cherry picked from commit 8ff6c107867bc2044ba50cad010dbf4a2e93436e)
2014-03-19 22:35:47 +00:00
Tony Mantler 53b64eee54 Skip protocol choice if user entered from system account manager
b/13475223

Change-Id: Id1ec6259e2b3880f9ce83ffe7795c40aa069466e
2014-03-14 15:48:10 -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 19b7e95d64 Use BroadcastReceiver to listen for LOCALE_CHANGED
Previously, we used the service to listen to Intent.ACTION_LOCALE_CHANGED.
This never worked because that intent is broadcasted by the system
and so Services will never receive them. Just use the existing forwarding
infrastructure to send the broadcast to the service.

Change-Id: I50ef625804e76e2348d3fe14686778d54463b78d
2014-03-04 15:55:52 -08:00
Tony Mantler 9e7b850595 Merge "Merge setup fragments under a single activity" into ub-mail-master 2014-02-28 17:11:38 +00:00
Tony Mantler 76472ae40c Merge setup fragments under a single activity
Change-Id: I10cf8bb9f6bc1a26ea97ae664f0196ae9e9493b5
2014-02-26 13:47:41 -08:00
Tony Mantler 220dc1bf57 Fix IMAP delete handling
When a message is flagged as deleted on the server, but is not yet purged,
we'll see it syncing down with a deleted flag. This change treats that
condition as if the message has been fully deleted.

Also fix a copy/paste error for cleaning up the message modification tables.

b/12367845
b/13137235

Change-Id: Ic741dedc10251775a7afdce171d59efbd2cf1a5f
2014-02-24 10:19:05 -08:00
Tony Mantler 426de73380 Fix unbounded async task creation in ADS
Queue operations through a single ConcurrentLinkedQueue and
service the updates on a single async task to avoid spamming the
async thread task queue.

b/11336926

Change-Id: I8e5c526d61f70fbad0ccef80afd08fc26bb5acf0
2014-02-19 09:48:58 -08:00
Martin Hibdon 155bc17928 Merge "Create AuthenticationFragment" into ub-mail-master 2014-01-29 19:23:26 +00:00
Martin Hibdon 9195a12024 Create AuthenticationFragment
This is one fragment that holds all types of
authentication information, e.g. password,
OAuth info, and client certificates. What gets
displayed depends upon the type of account it is
dealing with.
So far this is only used in AccountSetupIncoming,
but later it can be added to other settings fragments.
There are still some issues with this, but I'd like
to check it in sooner than later to unblock other
work.

Change-Id: Iea675ad5c1727f32ca0baa270dfa793ab7109993
2014-01-29 11:20:53 -08: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
Martin Hibdon 9fe8131c3f Fix a case that would leak connections if an exception happens
Change-Id: I9f50911344e04f22e15bf9ba0c95f4e1b1422923
2014-01-03 14:33:28 -08:00
Martin Hibdon ff1ee36cb5 Close Imap connections when we are done using them
Also, clean up when we create and lose track of ImapStores.
Prior to this we were creating them often, and losing track of them,
which renders useless a lot of the complex logic in ImapStore devoted
to reusing connections.

Change-Id: I771d4e46d0c1cb9b605c43d9cbae6e52f5894745
2014-01-03 14:01:04 -08:00
Tony Mantler 1644749d1b Merge "Clean up dead/weird code." into ub-mail-master 2013-12-09 18:22:08 +00:00
Tony Mantler 34662f11b2 Save policy when saving account
Also add a loader to AccountSecurity, and ignore when a policy contains unsupported requirements.

b/11790165

Change-Id: Idd651153848eea3216656047c5aba3bbd750ca0a
2013-11-27 14:42:49 -08:00
Tony Mantler 5ec2108cf0 Clean up dead/weird code.
Change-Id: I27da217fc919bee6804b12ee8ec5f5a78b1ee410
2013-11-22 10:36:09 -08:00
Tony Mantler 8196f82ce2 Use update notification intent to trigger notifications
This ensures the SuppressNotificationReceiver object quiesces the notification while we're viewing the folder

b/11789666

Change-Id: I98f388844b29458e7ea7deee398f7d8536b1919c
2013-11-21 13:18:57 -08:00
Yu Ping Hu bc8bc050b0 During upgrade, ignore protocols whose strings don't change.
Copied from https://googleplex-android-review.googlesource.com/#/c/389215/
in order to submit for ur10, also made a minor change to early out when
we know it's a no-op.

Bug: 11258856
Change-Id: I28415e97225a216c16abb6ad7c48a860c5370173
2013-11-14 18:19:12 -08:00
Martin Hibdon ad0e42887f Merge "Fix an infinitely retrying download problem" into jb-ub-mail-ur10 2013-11-12 19:28:59 +00:00