Commit Graph

749 Commits

Author SHA1 Message Date
Marc Blank f5418f1f93 Move Account into its own top-level class
Change-Id: Ide7c991b7d4d418dbe17164421425bf898ba64ee
2011-06-13 15:37:22 -07:00
Marc Blank 85e4c101b0 Remove storeUri's except during auto-setup
* Remove per-store limitations
* Use constants for VISIBLE_WINDOW, rather than having the
  potential for differences between Stores

Change-Id: Idd5e0874bba6e3390e4f093bcb03f4b1bb399c11
2011-06-09 13:34:43 -07:00
Todd Kennedy 9d2dae6750 Set proper default values for new mailboxes
When creating mailboxes (specifically 'drafts' or 'sent'), we need to ensure
that its default values for flags & server key are set correctly. In most
cases this is "okay" because the mailbox will be created on the server and
the values for these fields will be reset. However, in cases where system
mailboxes cannot be created on the sever (for example, the 'drafts' folder
on any POP3 account or an IMAP gmail account), these default values do not
get updated and we are unable to view the contents of these mailboxes.

bug 4356871

Change-Id: I9e6a394145f471b555c5827d5114bca243dbc37c
2011-06-09 11:39:14 -07:00
Todd Kennedy 348b2f9f11 test uid search w/ and w/o parens
some imap servers will not work if the uid command contains parenthesis, while
other imap servers will not work unless the uid command contains parethesis. we
need to verify that we send both formats.

bug 4526165

Change-Id: I04a31f06a0f0fa0f03777a22b23281af574cd549
2011-06-09 10:38:44 -07:00
Todd Kennedy 7984aa60a0 Add new field to mailbox test
there's a new field in the mailbox class that was causing a unit test failure.

bug 4552358

Change-Id: Id17a99b55248cdc9e4c5ea455506f72e52687599
2011-06-09 10:14:52 -07:00
Ben Komalo 724c3a81cd Introduce scheme name escaping in SSLUtils.
Change-Id: I73f19e7d40d0b19dfd41cfaf7db0879ef2e3a3ea
2011-06-08 13:33:38 -07:00
Ben Komalo 313586c8eb Introduce client cert alias for HostAuth.
Some email servers require client certificates to be presented to
establish an SSL connection. While this certificate will be maintained
by the system key store, we need to store the "alias" of the certificate
stored in that system store.

Wiring up to use the actual alias will be done in future CL's. It is
currently unused.

Change-Id: I8d1290151342daea9ceb0df8a4088405b44faa81
2011-06-07 18:48:23 -07:00
Todd Kennedy 1b404f4fff Collapse MailboxAdapter & MailboxFragmentAdapter
MFA was the only subclass of MA and the abstraction no longer made sense.
Collapse the two into a single adapter class.

Change-Id: I32c6f027bc37f3da08626f743c3f494e5f48c3f0
2011-06-07 14:34:16 -07:00
Makoto Onuki cb530b4e91 Merge "Use the CursorWithExtras pattern for the message list." 2011-06-07 11:12:31 -07:00
Todd Kennedy e392418840 Add recent mailboxes to the account spinner
The ability to change mailboxes using the spinner is currently only implemented
for the two-pane UI. one-pane implementation will come in a future CL.

Change-Id: If72e9d9d607508553c918f5523e748e8a481ff84
2011-06-07 08:48:37 -07:00
Makoto Onuki 41878c2813 Use the CursorWithExtras pattern for the message list.
This will make the message list a lot snappier.

We were using two different loaders for the message list; one is to load
the meta information and the other to load the actual message list.

Unify them using the CursorWithExtras pattern.

Change-Id: I02957bbca1b1fb74ca6eca14ad2535dfdbf03a5a
2011-06-06 16:34:03 -07:00
Todd Kennedy 3a1e874a9c Fix filtered query
we need to return 5, post filtered, results. previously, we were returning
5, pre filtered, results. Also add a test to catch this condition.

