Commit Graph

203 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 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 9ba506c4dd Email split, part deux: PolicyService
* Split PolicySet from SecurityPolicy and move to emailcommon
* Define PolicyService that sync adapter services can use to
  interact with the Email DPM administrator
* Implement PolicyServiceProxy for exchange
* Implement PolicyService in email
* Modify imports, references, etc. as required

Bug: 3442973

Change-Id: I92015e21f780a68754b318da89fbb33570f334a2
2011-02-10 13:53:37 -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
Andy Stadler a0d080558f Properly handle unsupported encryption policy
* This fixes the case of:
  * a device that does *not* support device encryption
  * connecting to an account that *does* require device encryption
  * but also supports "non-provisioned devices" (making the encryption
    requirement optional.)
* Added unit test

Bug: 3367191
Change-Id: I894e68c4119a102dad02d2e0815fccdae1e87189
2011-01-19 11:40:48 -08:00
Marc Blank de196ca3da When syncing folders, read all data first, then process
Bug: 3353035

Change-Id: I80212b225eae48d0351f47f0d601f77578d2fc96
2011-01-14 17:58:15 -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 cbdd9f78b2 Distinguish mailbox requests that are user requested
Bug: 3251757
Change-Id: Ie417ebf44c8b740db88e5854077782930359a958
2010-12-31 11:02:03 -08:00
Marc Blank a4853b9a81 Revert "Workaround for improper timeout for Ping commands"
* The underlying bug was fixed by bdc in I080147b017b961502b3ba98d40841fea679491eb

This reverts commit 9166aa46da.

Change-Id: I51e7e585e7b1624cc2b08ea81baba6f2602a76cf
2010-12-03 11:42:43 -08:00
Marc Blank 09fb0ca0a9 Don't send CONNECTION_ERROR in reloadFolderList callbacks
Bug: 3249051
Change-Id: I4c06f59a644cce979c52e0578c025eb71c781fdc
2010-12-02 14:02:31 -08:00
Marc Blank 9166aa46da Workaround for improper timeout for Ping commands
* We're seeing our ping timeouts complete after 30 seconds (although
  set to 5-17 minutes), due to the fact that our reused sockets are
  not having their timeouts reset (i.e. they use the original value
  of 30 seconds from when the socket was first created)
* Until the underlying issue is resolved, we'll avoid reusing
  sockets for Ping commands

Bug: 3241899
Change-Id: I90b53c0d28b866a91507efafacbb3c4c0df2324c
2010-12-02 12:08:58 -08:00
Andy Stadler 1ca111c19c Add password expiration plumbing
* Set aggregated expiration values with DPM
* Fix min/max logic when aggregating, and fix unit test
* Add expiration tests when checking if policies are active
* Add expire-password to uses-policies set
* Handle password refresh (clear notifications and sec. holds)
* Handle password expiration (warning and/or wipe synced data)
* Unit tests for provider-level methods
* Refactor common security notification logic
* Placeholder notification strings (need final)

Bug: 3197935
Change-Id: Idf1975edd81dd7f55729156dc6b1002b7d09841f
2010-12-01 12:58:36 -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 1b6623b092 Make sure we send callbacks for UI requested syncs
* In the case in which a sync was requested during an already-running
  sync, we weren't passing the request information into the service

Bug: 3143544
Change-Id: I098161830844f604e4aa5b9c067491d2777d78c3
2010-11-29 11:32:04 -08:00
Marc Blank 7f35dd8da7 Use consumeContent() to ensure release of HttpClient resources
Bug: 3197531

Change-Id: I7376b438edb05411950249bbf34cffa3ad8cb5a7
2010-11-22 11:45:01 -08:00
Marc Blank cf3fb71bc6 Implement password expiration for EAS
* Hoist wipe() method from AbstractSyncParser to AbstractSyncAdapter
* Add deleteAccountPIMData(accountId) to the EmailService API
* Implement deleteAccountPIMData for EAS

Change-Id: I1037cde25fc2b24419f399446cfa0906dc0174d1
2010-11-22 11:17:00 -08:00
Marc Blank ec79508146 Revert "Reuse mailbox cursor unless boxes have changed"
This reverts commit 6c3fa18356.
2010-11-11 10:55:37 -08:00
Marc Blank 6c3fa18356 Reuse mailbox cursor unless boxes have changed
Change-Id: Ic91b1d7bd72e9faf04d3448c1e194663db2c889a
2010-11-08 12:51:55 -08:00
Marc Blank 12b398fac3 Send sync start/finish callbacks in pairs
Bug: 3143544
Change-Id: Ifb8c3c4c12e32df6a7d058446a0279c26048e0f3
2010-11-03 11:18:07 -07:00
Marc Blank ad5c2ac04b Only callback with sync error if sync was a service request
* EasSyncService was using the callback for all syncs, including
  those running in the background.  We really only want to report
  back when syncs initiated by Controller fail...

