Commit Graph

5839 Commits

Author SHA1 Message Date
Jorge Lugo
d6efb08c4d Merge "Quick response clean-up" 2011-06-23 10:52:36 -07:00
Marc Blank
9863dac3ee Prevent NPE when creating account...
* Yet more whack-a-mole

Bug: 4544677
Change-Id: I35eb0850b3abb13ca82dc5b19bb5511d894b5722
2011-06-23 10:52:21 -07:00
Marc Blank
deb345aceb Support FLAG_SUPPORTS_SEARCH for IMAP accounts
* Update existing database to add this flag for IMAP accounts
* Set flag when creating IMAP accounts
* Change temporary UI to use the flag exclusively

Change-Id: Idefccd3a74d2222fe8a0ba47116dee981a0ae1f5
2011-06-23 10:36:35 -07:00
Jorge Lugo
bc42ab7706 Quick response clean-up
Highlighting now appears when selecting a quick response. On "insert
quick response" dialog has exactly two lines of quick response shown.
Done also works properly now on the phone.

Known bug: text is not ellipsized. However, this is dependent
on bug 3389545 being fixed by frameworks team.

Change-Id: I7490e139267963d1508fa0573144a10c9190e11c
2011-06-22 20:58:54 -07:00
Ben Komalo
2de21278f8 Merge "Search state improvements." 2011-06-22 19:57:14 -07:00
Marc Blank
f5bbef0b16 Merge "When looking for default account, check for empty cursors" 2011-06-22 18:53:32 -07:00
Marc Blank
c09ca39cde When looking for default account, check for empty cursors
* At present, we will cache empty cursors (i.e. where the query
  result had zero rows)
* If a widget (or shortcut) references a deleted account, this will
  create a cached entry for that account, and the defaultAccountId
  code will try to retrieve the isDefault column from that (empty)
  cursor
* To fix this, we simply skip over empty cursors when looking for
  a default account
* We will also look into whether it makes sense to cache zero-
  length cursors

Bug: 4883043
Change-Id: Id998506f77bd6cda6cb1f5d8ce65d689dde4d2c5
2011-06-22 18:45:54 -07:00
Ben Komalo
b0b6eb56f7 Search state improvements.
- actually fires off a new instance of our Activity for search, instead
of killing the old one
- exiting search mode from a search result now works and pops the
activity stack
- doing a new search clears the input box as expected
- the search term is actually shown at the top in the results list

Change-Id: Ia6b92042e26a2e44b8cb45fe1d5b3bfb40cfd6da
2011-06-22 18:18:17 -07:00
Ben Komalo
383d6ead22 Use new message list in controllers.
Change-Id: Iaf4bf90add855f556a2e61521618924e13f60347
2011-06-22 17:23:13 -07:00
Makoto Onuki
ef02676a16 Merge "Fix drag & drop" 2011-06-22 16:20:01 -07:00
Makoto Onuki
d5dfd76cb9 Fix drag & drop
There was an assumption that the list view would only contain MailboxListItem's.
Now it's not always the case with the headers like "recent folders".

Also killed the timer thing for the nested navigation during DnD.

Bug 4904006

Change-Id: I4ee756775d0115f3a39086758be69100c19163c9
2011-06-22 16:13:41 -07:00
Marc Blank
106e3ad16d Merge "Fix problem with getDefaultAccountId() with no explicit default" 2011-06-22 16:06:35 -07:00
Makoto Onuki
192f9b6396 Merge "Improve 1-pane message visual" 2011-06-22 15:57:37 -07:00
Makoto Onuki
846763bd68 Improve 1-pane message visual
Also fixed the text alignment in the tabs on the 2-pane message view.

We don't yet to have the full-spec for this, so it's still temporary.

Now we again wrap the webview in a scroll view, so we'll have the "message
keeps growing" issue again.  I'll file a bug for this.

It's still temporary, so I didn't remove the scroll views for the
each section (e.g. the attachment tab).  Also I had to make up some
colors/dimensions which were unspecified.  Also I didn't always define
styles when I should.  Let's clean up these things later when we
get more detailed spec.

Change-Id: Ibdb78543f5ec7300f92091d1f8b800ca5edc74b2
2011-06-22 15:56:34 -07:00
Marc Blank
6353774647 Fix problem with getDefaultAccountId() with no explicit default
* This wasn't working with the new code and the unit test wasn't
  testing this case.
* Updated code in EmailProvider and added a test case

Change-Id: I75c23423c4f43e4201d446886d92a5312fa8a084
2011-06-22 15:45:17 -07:00
Ben Komalo
67cd9eb0d9 Merge "Introduce MessageListContext." 2011-06-22 14:50:28 -07:00
Ben Komalo
18410ed346 Introduce MessageListContext.
This will encapsulate meta information about a message list. Notably the
mailbox it's showing OR the search parameters that were used to build
its contents.

Change-Id: Ibe078a700860e7b9426c865e843e899f82306a96
2011-06-22 14:37:21 -07:00
Ben Komalo
a308618509 Pushes some search behavior to base controller
This enables search on one pane with the same caveats as on two pane

Change-Id: I80ab6ada0f718367fe6d584b18bc84d04a27bf7b
2011-06-22 13:55:05 -07:00
Ben Komalo
f3d07fb3e6 Consolidate some menu item toggling.
- fixes search button being shown for pop accounts
- cleans up some duplicated code

