Commit Graph

25 Commits

Author SHA1 Message Date
Marc Blank
2193962ca2 Email split, part quatre: Move along, nothing to see here
* No code was harmed, er, changed in the making of this CL
* All that's happened is that code that is needed by both Email and
  Exchange have been moved into emailcommon
* This required import changes to many files, which explains the
  length of the CL

Change-Id: I4e12455ba057a4a8054fdbd0b578c73afa411c8a
2011-02-10 16:28:37 -08:00
Marc Blank
e6027c46f7 More correct fix for EAS message list callback issue (3251757)
Bug: 3251757

Change-Id: I879a97e343e9522c7c11e10a1bdd3915fc6dbaac
2010-12-31 12:48:35 -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
2027b29d40 Change EAS request implementation to use LinkedBlockingQueue
* Make sure that requests added during sync() aren't missed

Change-Id: I20a7788f3695ef6a99642240230f0d004f034f44
2010-08-24 08:41:08 -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
Marc Blank
d6d874f8c6 Streamline security setup flow
* The setup flow is changed such that the user is asked to activate
  device administration before leaving the setup flow, rather than
  having to wait for the notification to appear, etc.
* Accounts requiring security are created in a security hold state
  to prevent initial sync until device administration is active

Change-Id: I7e33cf98466370ae27414b99018f7aee71e9e237
2010-06-25 09:32:11 -07:00
Marc Blank
da71abeb8f Improve sync thread alerting mechanism
* When a sync thread triggers an alarm by failing to return from
  an HttpPost beyond the socket timeout, we call abort() on the
  HttpPost to force it to stop
* It appears that there are cases in which this is insufficient,
  and the thread remains hung in a blocked state
* The result of this failure is to prevent the syncing mailbox from
  ever syncing again, and is typically seen by a failure to receive
  new mail (as reported in the referenced bug)
* In this CL, we add code to wait for 10 seconds after calling the
  abort() method.  If the HttpPost is still hung, we interrupt() the
  thread, and have SyncManager release the Mailbox, so that another
  thread can be started.

Bug: 2615293
Change-Id: I6a48195fc68bb950126006326a5b30448d3bbb63
2010-04-26 07:06:56 -07:00
Marc Blank
99feed44ec Stop pings when other syncs in the same account start
* When a mailbox syncs, pings should be aborted, or they appear to
  end up timing out with a stale connection (observation from logs)
* The result of timing out is lack of push until the heartbeat time
  has elapsed and our alarm triggers
* Also refactor code; some of the names of methods was unfortunate
  and these methods were being used in this CL

Bug: 2492848
Change-Id: Ib626a5d3cf6d2c61e3b11f4886a3fedbf9727bfa
2010-03-05 17:33:22 -08:00
Marc Blank
09b45fdcff Additional work on EAS security
* Add more final plumbing for exchange security
* If policies are supported, we now check to see if they are active;
  if so, we acknowledge this to the server, after which we are given a
  final policy key which can be used for syncing

Change-Id: I5992c790294e35b5ec5343c7665e2e7fd31a75ca
2010-02-07 13:28:18 -08:00
Marc Blank
5de54008e5 Handle Exchange meeting invitation responses
* Includes some refactoring of internal "request" code in SyncManager
* Adds Message flags to tag meeting invites and cancellations
* Adds meetingResponse method in EmailService
* Hooks into Controller and MessageView UI included

Change-Id: I4c5e10bccc4b41956b94d9dfa55925e5af030939
2010-01-26 09:08:52 -08:00
Marc Blank
1d98989222 Implement SmartReply/SmartForward for EAS; fixes #2098779
* SmartForward and SmartReply are EAS commands that automatically
  include the original message and, if a forward, all original
  attachments, regardless of whether they've been downloaded to
  the device
* Both commands improve battery life by sending less data; greatly
  so for SmartForward if there are attachments

Change-Id: I12432cd5275a3b54e9a80d5cd59da437c4a086cc
2009-09-14 15:47:38 -07:00
Marc Blank
cef2344e70 Rework EAS account creation & ssl operation
* Fixes 2048663, 2025029, and 2100131
* Add "Trust Certificates" checkbox in EAS account creation
* Use custom ClientConnectionManager for HttpClient with registry
  for plain, ssl, and tssl (trusted ssl) connection
* Use a ConnectionPool for HttpClient connections
* Remove "Domain" checkbox in  EAS account creation
* Remove tests related to the "Domain" field
* TODO Write a test for valid usernames (requires a bit of research)
  <name>, <email address>, <domain>/<name, and <domain>\<name> are all
  valid, but there might be others