Bug: 2239661
Change-Id: I7c4aceb74fe94ca38f5bdbbabe5dda62ccac60ec
2010-10-26 13:11:12 -07:00
Marc Blank a8bb34fd62 Respect the RESPONSE_REQUESTED tag in meeting invite mail
Bug: 2639037
Change-Id: I4bd73f23ba270fa0ead72971b5a79d9db678a8dd
2010-10-19 14:23:54 -07:00
Marc Blank 3afa93c054 Fix remote wipe with mobile sync server
* It appears as if our running multiple sync threads can confuse the
  mobile sync server during a remote wipe (the server expects the next
  client response to be an acknowledgment, whereas it might well be
  a command or response from a different thread)
* To avoid this, we first put the account on security hold and then
  shut down all other sync threads for the account
* After this, we send the acknowledgment and the remote wipe proceeds
  normally.
* NOTE: It's possible that, due to the vagaries of multithreaded
  operation, one of the other syncing threads could still send a non-
  acknowledgment response to the server before our provisioning thread
  gets a chance to send its acknowledgment.  However, since the other
  syncing threads will terminate (and not restart, because of the hold),
  the provision/remote wipe/ack sequence will work on the subsequent
  attempt

Bug: 2844888
Change-Id: Ib4ffbbc67b681e69176b6c1d5515fa80c7d1e121
2010-10-10 16:40:12 -07:00
Marc Blank 0215d739d5 Make sure updatePolicies is always called during provisioning
Bug: 3055269
Change-Id: Ia266de108847923c01b5e0838a249aa9ee8f2d85
2010-10-08 12:56:14 -07:00
Marc Blank 47087049f0 Fix issue w/ duplicated messages after move (to trash/folder)
Bug: 2994014
Change-Id: Ia223447f799ebd6490da2dc5caf1d1270b446a44
2010-10-07 16:04:17 -07:00
Marc Blank 14a5d8d947 Provide better information w/ 500 error in EAS validation
* HTTP error 500 occurs with Exchange 2003 when the user tries to
  authenticate with wrong credentials; we report this as "Cannot
  connect to server", which is wrong
* Error 500 is supposed to mean "internal server error", but since
  we know that an authentication error can cause this, we now put
  up a better error message

Bug: 2933381
Change-Id: I9319a5ed6fbf4c92739f305b42b6b1cad7036a4b
2010-09-30 11:47:20 -07:00
Marc Blank 793c6639ec am 9b5c615c: am deed4505: Merge "Increase EAS command timeout from 20 to 30 seconds" into gingerbread
Merge commit '9b5c615ceea0270878a5b89fc0a063eeb9ffdd3e'

* commit '9b5c615ceea0270878a5b89fc0a063eeb9ffdd3e':
  Increase EAS command timeout from 20 to 30 seconds
2010-09-22 14:41:29 -07:00
Marc Blank 65a10186a5 Increase EAS command timeout from 20 to 30 seconds
Bug: 3027271
Change-Id: Ic58fea147d179ffd18f28a8ce5d290a1b37302ce
2010-09-22 12:45:48 -07:00
Marc Blank 77259fab1b DO NOT MERGE: Don't disable account box if sync freq -> "Never"
Bug: 2905667
Change-Id: Iec214b0fed093ff39dc70d5d821577bcf15f00ed
2010-09-21 15:25:27 -07:00
Marc Blank 75cfe25d3b Increase EmailServiceProxy timeout for validation attempts
* Use 90 seconds (instead of 45 seconds)

Bug: 3008626
Change-Id: I31258a5fbcca1f489c8bf6fb2ed8f3dcad5d2e26
2010-09-20 10:34:30 -07:00
Marc Blank 517c4f39b7 HTML support for EAS 2.5 email
* Load MIME data for these messages and parse, looking for a body either
  in HTML or plain text or both
* If the MIME data had been trunctated and we can't find text, mark the
  message as partially loaded and load the body text as we did before
  (i.e. get the plain text body); this should be a rare case

TODO: Consider what is testable in the new EmailSyncAdapter code

Change-Id: I00a3066a373a0596431335593de356a4dda7f036
2010-09-15 20:20:15 -07:00
Marc Blank 74444e73c2 Remove GAL lookup dependency on running ExchangeService
Change-Id: I4ff4017bcbb29862e07fde63e2ac01e3552ccd83
2010-09-15 17:57:03 -07:00
Marc Blank fa2386cb11 Don't disable account mailbox when sync freq -> "Never"
Bug: 2905667

