Commit Graph

506 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
Todd Kennedy 32311cce01 Implement IMAP prefix support
We support two different ways for an IMAP prefix to be specified:
  1. A text field on the IMAP configuration page. This is the most obvious to
     the end user. It is also an explicit, manual configuration.
  2. RFC2342 defines a NAMESPACE IMAP command to be able to query the prefix
     from the IMAP server. This is an automatic configuration without any
     user involvement (i.e. the UI will NOT change if a prefix is loaded in
     this way)

If the user goes to the trouble of specifying a prefix, we will always honour
it instead of the namespace returned by the IMAP server -- even if the user's
configuration is wrong.

bug 1592696

Change-Id: I6b94c7aaac538f6cd9dc4694b0f1634e8c956bc1
2011-02-11 14:17:48 -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 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 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
Todd Kennedy 34e487594d Remove unused import for Log class
Change-Id: I5edb48c11bde8d0785dd6e1857a04949ea122a46
2011-02-08 15:04:40 -08:00
Todd Kennedy 8cc2fc5101 Merge "Fix attachment mime type unit tests" 2011-02-08 14:32:22 -08:00
Makoto Onuki 314a51cb1d Refactoring widget
- Moved to com.android.email.widget
- Extracted nested classes to top-level classes
- Some small clean-ups.
- WidgetProvider and WidgetProvider$WidgetService are left in the original
  package to keep compatibility with honeycomb (3.0) release.

This CL is supposed to be pure-refactoring.  There should be no
functionality changes.

Change-Id: I37acaa24b6b488724750c0f33374b31fcc433f11
2011-02-08 13:10:42 -08:00
Todd Kennedy 8586532f3e Fix attachment mime type unit tests
Attachments with no extension and mime type of text/plain need to return the
mime type of "text/plain" instead of "application/octet-stream"

bug 3428076

Change-Id: I00452c908ac0672879d42f4ed9ee574e376eac9f
2011-02-08 09:51:16 -08:00
Todd Kennedy 6e4df4de7a Merge "Fix mailbox adapter & message order manager unit tests" 2011-02-07 15:43:34 -08:00
Todd Kennedy bddc4e87ef Fix mailbox adapter & message order manager unit tests
* the new mailbox queries will only catch message that are
"loaded"; by default, messages were created "unloaded", so,
the query was returning 0 results

* extra parens were removed from the query string; the text
needed to be updated to not check for the extra parens

bug 3428077

Change-Id: Iea5867e741b9673985ca020aa3a8425c061324bf
2011-02-07 15:07:55 -08:00
Todd Kennedy 43a85091e9 Fix inbox query unit tests
The new query will only select attachments if their associated message is in
the loaded state. The unit tests need to add the messages to the loaded state.

bug 3428076

Change-Id: Ib4ad8b2570a2cdc042b932b10dbaa3170ab825cd
2011-02-07 14:57:30 -08:00
Andy Stadler 7d51b7a05b Remove all compatibility with pre-2.0 data
* Remove LocalStore (pre-2.0 mail database) and its unit test
* Remove UpgradeAccounts (converted pre-2.0 accounts to Provider)
* Remove FolderMessageList (receiver for pre-1.6 desktop shortcuts)
* Remove "upgrading" paths through LegacyConversions
* Clip out dangling references to everything above

Bug: 3292310
Change-Id: I5654d55a0879b00b05b63055b94651855a8ee3ef
2011-02-06 00:54:39 -08:00
Todd Kennedy 5e39f90e9d Resolve build warnings; part 4
Fix unchecked warnings

Change-Id: I872740fca4e5050e6ed2922eabc7e46e5e97ff3c
2011-02-03 12:44:24 -08:00
Todd Kennedy 8546e21e1e Resolve build warnings; part 2
Change-Id: I76c1a5a4f759071f92eef0574abb20a99bfb32b7
2011-02-03 11:46:40 -08:00
Jesse Wilson 3aee641aab Use a field rather than a superclass for ContentCache's cache.
This makes it easier for cache experiments to swap out the
LinkedHashMap for another cache.

