- Added accountId to loadAttachmentCallback/loadMessageForViewCallback
- Cleaned up LegacyListener/MessagingListener.
Removed the constructors which take messageId and attachmentId, which
are used to bridge loadAttachmentProgress, which the callsite doesn't know
these IDs. The inconsistency (only loadAttachmentProgress() uses the member
messageId) doesn't look too good, so extracted this into a separate class,
MessageRetrievalListenerBridge.
Change-Id: I46303e50df2b0e1fe8616e7c9cef632ac14f23aa
* 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
- Show email address
- Show inbox unread message count
Initially I thought of using a join to get accounts with their unread
counts with one query, but there were enough subtle issues that I gave up
on the idea.
Instead it uses a MatrixCursor to build a completely new cursor,
based on a regular accounts cursor.
Change-Id: I09e8762f131cc2bd3637e1a3d302088a3b5b2479
Filter out non-incoming messages using a subquery.
(because the message table doen't have the mailbox type.)
I was initially thinking of adding a new content URL for
the message table joined with the mailbox table, but it turned out
to be a bit of pain, so ended up using a subquery.
(one of the problems was that both tables had the "_id" field.)
Bug 3177220
Change-Id: I276efb70db1589835f3ddb8c7da4773e72d8691b
* 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
We're getting an NPE in restoreMessageWithId(EmailContent.java:670)
called from MessageFileViewFragment.openMessageSync().
However, there're only two things that can be null in this line,
context and context.getContentResolver(), and either one really
can't be null. Add explicit null checks to investigate what's going
on.
Bug 3134403
Change-Id: I463b039b6afeda32729f7e6a93edfdb9abf12093
- Don't show combined mailboxes with regular mailboxes in the mailbox list.
- Add "Combined view" to the account selector instead.
- "Combined view" has all the combined mailboxes and accounts.
- Renambed these combined boxes. (e.g. "Combined inbox" -> "Inbox")
- Regular account view still has "Starred" mailbox, but it's actually
"combined" and not per-account.
- Re-order special mailboxes per latest wireframe.
Bug 3138004
Change-Id: I4c5860c6774b10c55ba0ca599373e51105432cf8
I should have been used the one without default in the main code,
which uses the other one (with a default), so both can safely be used
in tests.
Bug 3107191
Change-Id: I2011d96f6824a1a6e99e81f5c8e60c966a444d92
Added the "Include text" checkbox according to the latest mock.
Before:
- We removed original message when the user pressed X.
Now:
- We save the original message all the way till the draft is sent.
- The "Include text" check state is saved in the db. (to Message.mFlags)
Bug 3072414
Change-Id: Ie7bcca23bb6a02d676700027b0b6cb94b6627236
Moved the buttons to the header. All other buttons below the message view
go away, so I just hid the old buttons.
Also now we stop trying to hide these buttons when entering contextual mode,
which fixes bug 3044284: Message view buttons get disabled when closing
quick contact
Assets were temporarily copied from gmail.
Change-Id: Ib178c6221dfab02832a10d0c0441044e4969fb70
- Now we show separate notification for each account
- New notification has sender photo, sender name, and subject
of the latest email
- Added the NotificationController class, which is intended to manage
all notifications besides "new message" eventually.
The framework doesn't seem to be 100% ready, and it's not clear how to
add the 3rd line in the expanded notification at this point. Need to
revisit it later to verify UI details.
Change-Id: I40193ee372cb6b2b7245c1588890f238b2469699
Make sure not to cast null into a primitive type.
(i.e. If null isn't expected as a return value, make sure to set a non-null
default value.)
Bug 3032143
Change-Id: I9a344d765c75a66f529ad8d99b00b2b919139f9c
* If a type 1 folder has an mail folder as a parent (at any level),
it is also a mail folder (and therefore, we should have it in our
folder list)
* Before rejecting type 1 folders, look for parents and accept those
that are mail folders
* Add unit test to verify logic
Bug: 2978410
Change-Id: I44cda1d1c1fd7f3976af53a1672736201cc995ff
- 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
* 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
* UI is still temporary
* In this version, we check if the selected messages can be moved *after*
you click "Move", rather than disabling the button beforehand.
Change-Id: Ief2864d2a513001847844963b2b0cb6b714e8667
* Now it'll refresh mailbox list (left pane) as well.
(With the minimal interval of 30 seconds)
* Always refresh inbox.
(also with the minimal interval of 10 seconds)
* Also make sure the "auto-refresh" won't refresh
non-refreshable mailboxes. (drafts, etc)
Bug 2929889
Bug 2930018
Change-Id: I09452d40aad6008a721cfbc3f491617224d7048f
isEasAccount now uses getProtocol(), so it works even if the hostauth
hasn't been restored yet.
Bug 2929896
Change-Id: Iee902c18ef59680d8a7d4622230489ec7946f38c
* 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
Fix for crashes caused by an incomplete account
which typically a crashed unit test leaves behind.
- "Delete account" now works for incomplete accounts
- AccountBackupRestore won't crash.
Change-Id: Ie235aa15cf9b970fd184c60f14406aa7353c6f00
- 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
- Added unit tests
- I see the "open a cursor, move to the first row, read a column" pattern over
and over. Added a utility method for this. (Let's try not to bloat the
binary by copying code around!)
- Added helper classes for database related tests
- Removed code dup
Change-Id: I380959215cc1661b252158f0f6e35369b499cdf8
* Use the new Account.getProtocol() method to determine whether an
Account "isMessagingController" (i.e. uses the legacy controller)
* Cache the result of this test, so that it's only done once per
Account
* Add unit test
Change-Id: I6a0ec789a84bdf30b55156e6337a627fb4e81a08
* Minimum complex characters
* Password history (i.e. disallow re-use of past n passwords)
* Password expiration
* Password expiration is NOT yet supported in the framework; there
is a TODO in this CL and a trivial change will be needed when
support arrives; for now, we report this as unsupported
* The two implemented policies are testable
Change-Id: I477adbc000577c57d1ab1788378c97a60018c10c
* Add intent filter for application/eml and message/rfc822 mime types,
launching MessageView with a Uri
* Modify loadMessageTask to handle the Uri by parsing the attachment's
input stream with Pop3Message.parse(), and then creating an
EmailProvider message in a special Mailbox created to hold
"attachment" messages
* Delete all "attachment" messages after the parent message is closed
* Add unit tests
Change-Id: I20276ee006b9f05b889f3c808d3dc407cde26d49
A desktop shortcut to an account created on donut or before points at
com.android.email/.activity.FolderMessageList, which we've already removed.
- Added a dummy FolderMessageList to receive it and redirect to MessageList.
- Removed FolderMessageListUnitTests, which was left unremoved.
Bug 2535335
Change-Id: Ie5ffa158882633a4929c4c47a3d9625fd1626863
* Add "vibrate when silent" choice in UI
* Add storage for it in Email's provider. Existing accounts default to
their current settings (always vibrate / never vibrate).
* Respect new mode when notifications are posted
* Updated existing unit tests
Bug: 2457183
Change-Id: I5c933ac39dbef8b2028255f330e0b084a445421a
* Turns out that Exchange 2003 requires the ics attachment to be in a
multipart/alternative, rather than a multipart/mixed MIME message
* Exchange 2007 accepts both types
* Therefore, we change our output for this particular situation, i.e.
a single attachment that is an ics file, to multipart/alternative
* Rename FLAG_SUPPRESS_CONTENT_DISPOSITION to FLAG_ICS_ALTERNATIVE_PART
and make this flag do double duty - 1) suppress the Content-Disposition
header (also required by Exchange) and 2) send the message as
multipart/alternative
* Add unit tests for Rfc822Output to check that mime parts are composed
properly
Bug: 2516394
Change-Id: I60e26f57b8ecaf01d0340e7828533334e0e7d45a
- 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
If the account specified with an Intent doesn't exist, show the Welcome
activity instead, which will navigate the user to the appropriate activity.
(e.g. account list if there're more than one account)
Bug 2479609
* 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
* Use a content observer to detect changes in Calendars; we use this to
determine whether or not sync has been turned off. If sync is turned
off, all events will be deleted, so we need to reset the sync key
* Make sure that all code working on Contacts also now works on Calendar
(push, etc.)
* Remove some old crufty logging and out-of-date comments
* Addresses 2433061
Bug: 2433061
Change-Id: I6299168903fcce9bf820b72b5f6bb157d9169653