Commit Graph

36 Commits

Author SHA1 Message Date
Marc Blank e714bb9d15 Convert authorities, intents, and account manager types
* Tested ok on wiped Nexus
* Tested ok on S3
* Upgrade verified on Nexus

Change-Id: If5d4ce594f8a309cdb59589d10b1d33f3b79326c
2012-08-31 23:26:36 -07:00
Marc Blank f419287f22 DO NOT MERGE: Move emailcommon2 sources to emailcommon
Change-Id: I06df7e467cd2e0117df8b8db3ddc6ff9da13f1c7
2012-06-28 11:15:06 -07:00
Ben Komalo e36648697f Fix apk attachments so they can be installed
This introduces an in-memory cache of file paths for an attachment so
that we can install from a filepath instead of a content URI.
The cache also allows us to prevent duplicated files made if the user
hits save multiple times (the save button is disabled).

Bug: 3338997
Change-Id: I56651a55eef2f1a3f24b6d936c37736c4fc3d295
2011-04-21 12:07:32 -07:00
Marc Blank dc78a769fc Email split, part dix
* The coup de grĂ¢ce for Exchange in Email
* Remove Exchange bits from AndroidManifest
* Update Android.mk to create static jar for emailcommon
* Delete all com.android.exchange files
* Delete all exchange-only strings
* Change loadAttachment service method to take only attachment id and
  background flag
* Add code to AttachmentProvider.openFile() that opens an output file
  for attachment writes
* Make sure deviceId is determined in Email app (not Exchange)

Bug: 3442973
Change-Id: I775600252fd121f474d51cb26fefbfcc50e387af
2011-02-25 10:46:16 -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 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
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 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
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
Andy Stadler 86753bc41c Update file type acceptance rules
* Open up all types for view/save rules
* Add anti-malware block list (based on extensions)
* Clean up code that shows/hides view & save buttons
* Redo handling of load/cancel 1sec timer
* Unit test for new little utility
* Allow larger items when on wifi

Bug: 3338984
Bug: 3334950
Bug: 3338988
Bug: 3340835

Change-Id: I991135636d507f2660e2860720dbed21bd1a955b
2011-01-11 14:40:41 -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
Andy Stadler e29189e3ee Cleanups to Controller & AttachmentProvider
* New method in AttachmentProvider to delete all attachments for an
  account, and unit test it.
* New method in Controller to delete all synced data for an account,
  and unit test it.
* Fixed existing problem with Controller unit tests (needed cache clear)
* Fixed existing problems in Controller (mContext vs. mProviderContext)

Bug: 3197935
Change-Id: I79c6a03c21f18d37eeb8158cd1c2af0e0a6e9d2e
2010-11-30 12:11:36 -08:00
Andrew Stadler 625451ed25 Harden thumbnail creation
* Catch some errors earlier;  Log all errors.

Bug: 2905324
Change-Id: Icdf4ec881f404787a0621e606d7e611d5e50aab1
2010-09-22 09:22:15 -07:00
Makoto Onuki 6c36b4c613 Add shutdown() to providers.
They're needed for unit tests.
I was hoping this would solve some of the unit test issues, but it didn't look
like so.  But still they're nice to have.

Change-Id: Ibf6ae78055560d27aac5934d567a17084de99d84
2010-08-23 12:36:57 -07:00
Marc Blank 1ec89e6290 Fix AttachmentProvider to work properly w/ EmailProvider
* Apps trying to open attachments using AttachmentProvider were
  seeing SecurityExceptions due to the fact that internal calls
  from AttachmentProvider to EmailProvider didn't have their
  calling identity saved/restored.
* Updated provider calls so that these calls use the Email
  process' identity.

Bug: 2908737
Change-Id: Ifb71ad834530c6232728e1aad31439991f8ed379
2010-08-11 17:31:45 -07:00
Makoto Onuki 1d0be30871 Always use the mime-type "message/rfc822" for eml files.
Bug 2795919

Change-Id: Ie20fccdad34d7d17d7444af25d3e57033a45de5a
2010-06-29 10:40:31 -07:00
Andrew Stadler 80ebde2897 Better handling for untyped attachments
* IMAP/POP rely on sender to set mime type of attachments
* Which doesn't always work, because senders don't always provide it
* Remap using filename extensions, when needed
* This is applied as late as possible - in the MessageView, and in
  the content provider getType().  No changes to how we write databases,
  and no change to existing attachment rows.

Bug: 2356638
Change-Id: Ie69e3fd12f406aac803583f9d1299a8af4fba010
2010-04-30 15:01:10 -07:00
Mihai Preda 9ef6f645f5 Controller: modify the test for "attachment already loaded".
Bug 2192510.

