Commit Graph

34 Commits

Author SHA1 Message Date
Marc Blank 3a5c1fb274 Email split, part neuf: Setup, logging, attachment glue
* Make "Exchange" option in account setup depend upon availability of the
  Exchange EmailService
* Make presence of Exchange logging depend upon availability of the
  Exchange EmailService
* Make AttachmentDownloadService use service rather than ExchangeService
  class
* Move SSLUtils to emailcommon/utility
* Move account manager type defs to emailcommon/AccountManagerTypes
* Update proguard.flags
* This is the penultimate CL for the Email package itself; the next CL
  creates a clean, SDK-compatible Email application

Bug: 3442973
Change-Id: I9162cf5fa6b5a043ded0fdd1e25fd3ce5948ad8f
2011-02-14 16:08:55 -08:00
Marc Blank 31d9acbf06 Email split, part huit: Refactor constants, clean emailcommon
* There are three pieces to this CL (sorry):
  1) Move and/or rename some constants into emailcommon
  2) Move Utility to emailcommon, moving the few UI
     related utilities back into Email (FolderProperties
     and UiUtilities)
  3) Remove all references to resources from emailcommon
* The three pieces relate in that, between them, they allow
  the emailcommon static library to compile cleanly

Bug: 3442973

Change-Id: Ic5e3abaa2a1b36999e0b6653c6c2134ea1bd544f
2011-02-14 12:18:10 -08:00
Marc Blank a7bc0319a7 Email split, part six: EmailContent
* Moved EmailContent to emailcommon

Change-Id: Ib3db1bfcfe74554c0e5afd3cfce6d72f26e9aeb9
2011-02-10 19:44:29 -08:00
Marc Blank 8a57469460 Email split, part trois: AccountService
* Create AccountService.aidl and AccountServiceProxy in emailcommon
* Implement AccountService in email
* Use AccountServiceProxy in Exchange for account reconciliation,
  notifications, etc.
* Move sync window constants into emailcommon
* Split attachment provider utilities and constants into emailcommon

Bug: 3442973
Change-Id: I89dce28b799b193243c07774dab65d830ae62775
2011-02-10 14:32:01 -08:00
Marc Blank 0d4fc55861 Email split, part one: EmailService
* Create emailcommon package
* Move EmailService classes to emailcommon package
* Change references to aidl's to emailcommon package
* Add getApiLevel() command to EmailService

Bug: 3442973

Change-Id: Ic7d2115363cdff6ebb86c46650b0a5b2109b1c72
2011-02-10 13:10:38 -08:00
Makoto Onuki 9c44430690 Fix AttachmentDownloadService for remove-exchange script
Now the source at least compiles fine.

Change-Id: I329ad08f81fd6ab23f28dd30023fe3e781ccc4fc
2011-01-28 11:22:51 -08:00
Marc Blank ed9938cd9c Protect against threading issues in AttachmentDownloadService
Bug: 3391148
Change-Id: I513b5678815db262ea5660661336432f1e203c9e
2011-01-26 16:04:28 -08:00
Makoto Onuki 2d0e44f201 Fix NPE in AttachmentDownloadService
Initialize mConnectivityManager before starting the thread.

Bug 3389701

Change-Id: If616721ad3b3bec81c5d6920f4a5d91b06f937fb
2011-01-25 15:30:15 -08:00
Marc Blank 3ef8f54bae Prefetch respects "background data" setting and waits for connectivity
Bug: 3384997
Bug: 3384994
Change-Id: Id8338650b69666f2996837324e27c2e98c9261fe
2011-01-24 18:39:50 -08:00
Todd Kennedy 751e4b2d95 Prevent auto-download of attachments not in an inbox
When creating the list of attachments to be automatically downloaded in the
background, exclude any attachments that are not in an inbox. Also added unit
tests to ensure the query URIs behave as expected.

NOTE: This is a partial fix for general background attachment downloading issues

bug 3373982

