The last touched time will track the last time a message within that mailbox
was read. This will be used for the recent list.
Change-Id: I97a5fda52fd09b416fc3278a11a87b807da05c9c
The notification controller now observes changes to the account database and
adds or removes message observers as appropriate.
Change-Id: I1670fcfd6ce744030199b86708a6ada55b239a84
* Use EmailProvider to backup/restore into a backup database
* Remove all of the old AccountBackupRestore code
* Get rid of the legacy Account class and all of the Preferences
crap that referenced it
* Remove corresponding tests
Change-Id: I2de75aafdacc87246174303961e58547303f641e
In order to provide a bit more granularity for content observers, we add the
operation (e.g. "insert", "remove" or "update") as well as the id of the row
that has changed (if it's known).
Change-Id: I214d3c030872f888cde1a2db9b6b46f1bb121b7a
If we receive new messages, we may display a notification to the user. If
those same messages are read elsewhere (i.e. via a web client), we will
remove the notification.
Change-Id: Iba09afe01942e0deaac8210fd6f9b315b1c8c93f
* Replace crazy (and soon to be "full") bit fields stored in an account's
securityFlags with a row in a newly created Policy table (thus, fully
expandable)
* Update code from database version 17 to 18; adds Policy table, a
policyKey row in Account, and a revised trigger that deletes Policy
information for deleted Accounts
* Update old PolicySet unit tests to work against the new Policy class
* Add test for the conversion of securityFlags to Policy
* Tested in a variety of scenarios; appears to be functionally equivalent
Change-Id: I1505ee75230d6a0d3c2b62a46326f39c2c7f9eb5
We now create folder hierarcies for IMAP. This also includes a nifty SQL
statement that will get your existing database into shape.
Change-Id: If07a0632e9b250cf0c33c3e16bfba5816beab94c
* 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
* 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
* In query of an otherwise valid URI with -1 as an id, simply return
an empty cursor
* Add unit test to verify proper handling of invalid uri's
Bug: 3183245
Bug: 3292080
Change-Id: Ia0c35cbd0f5dd0dc4a8fc794226399644cf1fe13
* 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
This prevented EAS accounts from showing the new message notification,
because Account.newMessageCount in the cache didn't get updated
properly.
Bug 3249319
Change-Id: Id18fb94083e2f441c293414f790a26f82869e3da
* In this CL, we cache individual rows, based on the CONTENT_PROJECTION
defined for the most common queries (Account, HostAuth, Mailbox, and
Message)
* Queries on individual rows (most often Class.restoreClassById()) will
look to the cache first, rather than querying the database
* Queries on smaller projections will build MatrixCursor's from cached
data
* Write-through caching updates the cache with changed columns
* Experiments with live data indicate that > 95% of queries that are
cacheable (single row, no selection) can be retrieved from the cache,
thereby saving a great deal of disk access.
* Timing experiments show that cache hits are > 40x faster than cache
misses
* Unit tests for the various classes exist, with more coming
TODO
----
* More unit tests
Change-Id: I386a948a2f4cc02b6548d07d9b2fefd1e018a262
* Drag & Drop "move to folder" preliminary implementation
* Use "drag handle" button to initiate drag
* Use the message list item itself as the drag thumbnail for
one item; "Move N messages" for multiple (not implemented)
* Disable MailboxList update during drag
* Use ListView itself as drag/drop target
Bug: 3138004
Change-Id: I9243e4f583cf91caa1b9dd04fd64d52e8b28fa30
- Resetting the new message count is now correctly done on a BG thread.
- Added special content provider URI to reset the count.
(/resetNewMessageCount)
- This URI only supports update, which will notify only account
cursors.
- Fixed a problem that an insert with MAILBOX_ID/MESSAGE_ID/ACCOUNT_ID
triggers two notifications.
- This CL changes how we use notification URIs, but unfortunately
no tests for this part. It turned out MockContentResolver doesn't
support the notification mechanism, which made it very hard
to write tests.
Bug 2911646
Change-Id: I35b30a7e6bf2d57510486c7ed19b9f263d8c9b58
My previous CL broke some tests.
- make sure to set 0 to unreadCount when adding a new row
- when updating messageCount in the tests, directly manipulate
the DB. (the provider no longer allows this)
Change-Id: Ib569349707007badf4f23600fbca37110c78fa6d
- Don't allow manual modification of unreadCount/messageCount
(We used to check only unreadCount in update().)
- Do the integrity check at the very first in update().
I think the old place was really problematic because we opened
the database in a few lines above and kept it in a local variable.
Change-Id: I2bf5de4e4e45b40c11b951dd2255f8193c26f1aa
Added Email.DEBUG_THREAD_CHECK. If true, EmailProvider warns if certain
methods are called on the UI thread.
Change-Id: I6db9e45f2e449a31850c223fc9eec0fb9a575cb1
* Add 'snippet' column in Message table and handle upgrades to the
new schema
* Generate a snippet from either HTML or plain-text message body,
removing tags, extraneous whitespace, and other superfluous text
along the way. Store the snippet in the Message table
* Clean up MessagesAdapter to use the pre-existing list projection
and constants
* Write unit tests for snippet creation
* The UI in this CL is always single-line, ellipsized
TODO: Handle two-line subject if portrait and XL
Change-Id: I84a2cbe10957975942edad6eb1255a726924a78a
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
* 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
- Use trrigers to keep them up-to-date.
- Batch-update them upon upgrade.
- Motivation:
On the mailbox list, we show the number of messages in trash/drafts.
We currently do this with count(*) on the fly, which is okay
because MailboxList is really shown right now.
However, on the 2 pane, it's always shown and constantly refreshed,
so the use of count(*) can be a huge penalty.
It also make the code significantly simpler.
Change-Id: I26efa238d5183df43420a65925876248ef6c6cb6
- In memory attachments are now stored as byte[], not String.
We can store any type of contents now.
- Added blob content_bytes to the Attachment table.
The content field is now deprecated and not used.
- Explicitly convert ICS files to UTF-8.
- Added Utility.to/fromUtf8().
Bug 2509287
Change-Id: I3785a365a9a34039ec12ba82bd857dcdbc4de92d
* Added two columns to Attachment in EmailProvider
content: content that is written directly as an attachment
suppressDisposition: to suppress the content-disposition header
All meeting invitation emails use these two columns; the first
for ics attachment data (which is quite small, rarely over 1k),
and the second to indicate NOT sending the content-disposition
header; without this, Exchange will consider the ics as an
attachment rather than an iMIP style message (rfc2447)
* Modified tests to include these columns; added upgrade code for
new database version
* New columns and code are designed to be usable outside Exchange,
although there are no other clients of the code at this point.
* Modified Rfc822Output to use the content field, if present, in
lieu of retrieving attachment data via URL; added support for
suppressing the Content-Disposition header
* Added a meetingInfo column to the Message database
* When a meeting invite is received, the start time is stored here
in ms from start of epoch. Note that this field is defined to be
a String, for extensibility
* Update ProviderTests
Change-Id: If44892d27ccc5ebdc1f8667befafb8b8a27a2cf4
remove-exchange-support.sh makes it possible to build the email app without
exchange support.
This script:
- removes all packages under com.android.exchange.
- removes all lines surrounded by EXCHANGE-REMOVE-SECTION-START and
EXCHANGE-REMOVE-SECTION-END
And the resulting source should still build and run fine.
Bug: 2369784
Moved Eas.ACCOUNT_MANAGER_TYPE to Email.EXCHANGE_ACCOUNT_MANAGER_TYPE.
This constant is not related to the exchange protocol, and referred in
a lot of different places. Moving it out of the package will make it a lot
simpler when removing exchange dependency.
* Upgrade accounts table to add security column
* Read/Write new column
* Backup/Restore new column
* Unit tests for all of the above
* First cut at defining bitfields (non-binding, just putting down ideas)
Bug: 2387961
* Addresses #2226426
* If the user deletes Email data, or if data corruption causes
EmailProvider.db to be deleted, we will be in an inconsistent
state with any existing Exchange accounts, since the AccountManager
will still know about them, contacts (and eventually calendar) items will
continue to exist, etc.
* Run an integrity check when the provider is created, deleting any
orphaned EmailProvider.db or EmailProviderBody.db
* Catch SQLiteException's in the Provider and do an integrity check
if any is caught
Change-Id: I47d523b90a6b8f71ba8e13fba4b04846b3da1b1d
turns out the change I submitted before is not required at all. I mistakenly
assumed sqlite wouldn't be able to handle it. but tested it with the latest
version of sqlite 3.6.20. the old style triggers work fine.