update unit test.
2009-10-22 19:27:59 +02:00
Andrew Stadler 71754d3f94 Delete attachments when necessary, don't leak disk space
* Add AttachmentProvider.deleteAllMailboxAttachmentFiles
* Call it when server deletes a mailbox
* Confirmed (no change) all message deletes call deleteAllAttachmentFiles
* Unit tests of course :)

Bug # 2069004

Change-Id: I99731e6489fdca4cc9cebdff5fcf9c09d12b7b3a
2009-09-30 23:32:30 -07:00
Andrew Stadler 4b41bae270 Enable IMAP/POP sending and EAS resend
* Finish IMAP/POP sections of Controller.sendMessage
* Rewrite MessagingController.sendPendingMessagesSynchronous
* Add deleteAllAttachmentFiles to AttachmentProvider, and unit test
* Rework sendMessage callbacks and integrate into MessageList UI
* Send pending from UI

TODO:
* Find other places from which to call deleteAllAttachmentFiles
2009-08-20 11:09:39 -07:00
Andrew Stadler 3f1ac4da94 Add code to handle IMAP/POP attachments.
IMAP messages up to about 25k will be downloaded properly.

* Move Store->Provider message rewrite code to a separate utility.
* Add code to descend a Store message and write provider attachments.
* Unit test basic IMAP attachment handler

TODO:
* handle large IMAP messages.
* unit test for POP
* unit test for large IMAP messages
2009-08-11 15:08:14 -07:00
Andrew Stadler a98de7e55e Finish Attachment support for EAS accounts.
* Change service API to allow caller to supply complete target path/file
* Also allow caller to supply the final content_uri
* In MessageView, use full integration with EAS service API and
  attachments content provider to enable:
  * Save: Only works on SD card
  * View: Works w/o SD card using content provider & intents
  * Thumbnail previews
2009-07-27 19:52:21 -07:00
Andrew Stadler 3d25a519ab Convert AttachmentProvider to use new Provider db.
* Rewrite internals to use EmailProvider instead of raw db access
  * Minor changes to APIs as necessary (and scattered changes to follow)
  * Convert unit tests and check them
2009-07-27 15:52:42 -07:00
Andrew Stadler 301ac18bb7 Create tests and improve docs on AttachmentProvider
No change in functionality.  Just getting a test infrastructure in place
before rewriting to use new EmailProvider.  Provides tests for:

* get type (raw & thumb)
* open file (raw)
* open file (thumb)
* query
* resolveAttachmentIdToContentUri
2009-07-27 11:20:15 -07:00
Mihai Preda 94386cce2a am aeeefedb: Thumbnail cache file should be deleted when AttachmentProvider is created.
Merge commit 'aeeefedb43c40e887850654ac88270755f5631c1'

* commit 'aeeefedb43c40e887850654ac88270755f5631c1':
  Thumbnail cache file should be deleted when AttachmentProvider is created.
2009-06-16 16:43:07 -07:00
Mihai Preda aeeefedb43 Thumbnail cache file should be deleted when AttachmentProvider is created.
Integrates CL 149651 from p4 Docomo email.
Bug 1902523.
2009-06-15 18:35:38 -07:00
Marc Blank a290f503f1 Refactored EmailStore, EmailContent, EmailProvider
EmailStore goes away, replaced by EmailContent
All database activity is moved to EmailProvider
2009-06-15 14:49:11 -07:00
Andrew Stadler c0033f24a2 Convert remainder of app to use provider-based accounts
What works:
* Unit tests, except for com.android.email.activity.setup.*
* Editing existing accounts
* Create new accounts
* Checking account settings against server
* Mail sync using accounts
* Viewing mailboxes

What breaks (in approx order of planned fixes)
* Unit tests in com.android.email.activity.setup.*
* Viewing messages
* Composing messages
* Some details of account editing
* Import of existing accounts
2009-06-08 15:42:40 -07:00
Mihai Preda 7436601fae AI 149523: Correctly display inline images in Reply and Forward messages.
Integrates CL 148436, 148515, 148833 from imode email.
  BUG=1814789,1860250

Automated import of CL 149523
2009-06-03 06:44:47 -07:00
Mihai Preda 5182d80674 AI 149442: Integrate CL#140625 (Fix attachment uri and content uri confusion) from imode to donut.
BUG=1598754,1860250

Automated import of CL 149442
2009-06-01 11:28:33 -07:00
The Android Open Source Project 96c5af40d6 auto import from //depot/cupcake/@135843 2009-03-03 19:32:22 -08:00
The Android Open Source Project 8c2158a5eb auto import from //depot/cupcake/@135843 2009-03-03 18:28:50 -08:00
The Android Open Source Project 687f9962d7 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:56 -08:00
The Android Open Source Project 8978aac197 Initial Contribution 2008-10-21 07:00:00 -07:00