http://b/3184897
Change-Id: Iacdb266e41f5a98efd9bb30bc09ff8fff5a0a5a9
2011-02-02 12:11:17 -08:00
Makoto Onuki 978e75ee90 Merge "Message details: Show only one address per line" 2011-01-31 16:15:08 -08:00
Makoto Onuki 812c43295c Merge "Unit test for change Ieec04881 (make sure CC is visible)" 2011-01-31 16:13:37 -08:00
Makoto Onuki f33420e68f Message details: Show only one address per line
Also removed unused field from MessageViewMessageDetailsDialog

Bug 3372971

Change-Id: I8a6d87d006793c0099b380634217624bf9002ead
2011-01-31 16:12:53 -08:00
Makoto Onuki 7c1fa2c161 Unit test for change Ieec04881 (make sure CC is visible)
Change-Id: Ic6ffbddf80dcbfe39e55d9b579316767a0ff1180
2011-01-31 15:42:58 -08:00
Andy Stadler 11070a5397 am 275b89d9: am 927dbc7c: Don\'t send IMAP ID unless server supports it
* commit '275b89d96949de6544c7bca999e241f659cf18b3':
  Don't send IMAP ID unless server supports it
2011-01-31 15:20:01 -08:00
Andy Stadler 927dbc7c20 Don't send IMAP ID unless server supports it
Only send IMAP ID to servers that include ID in the CAPABILITY response.
Always sending IMAP ID was found to cause problems with some servers.

Better compliance with RFC 2971.
Thanks to Samsung for debugging & reporting this.

Change-Id: I495f80949f9f811470853a1f2f8e506d8236d8cf
2011-01-31 15:10:49 -08:00
Andy Stadler 0e3a03317b Widget: Max out message count at 999+
Bug 3403158

Change-Id: I1daf0c62684bad83a69e19c39ffe1b8df899d077
2011-01-30 11:45:33 -08:00
Makoto Onuki 199a0601ae Merge "Fix bug where mailbox list won't update in combined view" into honeycomb 2011-01-26 17:31: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 d0ee1e404d Fix bug where mailbox list won't update in combined view
The problem was that CombinedMailboxesLoader used the cursor returned by
super.loadInBackground() (which contains accounts), to build a matrix
cursor (which contains special mailboxes and accounts and will be returned),
and *it closed the first cursor* after building the matrix cursor.

However, because this first cursor is the one that CursorLoader sets an
observer, it shouldn't be closed until the returned matix cursor closes.
In other words the two cursors should have the same lifecycle.

Fixed it by using ClosingMatrixCursor that used by AccountsLoader, which
is doing a similar thing, but properly.

Bug 3387730

Change-Id: I554ade001dc25afa869eefb4dcf9887495e6753e
2011-01-26 13:40:53 -08:00
Todd Kennedy adbd22c9be Merge "Infer attachment's mime type if it's text/plain" into honeycomb 2011-01-25 10:36:36 -08:00
Todd Kennedy b3740d227e Merge "Only show loaded messages in widget" into honeycomb 2011-01-25 10:06:51 -08:00
Todd Kennedy 34212cc7df Infer attachment's mime type if it's text/plain
If the server reports an attachment's mime type as either text/plain or
application/octet-stream, we will try to infer the real mime type using
the attachment's extension. If one cannot be found, we either synthesize
it (if original mime type is application-octet-stream), or, we use the
server specified mime type (if the original is text/plain).

bug 3379416

Change-Id: I331e767ed36e4e17756025cc816bdb7b5a8f0868
2011-01-25 09:55:15 -08:00
Todd Kennedy 543953ad87 Only show loaded messages in widget
The various selection strings were missing a test to only show messages that
have been loaded. This is only important for POP3 accounts.

bug 3377041

Change-Id: I3efe366d09dd547878dc0bf57dff58f76de5cca9
2011-01-25 09:42:04 -08:00
Andy Stadler 9128217da1 Merge forward small bug found in password storage
While fixing bug 2981433 in Gingerbread, I discovered one additional
place where passwords were being trimmed.  This brings the fix forward
into honeycomb, as well as a new unit test for the fix.

Bug: 2981433
Change-Id: I566f5c0c6693ca7c0069bca9e74f320fca48e600
2011-01-24 20:13:11 -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
Makoto Onuki 6833fd5ab6 AttachmentProvider: Always return mime-types in lowercase
Intent-filter's mime-type matching is case-sensitive.  We should always use
lowercase letters.