Change-Id: I13ef56cd280c028fa966ab9e655acce28b0b9b91
2011-01-24 13:43:14 -08:00
Todd Kennedy 819db01ead Limit attachment background download attempts
Do not retry downloading attachments infinitely. After some number of failures,
black list the attachment and move on. The black list is not persisted, so,
restarting the app will again try to fetch the attachments. In this way, any
transient network failures will not permanently affect the ability to download
attachments in the background

NOTE: This is a partial fix for general background attachment downloading issues

bug 3373982

Change-Id: I7f3ad9667ebebb95fbba95278b62bf40c5fce67c
2011-01-24 10:19:46 -08:00
Todd Kennedy f92dd2bf3e Don't display toast for background download failures
When downloading attachments in the background, do not display any errors
on the display.

NOTE: This is a partial fix for general background attachment downloading issues

bug 3373982

Change-Id: I874ed902bde293303e10308f38b992b2bb15b6aa
2011-01-21 15:17:29 -08:00
Marc Blank 2ac1833943 Delete attachment if there's no corresponding message
Bug: 3372440
Change-Id: I5c3653c5f27e0aa7bab52ca0d979e14bb6bafc34
2011-01-20 20:32:56 -08:00
Marc Blank 475c20d3a8 Implement checks before performing background attachment download
Bug: 3339007
Change-Id: I36a8359f3478c37b2ccd6a0cf0381569c592061a
2011-01-19 19:20:38 -08:00
Makoto Onuki 36cc9c18ed Fix NPE in AttachmentDownloadServiceTests.testDownloadSet
Bug 3353834

Change-Id: I5cf475ff174bffce80a435c80b1fd85c0be146e9
2011-01-14 11:47:26 -08:00
Marc Blank f6fe21b483 Merge "Check download request before trying to remove it from the queue" into honeycomb 2011-01-11 13:22:39 -08:00
Marc Blank 782c21e953 Check download request before trying to remove it from the queue
Bug: 3312633
Change-Id: I443d9a8f786f93c7cd72b6b96ea838bf0d05f4d4
2011-01-11 11:45:36 -08:00
Marc Blank 33799ad2d0 Remove STOPSHIP from AttachmentDownloadService
Bug: 3335071
Change-Id: Ia6a8e2e7378510db234c4ec5164cb5ef39c529d7
2011-01-09 18:30:24 -08:00
Marc Blank 7fbcefff7d Respect user's background download preference
Bug: 3312462
Change-Id: Ibd77b8de8782c4681ed122ac2f30374ca695e0ef
2010-12-30 00:05:15 -08:00
Marc Blank edb05ca5ee Harden AttachmentDownloadService; fix storage calculation
Bug: 3292720
Bug: 3286634

Change-Id: I378aac369ee8317c0c41b1f021a3731b81bcb380
2010-12-17 11:28:18 -08:00
Marc Blank 75a873be84 Implement prefetch of IMAP/EAS attachments
* Load attachments in the background for IMAP/EAS messages
* Download an attachment from account X if:
  1) 25% of total storage free
  2) Attachments for X use < 1/N of 25% of total storage, where N is
     the number of AccountManager accounts
* Add accountKey to Attachment table for performance

Change-Id: I913aa710f34f48fcc4210ddf77393ab38323fe59
2010-12-13 15:32:57 -08:00
Marc Blank 69fc25244b Move download cancel logic into helper
Bug: 3255707
Change-Id: I7f92bd1bb90a4430426123551075746ba9d4af85
2010-12-08 16:57:59 -08:00
Marc Blank 3bbc690600 Add watchdog to AttachmentDownloadService
* Detect attachment downloads that have stalled and restart them
* Catch a couple of cases in which we weren't sending callbacks

Bug: 3122242

Change-Id: Id2bfd3b26182004b301cf8665f4feb6e62b98b73
2010-11-30 10:16:05 -08:00
Marc Blank fdc41d4ffc Delay appearance of "stop" button when loading attachments
Bug: 3082804
Change-Id: Ib8b0fcec36a7303b2094bd0e49645d11aa2ff2db
2010-11-01 13:48:53 -07:00
Marc Blank b961c78ff4 Harden AttachmentDownloadService
* It's possible that endDownload will be called for a request
  that has been dequeued.