Change-Id: I7052281a186534597702fa137a2ecfe8b1280575
2010-09-03 23:31:27 -07:00
Marc Blank 28ca167a89 Enforce a limit on GAL lookup responses
Change-Id: Id353758c1221d2f1097566e7becc8baacf7984d9
2010-09-02 11:20:42 -07:00
Marc Blank 03e3449c6b Change EAS User-Agent to a constant String
Change-Id: Ie1efcbc1666bd9bc759aca8134eba21cb9e2467b
2010-08-31 10:10:11 -07:00
Marc Blank ea0eedf2ce Add Android OS version to EAS User-Agent; update EAS version
Bug: 2953691

Change-Id: I2b2b16c7cb8950a644306b2aa25bcc53ab0c2731
2010-08-27 13:07:49 -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
Marc Blank 85cf69d371 Fix "move to folder" for both IMAP and EAS
* We were zero'ing the server id BEFORE the move, rather than
  afterward; this is fixed in the current CL

Change-Id: I4a5f2b2de5794a110a8f657c80dfeac4955b5909
2010-08-26 15:42:15 -07:00
Marc Blank d694a20849 EAS implementation of "move to folder"
* Handle errors cases appropriately

Change-Id: I16060cc5c4fc648c299a2fa8f9f57d9aa5c37f56
2010-08-26 13:19:05 -07: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 1f1be33191 am a95e40df: am 4f12c25e: am 05b0bb56: Release held mailboxes after policy refresh
Merge commit 'a95e40df2f4c6c17e53a438e1229199d823efca6'

* commit 'a95e40df2f4c6c17e53a438e1229199d823efca6':
  Release held mailboxes after policy refresh
2010-07-28 18:35:40 -07:00
Marc Blank 05b0bb5625 Release held mailboxes after policy refresh
* When a sync fails due to a provisioning error (on initial sync
  or after policies are refreshed on the server), sync mailboxes go
  into a "hold" state until the security error is resolved.  Meanwhile,
  the account mailbox handles provisioning.  If this is NOT successful,
  we put a hold on the account and go through the UI steps of setting
  up security on the device.  When this is done, we release the hold on
  the account, which releases the hold on the mailboxes.
* If provisioning IS successful, however, a refresh of the existing
  settings would be an example, we do NOT release the adapters, and
  this is the bug we're seeing.
* This CL simply causes any held mailboxes in a successfully provisioned
  to be released from the hold

Bug: 2865623
Change-Id: I59e780e9bd4ea908182b786dfd0e5851f5bf5f3b
2010-07-23 15:10:24 -07:00
Marc Blank cd0f12fda8 resolved conflicts for merge of 84f7d07d to master
Change-Id: I62abe3b8aa31a1b551d0396e184b648c305033ec
2010-07-14 23:12:20 -07:00
Marc Blank 8b36acb10d Backport: Handle "Allow non-provisionable devices" properly
* Backport from master branch
* Send policy key of "0" when validating; this gets us the policies
  even if "Allow..." is enabled (currently, we simply don't see the
  policies)
* If we don't support all of the policies, send back the response
  code indicating support for partial support.  If we get a positive
  response back, then we're good to go - the server allows devices
  with partial support.  Otherwise, we fail as we always have - with
  the toast indicating that the device doesn't support required
  policies
* Remove PolicySet.isSupported() and ensure proper field ranges
  within the constructor
* Update tests as appropriate

Bug: 2759782
Change-Id: Ida5663a9b35c75ecc61a5f442be0bd60b433cb73
2010-07-14 22:47:47 -07:00
Marc Blank e43b11ba3e Handle correction of rejected Ping heartbeat
* Handle status 5 for Ping command (heartbeat of out range)
* Write unit test for heartbeat reset

Bug: 2834195
Change-Id: Ic7952a4b296cf15c6ba895d6579fe7956b171e5b
2010-07-13 18:06:24 -07:00
Marc Blank 5bd2faee5e Preliminary GAL/Contacts integration for EAS
Change-Id: I9997ac96f83f427c71caf12d591ba6069bedf935
2010-06-29 11:49:04 -07:00
Marc Blank 51f5b2f3fa Fix problem with unencoded data in URI sent to EAS
* We need to encode the itemId and collectionId for SmartForward and
  SmartReply
* Add unit test for the fix
* Small change + test to EasSyncService usage of URI encoding to use
  a non-deprecated method

Bug: 2787725
Change-Id: I428b308b56cc359b8cdd9e42bc3f42c65b6797dc
2010-06-28 21:25:53 -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