Change-Id: I498f0140eb2f3ffa7d3ad7f0da0e1d357f80e9b9
2011-06-22 12:38:12 -07:00
Marc Blank
41609adc23 Merge "Fix cursor-related errors:" 2011-06-22 12:01:38 -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
Jorge Lugo
f1d9367909 Merge "Fix behavior if replying to own sent message" 2011-06-22 10:48:02 -07:00
Makoto Onuki
69b50d46ec Merge "Kill InboxFinder in the UI controller" 2011-06-22 09:19:09 -07:00
Marc Blank
0404a331ad Merge "Improve EmailContent caching..." 2011-06-21 23:46:37 -07:00
Ben Komalo
45cab452a9 Merge "Prevent NPE when account can't be found for policy" 2011-06-21 23:16:46 -07:00
Ben Komalo
3873111033 Merge "Fix search bar sizing." 2011-06-21 23:16:21 -07:00
Ben Komalo
a182ac48d6 Merge "Show lookback settings for onepane." 2011-06-21 23:16:12 -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
1116194d9f Fix search bar sizing.
On phones it was being pushed out beyond the width of the phone.
Make it so that it fits the whole width in phone portrait, and is fixed
size in landscape / tablets.

Change-Id: Ifc712002c4df38ceb4bd3577f0cbb48114b41115
2011-06-21 20:39:24 -07:00
Ben Komalo
d17a85a2f2 Mailbox -> folder in user visible strings
Bug: 2293250
Change-Id: I61b58f594357f5a71bb0b50af43cba1e5fffbd8d
2011-06-21 20:12:41 -07:00
Ben Komalo
a817543efb Show lookback settings for onepane.
This doesn't fix the fact that it's temporary, but at least makes the
temporary UI functional

Change-Id: If8d3e3cabe15d2ff0970d418113738f8479cbb8c
2011-06-21 18:30:54 -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
f46a8f2053 Kill InboxFinder in the UI controller
Instead, in switchAccount, if the account doesn't have Inbox, we'll
redirect to Welcome and close EmailActivity.

(This will easily happen if you add a second account from the system settings,
launch the app and switch to the new account.)

Change-Id: Ia03d8e6697b58f6fcf10fd95fbcb5e310a5b5305
2011-06-21 17:59:55 -07:00
Makoto Onuki
b8b560f315 Improve Welcome
- Show "Your email will appear shortly" during the initial sync
- Don't close self in onStop if it's because of configuration changes.

Change-Id: Ic60f25c58712c599c735b2bede1627d4e102eb6b
2011-06-21 17:17:08 -07:00
Jorge Lugo
67be1d5f6b Fix behavior if replying to own sent message
If the address of the account is in the reply-to: field (or from: field
when reply-to: is empty), now populates the To: field with the same To:
field on reply.

Bug: 3504182
Change-Id: I17d7fe4be002b302decb8f0dae95f33d452b7adc
2011-06-21 17:03:46 -07:00
Makoto Onuki
82fecf203b Merge "Revert "Make EmailActivity the default activity."" 2011-06-21 15:06:39 -07:00
Makoto Onuki
053517d2d1 Revert "Make EmailActivity the default activity."
This reverts commit cfd89da9c3

This would remove all existing widgets somehow.
2011-06-21 15:04:59 -07:00
Makoto Onuki
c9af8b2dbf Merge "Wait for initial sync in Welcome." 2011-06-21 14:37:12 -07:00
Makoto Onuki
6500ba21a0 Merge "Make EmailActivity the default activity." 2011-06-21 14:37:01 -07:00
Makoto Onuki
cfd89da9c3 Make EmailActivity the default activity.
We still go through Welcome when the app is launched from account/mailbox
shortcuts or a widget, to clear all existing activity instances, but
when the app is launched from the launcher we just open EmailActivity.

This will get rid of the flicker.

Change-Id: I9bff31fb96e24c125ddc0a1e30a007e6d6ff036d
2011-06-21 14:11:05 -07:00
Makoto Onuki
95ad0f0e93 Wait for initial sync in Welcome.
Change-Id: I5052e8a3e3af5565184c391200b9ab63dff4b50b
2011-06-21 13:58:42 -07:00
Ben Komalo
59f921a21c Merge "Some fixes to the action bar." 2011-06-21 13:38:23 -07:00
Marc Blank
0fd968623d Merge "Fix MailService unit tests" 2011-06-21 13:20:27 -07:00
Marc Blank
cbc842c5c9 Fix MailService unit tests
* These broke when we split Email/Exchange
* We now use a test authenticator and a test account type, which
  is actually far cleaner than dealing with actual accounts

Change-Id: Ib7c9f884eac484c33642a8036f47466ce641c567
2011-06-21 13:03:48 -07:00
Ben Komalo
f69bcd0123 Some fixes to the action bar.
This hides the main navigation controls when the search view is shown.
It also fixes issues with rotation when in search mode.

Change-Id: I5ffed8eb7549fc603fc4e4d1868d114be65112c3
2011-06-21 12:28:57 -07:00
Makoto Onuki
d7d4954860 Merge "Fix failing tests" 2011-06-21 11:40:26 -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
72fad84fc3 Merge "Improved saving of drafts when back key is pressed" 2011-06-21 10:41:21 -07:00
Makoto Onuki
369905c95d Fix crashing tests
Some of the tests are still failing, but at least now we can go through till
the end.

- Fixed NPE in WelcomeTests (caused by the mock context not returning a proper
  layout inflator.)
- Removed the rainy day test from MessageFileViewTest.
  (Not setting a proper intent will result in the argument check in
  MessageFileViewFragment)
- Removed unnecessary null check in EmailProvider.getDatabase()

Bug 4766072

Change-Id: I48b92cc91d0417cd9980c131fda8f63a9a6eb990
2011-06-20 20:01:22 -07:00
Makoto Onuki
09a0e9b5dc Merge "Move restore account to EmailProvider." 2011-06-20 18:46:09 -07:00