Commit Graph

139 Commits

Author SHA1 Message Date
Marc Blank
9a01353f14 New search implementation for IMAP in MessagingController
* Add protocolSearchInfo column to Message table; this can be used
  to store information related to search results.  For IMAP, we
  store the serverId of the mailbox that the message lives in on
  the server
* Add upgrade code for this column
* Change MessagingController to use the proper serverId for remote
  operations, depending on whether the Message is a search result
  or not
* Fix some smaller issues with earlier code

Change-Id: I0c7f1d89a4659b95701d02646c0e8426680e2f6a
2011-06-23 22:02:00 -07:00
Ben Komalo
53300963ff Save/restore message list context
This fixes opening messages after rotations. Oops.
Bug: 4905495

Change-Id: Ibb9984245f7a040b65d472ad4103da587c28c83b
2011-06-23 12:38:42 -07:00
Marc Blank
d12f78d6ba Fix cursor-related errors:
1) Have CachedCursor implement CrossProcessCursor; still need to
  figure out how this ever worked
2) Close cursor used internally in findMailboxOfType

Bug: 4869024
Change-Id: Id20d37b7b83e133aa4d5fe9293a42ae217024f01
2011-06-22 10:59:06 -07:00
Marc Blank
0404a331ad Merge "Improve EmailContent caching..." 2011-06-21 23:46:37 -07:00
Marc Blank
6e418aa41a Improve EmailContent caching...
* Guarantee that up to 16 Account (with HostAuths), and Policy rows
  are always cached.  Also, 6 commonly used Mailboxes per Account
  (Inbox, Outbox, Drafts, Sent, Trash, and Search)
* Precache these rows when EmailProvider starts up
* Ensure that newly added, precachable rows are cached when created
* Clean up some inefficient/wrong caching code
* Fix a commonly called method in NotificationManager in which we
  load a single Mailbox row using selection vs withAppendedId
* Confirm that we don't read from the database in typical use and
  heavy message loading
* Add a special URI for finding mailbox by type (using the cache)
* Add special-case code for EmailContent.count(Account.CONTENT_URI)
  which is used in a number of places (including on the UI thread)
  and whose value is easily determined
* Add a special URI to get the default account id
* Confirm that all unit tests work

The goal here is to be able to load all Account, HostAuth, Policy,
and Mailbox objects (by id) without worrying about disk access.
There will still be a single disk read for uncommon Mailbox reads,
but this should be considered acceptable.

Change-Id: Ibc9aa7acc73185e360b0b6f3053b90a985e97210
TODO: Unit tests
2011-06-21 21:39:19 -07:00
Ben Komalo
505ac4b09b Prevent NPE when account can't be found for policy
Added some tests to ensure no orphaned policy

Bug: 4686450
Change-Id: I64a1f5de05f3e73052cb41828ed6bf1a2e26d22a
2011-06-21 18:26:16 -07:00
Makoto Onuki
95ad0f0e93 Wait for initial sync in Welcome.
Change-Id: I5052e8a3e3af5565184c391200b9ab63dff4b50b
2011-06-21 13:58:42 -07:00
Makoto Onuki
ce4cce05b2 Fix failing tests
Fixed activity tests and and activity.setup tests.

Bug 4762098
Bug 4766087
Bug 4590590

Change-Id: Ifbd49f38c59854c65b6c48a1b03ca8153bfa558b
2011-06-21 11:18:32 -07:00
Jorge Lugo
ae95fbf4d0 Merge "Added quick responses." 2011-06-20 15:10:06 -07:00
Jorge Lugo
5a3888f35b Added quick responses.
Added "Insert quick response" button to MessageCompose's action bar. Clicking
it opens dialog with available quick responses. Selecting one of the responses
will insert it into message body at the current cursor location. Also added
menu in account preferences to create, edit, and delete quick responses.

Change-Id: I85f3f6b36801cf112ec9d7c31135a917456173d7
2011-06-20 13:31:50 -07:00
Marc Blank
ed1dc9ee72 Support "Load More" for IMAP search
Change-Id: I47e5fd1fab421026ee52af72ba56338c69e9b467
2011-06-17 15:43:18 -07:00
Marc Blank
0b34643204 Merge "First implementation of IMAP search" 2011-06-16 20:27:16 -07:00
Marc Blank
627bc6ed57 First implementation of IMAP search
* Broke up synchronizeMailboxGeneric into three pieces; it's still
  horrible, but this at least stops my eyes from bleeding
* Remove unused method/tests from Folder interface

Change-Id: Ib4d979536be657137cf70ca535cf429d707be41b
2011-06-16 20:26:52 -07:00
Ben Komalo
cb24e515b7 Add one more error state to certificate process
When the KeyStore fails to give us back a certificate for any reason (it
was removed from the keystore perhaps), propagate the error back up.

Change-Id: I4f0ef783c1665589cc8ccb43d95da43a297a3e9a
2011-06-16 16:14:03 -07:00
Marc Blank
1579b7864a Merge "Fix Store caching" 2011-06-16 13:58:24 -07:00
Ben Komalo
f4dbbf1099 Indicate to the user when a cert error happens.
This introduces an exception which needs to be thrown from a KeyManager
when it tries to establish a connection with a server requesting a
certificate.

Change-Id: I06dfad7789ed5d320b630e7e4380e15da42a48df
2011-06-16 11:37:23 -07:00
Ben Komalo
d09cff0888 Make "don't allow camera" a supported policy.
This sends the bit to the DPM. Separate changes have been/will be made
to change the provision parser and support it in the DPM.