Change-Id: Id25f4bf79081c42a2012e0e51b36142120c83b20
2011-06-06 14:58:39 -07:00
Todd Kennedy f04c832f23 Add ability to track mailbox recency
Change-Id: I1bcc7928ea7065a5daa262b7cea7ee3e21981675
2011-06-06 10:30:01 -07:00
Jorge Lugo 8f54b2f135 Merge "Fixed reply-all bug" 2011-06-03 10:23:35 -07:00
Jorge Lugo 15842c522e Fixed reply-all bug
Upon hitting reply all, all email addresses except that of the source message sender
go in the CC: field. Previously they all went in the TO: field. Updated 3 tests
in MessageComposeTests.java (testReplyAllAddresses1(), testReplyAllAddresses2(), and
testReplyAllAddresses3()) to reflect this new behavior.

Bug: 4534058
Change-Id: I852daebdd8843a45f685eecc67f757c87925bb6c
2011-06-03 10:16:05 -07:00
Marc Blank 75a754660e Update searchMessages API
* Store various search parameters in a new parcelable class

Change-Id: Iadec6a803b1bf17d89cd401c3fca1cb0ad3340d4
2011-06-02 21:41:17 -07:00
Makoto Onuki 3bfd5734b8 Merge "MailboxListFragment: In-place nested mailbox navigation" 2011-06-01 15:11:09 -07:00
Makoto Onuki 844bf74504 MailboxListFragment: In-place nested mailbox navigation
Now we reuse the same instance of the fragment for nested mailbox
navigation.  (Don't use fragment transaction)

"CursorWithExtras" now only has the child count, so I removed the
bundle version and added a concrete class to MailboxFragmentAdapter.

With this CL the nested mailbox navigation on 1-pane should work, but
not back navigation.  (Back press event isn't connected to the
fragment yet.)

Change-Id: I2c23651d9c8edb5fe062c68bbb9b462c8949ded4
2011-06-01 15:06:42 -07:00
Todd Kennedy 44f5cd67c9 Remove widget views
The new widget UX allows for a single display mode for the widget. This can
be configured when the widget is added or at a later time during widget
re-configuration.

We don't have the configuration activity (yet). We first need to restructure
the widget to take a single account / mailbox combination. Hooking up the
configuration activity will occur in a future CL.

Change-Id: I38a5796c44938a6abd0d2bb50ac77241cc86a497
2011-06-01 10:46:32 -07:00
Marc Blank 40ce9246c6 Merge "Cleanup code in Policy" 2011-05-25 18:52:11 -07:00
Marc Blank fae5ebbfd2 Cleanup code in Policy
* Use a single method for setting/clearing an account's policy

Change-Id: I90fd97d4a5ba452d4656bbabd06a40797c82e10c
2011-05-25 17:38:12 -07:00
Makoto Onuki 3096b4ae18 Add Controller.deleteMessages(long[]) for batch delete
- Also removed the accoundId parameter, which wasn't used.
- Also cleaned up MailboxListFragment.onDrop.
  (the restored Message was only used to get the account id, but
   it's no longer needed.)

Bug 4384642

Change-Id: I8f6635011dae0529a82972617101e1c130090b76
2011-05-25 13:49:40 -07:00
Marc Blank f3ff0ba910 Create AccountManager acct for pop/imap on upgrade from GB
* Also, unit test for upgrade path

Bug: 4439595
Change-Id: I508a3d8ea70c1a894a412528314e42a39f3ae0e7
2011-05-25 08:31:24 -07:00
Ben Komalo b535e436f3 Merge "Move HostAuth to top level class." 2011-05-19 16:28:18 -07:00
Ben Komalo 12b82d9374 Move HostAuth to top level class.
No other changes made.

Change-Id: I1c6497c98abc0f99443ea42d8aed6295b263c123
2011-05-19 15:28:48 -07:00
Makoto Onuki d531dc3058 Fix opening Starred mailbox.
We need to pass around the account ID with onMailboxSelected too.
(It's kinda sad it wouldn't have happened if we had par-account starred
mailbox.)

Also made sure MailboxListItem.mMailboxId now really contains only a mailbox
ID.  Before this chage, we stored an account ID to this for an account row
on the combined mailbox.

Bug 4452811

Change-Id: I732fd8eb18f787f4a700a45a40768f96e3bb8751
2011-05-19 15:10:51 -07:00
Makoto Onuki 2ed7a86949 Support pre-HC style account shortcuts
Account shortcuts used to point at MessageList directly with a
content://com.android.email.provider/account/ACCOUNT-UUID URI.

Hook these intents and open Welcome instead.

On Eclair and before, we stored an account-ID directly as an extra,
but this style is no longer supported.

Bug 4208879

Change-Id: I9fecb0723743377a6d7c7e84626e8613f2356492
2011-05-19 13:47:25 -07:00
Todd Kennedy 581e3c2333 Fix Store re-using old data
The key for the Store cache was not adjusting properly for account
changes (such as port changes, etc...). As such, it was possible to
get an invalid store.

Now, there's problem with leaking Account objects if the store account
changes (see bug 4440839). This is "okay" for now since account changes
are fairly uncommon and Account objects are light. However, this should
be fixed at some point.

Change-Id: I4ddcbc3e2759b7b1374d0300706373678dedec94
2011-05-17 08:48:33 -07:00
Todd Kennedy 171c3f2273 Some more re-arrangement of code
No real code changes; just moving where code / constants live. Removed
one unused method of Store.

Change-Id: Ie7532381759a568cb23601e1071c8e199b6beb07
2011-05-16 14:47:49 -07:00
Todd Kennedy ebece4dbdc Make ImapConnect a top-level class
Split out ImapConnection to its own class. This allows us to update ImapStore
without worrying about links between it and the connection.

Also, added a bit more safety to the classes in terms of correctly freeing
resources. Whenever the connection is closed, it now releases all resources.
Additionally, if the connection is ever put back in the pool, any response
data is released.

Change-Id: Ie3bda40d677707a0d6655f57175e58dece539e19
2011-05-16 14:17:58 -07:00
Makoto Onuki 4c4e4c3515 Clean up the method to build message list selection.
- Moved the method to EmailCommon.
- Use *_SELECTION for magic mailboxes
  (meaning we now use subqueries for magic mailbox selections, rather than
   building the mailbox ID list by ourselves)

Change-Id: I3ebf6af62fd912fea6faea0f75e05fc61c87af3b
2011-05-16 11:08:05 -07:00
Ben Komalo e0bb7e7909 Make Mailbox parcelable
Also fix unit tests

Change-Id: I5f64f53b278b7bc27053d831760b155532a14e33
2011-05-13 18:35:08 -07:00
Ben Komalo 53ea83ebf9 Move Mailbox to top level class.
No other changes made.

Change-Id: I3d8f3c521dc0d902be313b25252b4b6a4a96e7ee
2011-05-13 17:42:02 -07:00
Ben Komalo 2866284a6d Rename AccountSettingsXL -> AccountSettings
This activity already supports phone and tablet mode.
Only renames in this change - no other change.

Change-Id: Ieca17137af45e3860812091f69cd4d9b55ddf3ec
2011-05-13 09:58:15 -07:00
Todd Kennedy f437892348 Open message if only one message in notification
If there is only one unread&unseen message in the notification, clicking the
notification will automatically open the message view fragment. Otherwise,
the message list fragment will be opened.

Change-Id: I22778258836a36f289d71b99a6214ec82778f385
2011-05-13 08:41:48 -07:00
Marc Blank ffeb7de284 Merge "Fix a race condition in which an Attachment might be wrongly deleted" 2011-05-11 18:03:26 -07:00
Marc Blank 2f6cbb021c Fix a race condition in which an Attachment might be wrongly deleted
* This is a serious bug dating back to the first Honeycomb release
* It was possible that a newly created Message could not yet be
  committed to the database when the AttachmentDownloadService
  tries to download one of that message's attachments.
* ADS, when it sees that the message (apparently) doesn't
  exist, deletes the Attachment (it appears to be orphaned)
* The effect is that the user never sees one of the attachments
  in a message.
* This bug has been reported externally
* The fix is simply to check for the message's existence before
  deciding to delete it (this check will always work properly)

Bug: 4409692

Change-Id: I106ed2fe88d2435ad7a462fced5cb307c2559fd6
2011-05-11 17:27:37 -07:00
Makoto Onuki 94331c96d9 Remove phone activities and implement one-pane
The primary purpose of this CL is to remove phone activities, so the
one pane implementation is very much temporary and primitive, but it
should offer minimal operations.

Change-Id: If57f81db7c605c95664d49044a5cc082beda59c0
2011-05-11 15:35:27 -07:00
Marc Blank b2a909598b Create/test method to set "not downloadable" flag based on policy
Change-Id: I08bec46d0c961bdc9530768f5198346338b3e2f3
2011-05-11 11:21:33 -07:00
Todd Kennedy d31d64d330 Merge "Use observers to manage new message notifications" 2011-05-10 17:09:07 -07:00
Marc Blank 5d08360a9b Merge "Complete rewrite of account backup/restore code" 2011-05-10 16:23:41 -07:00
Todd Kennedy 83693a6aca Use observers to manage new message notifications
We were sort of using observers to maintain the new message notifications.
However, other parts of the code would poke into the notification controller
to set things such as a list of newly added message IDs. Now, we rely
exclusively on db observers to manage notifications.

As a side effect of this, we now set the notification text correctly to be
the most recently _added_ message. This may be different than the most recently
sent message [since there may be a non-negligable delta between when the
message was sent and when it was received].

NOTE this still suffers from an outstanding bug where we continue to get
notifications when the Eamil UX is visible. That and monitoring changes to the
account table will be addressed in future CLs.

Change-Id: I4c68273716cc685574a1ca71e5d634f53fe0d882
2011-05-10 15:36:07 -07:00
Todd Kennedy a48abd7f95 Merge "Add notification table shared preference" 2011-05-10 11:36:30 -07:00
Todd Kennedy 2f371e8553 Add notification table shared preference
The notifiaction table will be used by the updated notification controller.
The table stores the key and the associated last notified message key and
message count.

Change-Id: I037b5374ab51620f1cffc8b41391db858cfd3a2d
2011-05-10 11:35:04 -07:00
Ben Komalo 5b7e434917 Support switching between reply/replyall/forward
This introduces tab navigation on large screens with action bar (a
dropdown for the phone view is yet to be implemented, though the
internals are ready for it).

This requires the side effect that restoring a draft
reply/replyall/forward will attempt to also load the source message in
full for additional information. If that load fails for whatever reason,
the draft just remains a "compose" as it used to before.

Bug: 3117253
Change-Id: I9cff5ed4a5e9abd1338b6dbde28ceb3e4dc2b761
2011-05-10 10:36:22 -07:00
Todd Kennedy dd9d472569 Merge "Add unit test for Utility#updateLastSeenMessageKey" 2011-05-10 08:12:34 -07:00
Marc Blank 0993190caf Complete rewrite of account backup/restore code
* 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
2011-05-09 10:39:17 -07:00
Todd Kennedy a17ee57c7f Add unit test for Utility#updateLastSeenMessageKey
Change-Id: I1335ac53c5de418fd0ed6c2b38be60165db1cb8c
2011-05-09 09:49:32 -07:00
Ben Komalo 8d042850fb Re-work the way MessageCompose handles attachments
Now attachments are actually stored in an explicit list, instead of
being inferred from the state of the UI. This makes it possible to
switch states and restore attachments, and test.

Change-Id: I8c5f80f17f8c9e78d880ac4a1ac6ae22c2ec0579
2011-05-06 11:53:53 -07:00
Todd Kennedy c4cdb11d24 Remove notification if messages seen off device
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
2011-05-05 12:00:27 -07:00