Change-Id: I4a0338df5960bfd3d679a88aaf22d1c49f49992b
2009-09-09 10:32:06 -07:00
Marc Blank
0cbdba8d62 Fix a few sync-related bugs:
* Don't leak the receiver registered by AccountManager for updates
* Only restart dead threads if they aren't logged in the syncErrorMap
  (to prevent looping behavior as seen in bug #2072456

Change-Id: Id1b4c53ef8b721bf8bfa8426627fd76831864c70
2009-08-23 10:53:53 -07:00
Marc Blank
f2113c1dcf Make sure we log exceptions in FileLogger 2009-08-18 13:53:38 -07:00
Marc Blank
6b52af214c Implement adaptive ping timeout; release wake lock waiting for connectivity
* Remove unused/duplicated classes (e.g. Base64, WbxmlSerializer, etc.)
* Code cleanup in AbstractSyncService, EasSyncService
* Remove last references to HttpURLConnection (using HttpClient now)
2009-08-16 16:40:42 -07:00
Marc Blank
1ba0fd37a1 Cleanup; delete unused files, change log statements
* Two files were unused and therefore deleted
* userLog was changed to avoid using string concatentation until the logging
  decision is made
2009-08-13 11:30:39 -07:00
Marc Blank
bd4d30f522 Push fallback per mailbox, rather than for entire account
* Also cleanup code, add comments, remove unused methods
2009-08-10 17:05:31 -07:00
Marc Blank
cc402e42ab Clear error states on network reconnect; add temporary notifications; see details
* When we get a network connect broadcast, clear error states so sync can
  restart for any boxes in an error state
* Add temporary notification code for the testers
* Add file-based debug logger
* Add Exchange logging to debug screen (adds additional exchange debugging)
* Add Exchange sd card logging to debug screen (logs to sd card)
* Change setLogging service API to send an int rather than a boolean
* Make sure push mailboxes are set up again when account changes to push
* Make sure push mailboxes are set up again when account mailbox starts
* (Fixed contacts sync bug found during debugging these changes)
2009-08-09 21:20:47 -07:00
Marc Blank
1795efacc5 Use wake locks in running syncs; clean up associated code 2009-08-08 18:59:33 -07:00
Marc Blank
b9d6ba11c7 Fix various problems related to synchronization, reload folder list, etc.
* The reloadFolderList service call mustn't reset the account mailbox if the foler
  list has never synced
* Be careful to not commit anything after a mailbox has been stopped
* Be careful to synchronize before checking the stopped state of a mailbox
2009-08-07 12:17:23 -07:00
Marc Blank
9b598924ec Try to work around the "ping loop" problem in some Exchange 2003 servers
* First try reloading the folder list; this can sometimes work
* Otherwise, change push to 5 minute sync
* Send notification if we switch to 5 minute sync so there are no surprises
* Added syncStatus column to EmailProvider (can be used for any purpose)
* Use syncStatus to keep track of sync type, result type, and change count;
  detect ping loop as consecutive ping's with no changes
* Remove InteractiveSyncService (no longer needed)
2009-08-06 20:51:54 -07:00
Marc Blank
f00dccd321 Massive reworking of EAS serialization; much smaller and faster now
* Remove all use of Strings in favor of the parser's static final int's
* Strings remain in Tags for debugging output only
* Renamed lots of classes to be more consistent
* Centralized logging behavior in Eas class
* Found and fixed some bugs in the process:
  - Account deletion wasn't removing HostAuth's correctly in the trigger
  - Adding a second EAS account was trashing the first one
  - Fixed looping sync behavior caused by Exchange 2003 bug
2009-08-01 17:55:15 -07:00
Marc Blank
7375d950e4 Move to single EmailContent file; fix bug #1998157 2009-07-23 16:24:48 -07:00
Marc Blank
976f92908d Add support for attachments in EmailProvider and (preliminary) EAS
* EmailProvider now saves Attachment records atomically with Message (and Body,
  of course) if an ArrayList is stored in mAttachments
* Update EAS code to support attachment discovery
* Update EAS code to support attachment download via service API (preliminary)
* Add test for atomic attachment save
* Add test for unique file creation (external)
2009-07-16 00:01:57 -07:00
Marc Blank
b6493a07ef Major refactor and cleanup of EAS code
* Rewrote push logic to encompass multiple folders (i.e. calendar/contacts)
    * Change inbox from push frequency to ping frequency after initial sync
    * Implement upsync logic for email (i.e. sending changes to the server)
    * Did cleanup of some files (there's still some to do) re: format, style
    * Initial one-way sync of Contacts data - add and delete are implemented
    * Created adapter package for all parts of the EAS adapter
    * Created utility package for utility code that will eventually be merged
      with code in the Email application (Base64, QuotedPrintable, etc.)
    * SyncManager/AbstractSyncService can be used in the future for other
      protocols, especially IMAP push
2009-07-07 00:30:24 -07:00