Bug: 4185316
Change-Id: I44872ceb095a28539b047a0641cc499c7186a9b3
2011-06-16 10:44:48 -07:00
Marc Blank
f65bdbdaf5 Fix Store caching
Bug: 4671090
Change-Id: I07413eb713c564f6dbcac45091357153cfe19a5d
2011-06-16 09:24:44 -07:00
Ben Komalo
913e26180d Fix ambiguously named getters.
Change-Id: Ieec918a520fd291d8d85695d1a86b85a73b266a5
2011-06-14 17:38:19 -07:00
Ben Komalo
22409fcffa Pass HostAuth when validating an account.
Since HostAuth is fully Parcelable, no sense passing the individual
fields.

Change-Id: I4d8fd2bbe7b47e8f1e2ff00c8c0cad8429eec159
2011-06-14 14:47:18 -07:00
Ben Komalo
78959916e7 Add support for client side SSL certificates
This introduces the ability for clients (i.e. the exchange service) to
register "special connection types" that use a client certificate stored
in the system keystore. The alias is encoded into the URI scheme for
those clients, and the socket factory used for those connections will
use the approprate KeyManager.

Lots of TODO's, including bubbling a lot of this up to the higher level
and wiring the UI to actually set the alias in the HostAuth table.

Change-Id: If5e1901c5b58731fdabd3e6b6da7198134b512d2
2011-06-13 18:16:22 -07:00
Marc Blank
e57a83d39a Add flags for server-side search support
* Also, a convenience method to test the base flag
* Follow-up CL will add these flags for Exchange

Change-Id: I38dc1d19e89805989e674c17919db238b4913a1c
2011-06-13 16:50:10 -07:00
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
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
4c4b088a21 Merge "Add "lastTouchedTime" column to the mailbox table" 2011-06-03 09:26:14 -07:00
Todd Kennedy
9dcb72e1ec Add "lastTouchedTime" column to the mailbox table
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
2011-06-03 08:51:25 -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
Ben Komalo
cd7dce5b39 Merge "Move the custom SSLSocketFactory into emailcommon" 2011-06-02 10:29:41 -07:00
Marc Blank
a613aa18f5 Merge "Add transient to Account (for holding AccountManager account)" 2011-06-02 09:41:28 -07:00
Marc Blank
dcac884697 Add transient to Account (for holding AccountManager account)
Change-Id: I2eba00b4e2f4fe0dfdc71547bfac9159728ea0e9
2011-06-02 09:41:07 -07:00
Ben Komalo
12a3e3e4b9 Move the custom SSLSocketFactory into emailcommon
Change-Id: I48da54a74fd3fe573d20e581b69e35944ba9c8ff
2011-06-01 20:27:02 -07:00
Todd Kennedy
fa1b3a8f37 Save widget config to shared preferences
The way the config activity communicates with the widget will be through
shared preferences. We now read / write shared preferences for widget
configuration. One step closer to the configuration activity...

Change-Id: I7c54259d84ad8d304a61652af5b3edff4c7d67db
2011-06-01 15:14:55 -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
09a071a879 Don't use multipart/alternative for SmartReply/Forward text
* When confirmed fixed, this should be backported to MR2/MR2

Bug: 4490341
Change-Id: Ie99047b465ed7087e6e0100f7d517ac3fb6b803c
2011-05-26 10:19:01 -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
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
Todd Kennedy
5675ea88d3 Add a second fragment to select the mailbox
After choosing the account, we need to select a mailbox for the shortcut.
In order to replace the fragment, we cannot hardcode it in the XML. Instead,
we need to dynamically create it.

Also, restructure the fragment class and rely on the class to "do the right
thing"

Change-Id: I752ad5bbdf2484332ec2b73852cae74a5d2092fa
2011-05-24 16:00:33 -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
b36ac01792 Changes for NO_XXX
- Added Message.NO_MESSAGE
- Renamed PSEUDO_ACCOUNT_ID_NONE to NO_ACCOUNT
- Removed PARENT_KEY_NONE and use NO_MAILBOX instead
- For starters, cleaned up the UI controllers to use them.

Change-Id: I6cfd87ece2fced8e9f7c76d034c4d1dbf9e4db10
2011-05-17 14:36:00 -07:00
Makoto Onuki
54c91f00d7 Use IllegalArgumentException, not InvalidParameterException
Because IllegalArgumentException is the standard one.

Change-Id: Ib4d0bfa88a3d4218148a7cb248d9baa2124a72ba
2011-05-16 17:48:46 -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
Makoto Onuki
bfac9f2e8a Move some of the log constants from Email to Logging
Change-Id: If9f4e4e3adcdef897a0d6a4e153bb446a8b24fdd
2011-05-13 14:24:38 -07:00
Todd Kennedy
577ddb7dd7 Remove notifyNewMessages() service callback
Since the notification controller now operates exclusively using database
observers, there's no reason for the exchange service to call the
notifyNewMessages() service API.

Change-Id: Iaa7e2f5eae786162eab23b02b03ce6d1e8a738e9
2011-05-13 09:10:28 -07:00
Todd Kennedy
76061eba14 Remove SuppressWarning("unused") wherever possible
Change-Id: Ie799f02ab39a7d020af1fb98b6bac45fc0fd1298
2011-05-12 16:02:06 -07:00
Marc Blank
a830547adf Merge "Add messaging exception status for "attachment not found"" 2011-05-12 15:53:50 -07:00
Todd Kennedy
5701e0a555 Suspend notifications for currently shown account
We will suspend notifications whenever we display the message list for an
account (including "combined inbox").  As soon as the message list is paused,
notifications will be resumed.

Change-Id: I481a0f59ce68f89c32210d862d0267f3f334063b
2011-05-12 14:03:14 -07:00