* Harden endDownload against this eventuality, so that we clean
  up properly without throwing exceptions

Bug: 3142618
Change-Id: If61136ed1ea972248fc5f9388beaaf84754f9931
2010-10-28 17:21:28 -07:00
Marc Blank eed42e83ab Cleanup for dump() in AttachmentDownloadService
Change-Id: Id875d3278953ecb3a98ab8b1d290f3883e974c4f
2010-10-27 08:59:13 -07:00
Marc Blank d3e4f3ca7e Use notifications for login failures
* For now, clicking on the notification takes the user to the
  Welcome activity, as we don't have final flows for the new
  account setup UI
* Need comment on strings; the problem is that notification
  text must be rather short if we're to use the standard
  notification display.  It looks like newer UI will allow
  3 lines instead of 2, however.
* Tested w/ IMAP, POP3, EAS, and SMTP

Bug: 2322253
Change-Id: I7ed6fa5599179870cbcdb14af062e956eff37ec5
2010-10-27 08:56:37 -07:00
Marc Blank a162668f23 Add dump of AttachmentDownloadService
* Will be helpful for debugging our new background service

Change-Id: Ia865c7c6cb418bd1a1f3d593421b98664c041e07
2010-10-22 16:57:05 -07:00
Makoto Onuki 899c5b8661 Switch to tablet style notification
- Now we show separate notification for each account
- New notification has sender photo, sender name, and subject
  of the latest email
- Added the NotificationController class, which is intended to manage
  all notifications besides "new message" eventually.

The framework doesn't seem to be 100% ready, and it's not clear how to
add the 3rd line in the expanded notification at this point.  Need to
revisit it later to verify UI details.

Change-Id: I40193ee372cb6b2b7245c1588890f238b2469699
2010-09-29 18:35:17 -07:00
Marc Blank 64b64cca01 Rename SyncManager to ExchangeService
* Updated comments and checked for 100-columns

Change-Id: I4ab5aaa9425714f8e035e1952db3fec63d498ae1
2010-08-27 12:15:56 -07:00
Makoto Onuki 45f530ba55 Integrate Controller w/ AttachmentDownloadService
* Add ControllerService to Controller and call this from
  AttachmentDownloadService to handle attachment loading

(It's a redo of I3a6c2a40.  Submitting for mlbank, who had a trouble
with repo.)

Change-Id: I7c90761ec4e213d6dc331fc894c7b77e84ad43a6
2010-08-24 11:14:57 -07:00
Marc Blank f19f9cf4d3 Simplify AttachmentDownloadService; add unit tests
* Changed our queue from a TreeMap to a TreeSet that uses an easily
  testable comparator
* Remove the ugly bit twiddling priority computation
* Test DownloadSet (the logic behind queue ordering, addition,
  removal, query, etc.)

Change-Id: Ia8427900b8f39a243a5407349775802d0a4fad4f
2010-08-23 11:42:40 -07:00
Marc Blank 7894ee82b3 New attachment download support for Controller (IMAP/POP3)
* Supports download via AttachmentDownloadService

Change-Id: I66143a79b99dcdbd307524ba0b81227f09a00e4a
2010-08-19 15:44:44 -07:00
Marc Blank 09fd4d0a18 New asynchronous attachment loading code
* Create AttachmentDownloadService to manage all attachment downloads
  1) User requested
  2) Required for email forwarding
  3) Opportunistic downloads to enhance offline use
* New attachment related UI (pending UX approval, of course)
  1) MessageView (attachment actions, progress bar, etc.)
  2) MessageCompose (attachments for forwarded messages)
  3) Associated toasts, notifications, etc.

TODO:
* Unit tests
* Cache Management (separate CL)

Change-Id: I7864a5fb1c3f4f2be68d98341a971edc6cbacfe1
2010-08-19 14:01:08 -07:00