Bug 3375709

Change-Id: Idd4abb41f94c816a5b9150aef5859dd75487a042
2011-01-21 14:56:01 -08:00
Makoto Onuki 7093746dd5 Don't modify content URI to non-email providers
The "?limit=" param is only supported by EmailProvider, so don't add
it to other URIs.

Doing so causes a permission error when opening an EML attachment on gmail,
because we're granted the permission only to the passed URI, but not to
the URI with the "?limit=" param.

Bug 3371630

Change-Id: I88fff88a7e48e5bc958124eedec3e592978a40c7
2011-01-20 16:28:36 -08:00
Marc Blank 6c9911e3fb Merge "Strip content of the "head" tag" into honeycomb 2011-01-20 14:38:26 -08:00
Marc Blank 9dc8ba5cad Strip content of the "head" tag
Bug: 3285281
Change-Id: I1183697ad09fbf8740e3529fecfa59cf6650b2f9
2011-01-20 14:31:09 -08:00
Todd Kennedy 02ba344cf2 Only show messages from inbox for account & unread views
Use a sub-selection to limit the messages from the inbox. Also add a unit
test to ensure the selections are working correctly.

bug 3368613

Change-Id: Ia24ef6028ded27c69f982ecbc6b67f35f84d1b6d
2011-01-20 13:20:12 -08:00
Andy Stadler be6910e7a4 Merge "Properly handle unsupported encryption policy" into honeycomb 2011-01-19 12:01:56 -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
Todd Kennedy 3db3e4b795 widget combined inbox view only shows messages in inbox
instead of showing all messages (e.g. messages in drafts, etc...) the "combined
inbox" view now only messages in the inbox folder. This is now identical to
the "combined inbox" view available in the full email UI.

bug 3368613

Change-Id: I0080b56cd2718a3dce82b279277c63c4f43e86dc
2011-01-19 11:27:41 -08:00
Marc Blank 0324017aa0 Fix another case of HTML leakage in snippets
* Add test for this case

Bug: 3285281
Change-Id: If45d33624ac5dbd16d28b45428be29e5a8c51046
2011-01-19 10:59:29 -08:00
Andy Stadler 946239e8a0 Add per-account preference for bkgnd attachments
* Add flag to Account record
* Add checkbox to Account Settings (IMAP & EAS)
* Add checkbox to Account Setup (IMAP & EAS)
* Add flag to backup/restore logic
* Update Account & AccountSetupOptions unit tests

Bug: 3360873
Change-Id: I0c407776ede4110f33716644f6f027938f21130a
2011-01-18 10:53:37 -08:00
Makoto Onuki c50b6f685b Use broadcast to detect system account update.
Instead of AccountsUpdatedListener.

Bug 3211657

Change-Id: I1e60092fc06fe80b9914ff7264c24fcbfa950745
2011-01-17 11:03:57 -08:00
Makoto Onuki ad8c6c2e60 Merge "Fix LocalStoreUnitTests" into honeycomb 2011-01-17 10:37:57 -08:00
Makoto Onuki 36f2088408 Fix LocalStoreUnitTests
The problem was that we tried to upgrade the db by re-creating a LocalStore,
without closing the existing connection.  The db was still upgraded on the
filesystem, but the old connection kept looking at the old table definition
for whatever reason.

Also cleaned up checkAllTablesFound().  It now shows what columns are
missing when failed.

Bug 3349973

Change-Id: I80f4c67f1bd61cd5e1f12a632978b36a6e0a3b19
2011-01-14 14:36:01 -08:00
Makoto Onuki 31d263d38c Fix UtilityMediumTests
Bug 3353967

Change-Id: I7cdac5f6d4f3008c7ceaf9a8f0520524c9ea16f5
2011-01-14 13:04:19 -08:00
Makoto Onuki d072f9905d Don't show trashed messages in Starred mailbox
Also show the *total* starred message count (excluding trashed starred)
in the mailbox list, not *per-account* starred count.

Bug 3346872
Bug 2149412

Change-Id: I2274f215f994b62280ac6138982b927cec22c677
2011-01-13 15:41:22 -08:00