Commit Graph

3253 Commits

Author SHA1 Message Date
Makoto Onuki
bc2eaadde9 Use parallel executor
We should eventually replace all with EmailAsyncTask, but it's the safest thing
we can do now to avoid regression.

Change-Id: I78bfc4fb2be1dcfadeb7f90092ec7adb35c1d393
2011-07-01 11:04:11 -07:00
Makoto Onuki
1600adab97 Merge "Fix bug 4978035 Precondition failure: Not combined mailbox" 2011-07-01 10:19:46 -07:00
Makoto Onuki
a6212c88e0 Fix bug 4978035 Precondition failure: Not combined mailbox
Also added test.

(For some reason the message count doesn't get set properly on tests...
I'll investigate it when I get around to it...)

Change-Id: I83f3b6f2079da06b2d4973419d2296e6492de1d3
2011-07-01 10:18:13 -07:00
Makoto Onuki
45bfb10464 Merge "Fix bug 4901592 Do not drill-in to inbox by default" 2011-07-01 10:06:55 -07:00
Marc Blank
983fd116b1 Merge "Delete orphaned mailboxes/messages/policies at provider startup" 2011-07-01 09:22:11 -07:00
Marc Blank
2bdf7ee0f0 Delete orphaned mailboxes/messages/policies at provider startup
Bug: 4972132

Change-Id: Icc756a9e28b77de052261903089b040d229e7b5d
2011-07-01 09:21:09 -07:00
Jorge Lugo
c01db92acf Merge "Widget logo opens up mailbox" 2011-06-30 20:46:22 -07:00
Makoto Onuki
9630e31bac Fix bug 4901592 Do not drill-in to inbox by default
If the initial mailbox has child mailboxes, we should show the drilled-in
view by default, EXCEPT if the initial mailbox is inbox, in which case
we want to show the root view.

(And we drill-in if the user taps Inbox.)

Bug 4901592

Change-Id: Idc1462030cf8d971dd4dcbba647ac3a64cab6819
2011-06-30 18:00:11 -07:00
Ben Komalo
6fc2585327 Fix account settings crash.
The check settings fragment could potentially take a while to finish,
and may finish after the activity has shut down. Ensure that the
callbacks don't go through if that happens (usually means the user
backed out before it finished)
Bug: 4689161

Change-Id: Ie8e052f03a8f8f2884c0fe1e334a91c02444f96c
2011-06-30 15:38:34 -07:00
Jorge Lugo
1f59271769 Widget logo opens up mailbox
Pressing the email widget's logo will open up the account's inbox.
Also, composing a new email open the compose window for that
account instead of an arbitrary account as before.

Bug: 3366819
Change-Id: I03c0d6973f5428b2044e755f41fcc6f4da225afa
2011-06-30 15:16:47 -07:00
Ben Komalo
09e7fffb2a Merge "Fix b/4905749 using workaround" 2011-06-30 11:56:05 -07:00
Ben Komalo
85cfc9c0bd Fix b/4905749 using workaround
We suspect the underlying bug is b/4981556 but it is a framework issue
which needs time to fix. Some fragment state is not restored properly
when going through orientation change, so navigation shortly after that
will always crash.

Change-Id: Id6b8714c2aeac5f6bf09e82aea5459bb19d0054d
2011-06-30 11:47:39 -07:00
Makoto Onuki
3aa7fd74f8 Fix bug 4978032 Can't get out of "starred" mailbox
Even with CL the account spinner on the starred mailbox looks still a bit
weird because the spinner turns into the combined mode even if you select
the starred mailbox from a normail account's mailbox list, but at least
you'll be able to get out of the starred mailbox.

Change-Id: I26a256be39f070acece67f4a308a8525a6be1d3b
2011-06-30 09:46:15 -07:00
Ben Komalo
698aa92e6f Fix actionbar for message view
- shows the title of the message in the action bar (visuals not final -
need to extend the width and hide the account name)
- ensures that tapping up/back from a message view from a search result
list doesn't exit search
- ensures that tapping "app up" from a collapsible tablet view doesn't
exist the search unless the left pane is uncollapsed

Change-Id: I2b21a430d12148cf72237060c05312c7a23e2b3b
2011-06-29 19:46:58 -07:00
Makoto Onuki
8de5bda815 Close cursor properly.
Also, don't issue separate query()s for each recent mailbox.

Bug 4977956

Change-Id: I3ccd437a7efd5c3599c4a1952ba091a7b3b815bf
2011-06-29 19:21:14 -07:00
Makoto Onuki
5fbc5025f0 Merge "Remove opener IDs from message view fragment." 2011-06-29 17:58:37 -07:00
Marc Blank
6da2b981da Merge "Oops; fix NPE" 2011-06-29 17:54:53 -07:00
Marc Blank
569785b4f9 Oops; fix NPE
Bug: 4977755

Change-Id: I117eb3a061628ee572f37123631c3da301b5e50b
2011-06-29 17:50:23 -07:00
Makoto Onuki
918860b8e0 Remove opener IDs from message view fragment.
There are needed for the back navigation when a message
is opened from a deep link, but now that we always have a list context
they're not necessary.

Change-Id: Iba2d0b2f31f4539f6e872970b514574347e248c5
2011-06-29 17:32:45 -07:00
Makoto Onuki
87fce70d0f Merge "Newer/older + auto-advance for one-pane" 2011-06-29 17:31:32 -07:00
Makoto Onuki
22d1a794cd Newer/older + auto-advance for one-pane
- Moved MessageOrderManager code from 2-pabe to the base class.
- Most of the code is shared between 1-pane and 2-pane.

- Also fixed the bug where we re-created MessageOrderManager every time
the user taps newer/older, which was the reson the newer/older button
temporarily got disabled when you tapped them.
Before this CL we stopped MOM in uninstallMessageViewFragment, but now that
we don't reuse fragments this means we stops MOM when we remove the current
message view, and re-created a new one when a new message view is created.
Now we stop MOM when the right pane gets hidden (2pane) or when showing
the mailbox/message list (1pane).

- Also removed a now unused callback onMessageShown() from MessageViewFragment.
We used to update MOM on this event, but now we do this in
installMessageViweFramgment().

Bug 4575586

Change-Id: Idc4aba184f318e0c086afc29dcbe42364e2b51b3
2011-06-29 17:29:29 -07:00
Marc Blank
17f7ffae4c Merge "More Store cleanup" 2011-06-29 16:43:01 -07:00
Makoto Onuki
4b39d7ccff Fix for "Unknown uri: .../mailbox/-4
It was caused by the fact that we show the combined starred mailbox
on each account's mailbox list.

Beacuse of this, when you open the starred mailbox on non-combined view,
we pass a normal account ID + the combined starred mailbox ID to the
AccountsLoader, which then thinks that because the account ID is not
ACCOUNT_ID_COMBINED_VIEW the mailbox ID must be of a regular mailbox,
issues a query to get mailbox info, and crashes because the mailbox
is virtual.

- Also fixed the issue that we don't show message count on the account
spinner for combined mailboxes.

bug 4971181

Change-Id: Iaa13b362505b8babc7f7ea8a03ddf5494736dc2d
2011-06-29 16:30:43 -07:00
Marc Blank
0b8e04c84d More Store cleanup
Change-Id: I8f542175b4468c7a320322a57bfdaf19a7320165
2011-06-29 15:22:05 -07:00
Marc Blank
aa46bc3919 Merge "Remove redundant and unused constants" 2011-06-29 14:48:08 -07:00
Marc Blank
6fea021e3d Remove redundant and unused constants
Change-Id: Ie8658f86737880e3127a0a2c3b7f0557dde98b29
2011-06-29 14:30:46 -07:00
Ben Komalo
29c89ad17a Just mark search mailbox as not visible
This way we don't have to explicitly filter it in all the different
places we do selections on mailboxes.

Note that I didn't create an upgrade path for this. The only people with
search mailboxes are probably developers right now, and worst case for
people who experimented, they will just get the search mailbox visible

Change-Id: I9a0bf6df9985418d467a7348ed99a36521641b89
2011-06-29 14:27:27 -07:00
Ben Komalo
659f60f734 Wire through logic for searched mailbox
- update hint based on the mailbox being searched
- ensure that we use the original searched mailbox as the mailbox to
search for subsequent search (i.e. a search while we're viewing search
results) and not the search mailbox

Change-Id: Ic8663272173ce386dcd13fdf0369e918fb895be8
2011-06-29 14:09:14 -07:00
Marc Blank
244d306ebb Remove more useless code
* Strike another blow for sanity!

Change-Id: Id95b441f9577abda66f04113793d6b1c60500ebe
2011-06-29 14:07:25 -07:00
Marc Blank
77160c8c08 Merge "Don't cache ImapFolders" 2011-06-29 13:34:44 -07:00
Marc Blank
2720a818d5 Don't cache ImapFolders
* ImapFolder is currently very unsafe for use by multiple threads,
  causing, among other things, the referenced bug
* Since ImapFolder is very lightweight, there's no particularly good
  reason to be caching them anyway
* Rename isOpenForTest to isOpen

Bug: 4972084
Change-Id: I2bf17b9cfc8549a222e991f3e59abfd00a4d3afd
2011-06-29 13:02:55 -07:00
Marc Blank
ea8034affa Merge "Clean up Store implementation" 2011-06-29 13:01:36 -07:00
Marc Blank
35b0e95ca7 Clean up Store implementation
* Remove unused argument from newInstance/constructor
* Create ServiceStore class, the superclass of ExchangeStore (and,
  eventually, all Stores, until they can go away completely)

Change-Id: Ic5237236c5349ecf006538c58b63c1efe8e4ea61
2011-06-29 12:50:43 -07:00
Ben Komalo
b859a3b61e Filter search mailboxes so they're not visible
Change-Id: I99edcb19ce9e320676dff55f219370730e74239b
2011-06-29 12:06:57 -07:00
Makoto Onuki
488308b354 Merge "Fix the "onPostExecute executed even when cancelled" issue" 2011-06-29 11:19:37 -07:00
Ben Komalo
5d811ecf18 Merge "Re-enable hw acceleration and fix webview cleanup" 2011-06-29 11:14:55 -07:00
Makoto Onuki
50d934360d Fix the "onPostExecute executed even when cancelled" issue
Renamed onPostExecute to onSuccess and made sure it won't called
if a task is cancelled in time.

Also removed isCancelled().  To implement it right we should make sure
that onPostExecute() isn't finished when setting mCancelled, but it's a bit
of a pain to implement right, and we don't really have to use it.

Change-Id: I3a0baf504506ffc4952a5553f7098a8415842fa3
2011-06-29 10:22:38 -07:00
Ben Komalo
a6e15b13ef Re-enable hw acceleration and fix webview cleanup
Bug: 4886133
Change-Id: Ib59e560a6e1ef3eecc15ff0073a3c0f34688835a
2011-06-29 09:55:32 -07:00
Makoto Onuki
4a893e60b4 Switch to EmailAsyncTask
Also remove the isCancelled test in onPostExecute, where it should
never return true.

Change-Id: Ica2b07db22d73769c2ead5f232f4890bd3bb87da
2011-06-29 09:50:52 -07:00
Makoto Onuki
6cf76d94c8 Merge "Fix one-pane navigation/UI bugs" 2011-06-28 17:50:07 -07:00
Ben Komalo
1f6acaf396 Hide footer when we hit the end of a search
Change-Id: Iec082a9f9560819c034f91706229b1efb7303ba2
2011-06-28 17:24:54 -07:00
Ben Komalo
6b256f1fa1 Wire through results count in search header.
Change-Id: I817236d9c3294acb25b62724cc8c99d47df7f354
2011-06-28 17:11:16 -07:00
Makoto Onuki
ecd9c93cfa Fix one-pane navigation/UI bugs
- Back from the starred mailbox now works.
- Combined view now has the "show all folders" in the spinner.
- Null-out the list context when opening the mailbox list.
- Properly restore the list context when popping from the back stack.
- Disable the account spinner dropdown on the mailbox list.
- Hide the little triangle thing at the right bottom corner of the spinner
  when it's not selectable.

Bug 4836064
Bug 4689313

Change-Id: I41d1b6c7024953407b260f5b4b63fbc366e538ca
2011-06-28 16:30:28 -07:00
Marc Blank
06421df25d Merge "Return total number of results from IMAP search" 2011-06-28 14:19:18 -07:00
Marc Blank
5a9c95f94e Return total number of results from IMAP search
Change-Id: I44eb83042774294aa5aaa8f45a46b82dd78b0141
2011-06-28 12:14:25 -07:00
Ben Komalo
2213a79c36 Merge "Prevent monkey crash on attachment load." 2011-06-28 11:32:07 -07:00
Marc Blank
c0a9fa9c68 Fix NPE
Bug: 4969186
Change-Id: I27fbdf7a496ee73caf36a90bf56b91c90133b3b7
2011-06-28 11:05:02 -07:00
Ben Komalo
efbb408dbb Prevent monkey crash on attachment load.
Bug: 4969655
Change-Id: Ie1cbeaab4b9335aa4b0c2c972647072df21fccec
2011-06-28 09:44:48 -07:00
Marc Blank
5d7ff8577d Synchronize access to mailbox type map
Bug: 4967543
Change-Id: I71380d0d2d5664cf92a9b698bfdad516eeb5c80f
2011-06-27 20:23:40 -07:00
Ben Komalo
8935f6d39e Merge "Show a search results header." 2011-06-27 20:02:44 -07:00
Ben Komalo
9b4f11a4ed Show a search results header.
The count will be wired in and shown in here.

Change-Id: I2f496dcd86d748ee1c17c8e819b65c61c098a8ba
2011-06-27 19:59:23 -07:00
Makoto Onuki
257c037bb5 Use DelayedOperations in ABC
Change-Id: Iadb4def22176cf28bc3a0b78f95b1c7cc9f52f69
2011-06-27 17:56:49 -07:00
Ben Komalo
f8acc29628 Merge "Introduce a SearchCursorLoader" 2011-06-27 17:32:25 -07:00
Ben Komalo
37c8a70d64 Introduce a SearchCursorLoader
This loader will abstract away the waiting for the controller to cleanup
the existing contents of the search mailbox

After some additional, to-be-done plumbing, I'd like
Controller.searchMessages to return some results info (like # of results
at the least) so that the SearchCursor returned can relay that
information to the client (which can then do a lot more interesting
things at that point).

Change-Id: Ifcba0ddf7170c56dac9f3b44128988a5aa4ca887
2011-06-27 15:43:21 -07:00
Marc Blank
bc1fa23031 Merge "Clean up/simplify ExchangeUtils/ExchangeStore" 2011-06-27 14:27:25 -07:00
Makoto Onuki
d538d4bce1 2pane: Show/hide fragments *before* animation starts
To fix "IllegalStateException: Can not perform this action after
onSaveInstanceState".

Bug 4522010

Change-Id: I640fab0d51b02467f2f91d0d33091e1daac356fd
2011-06-27 14:10:11 -07:00
Makoto Onuki
569083fab3 Merge "New account spinner" 2011-06-27 13:22:41 -07:00
Makoto Onuki
4689cb7100 New account spinner
- Don't use the action bar spinner.
  Instead use a custom view to show the current account.
  (It's not a spinner; now we show the dropdown list by ourselves,
  which gives us more detailed control.)

- Also show the current mailbox name/unread count with the account name.

- Removed the mailbox info loader in ABC.
  Instead, now the AccountSelectorAdapter loader loads the current
  account/mailbox name, and the unread count as extras.

- Now ABC.Callback.onMailboxSelected passed an account ID as well
  as a mailbox ID.

- There's new code paths that can cause the "fragment transaction in
  onLoadFinished" exception.  We need to fix this properly, but
  for now we just use commitAllowingStateLoss().

Bug 4948352

Change-Id: I73bb8b7530f8328ca1c86382ac0a54086ad061d7
2011-06-27 13:19:27 -07:00
Marc Blank
66a47b8dac Clean up/simplify ExchangeUtils/ExchangeStore
* Rename ExchangeUtils to EmailServiceUtils
* Create calls for Exchange to use (eventually remove these)
* Get rid of lots of nonsense in ExchangeStore

Change-Id: Ic538cfe1de57eca24088ee1f590264283d12f511
2011-06-27 12:14:04 -07:00
Ben Komalo
9e4a4149c8 Merge "Persist trusted sender set to preferences" 2011-06-27 10:00:53 -07:00
Ben Komalo
b1f3c2d73f Merge "Improved "show pictures" support." 2011-06-27 10:00:49 -07:00
Ben Komalo
ca22a51a9c Merge "Replace details dialog with expando subheader" 2011-06-27 09:58:30 -07:00
Ben Komalo
04795828d9 Persist trusted sender set to preferences
This makes it so that "always show pictures" from a sender works

Change-Id: I6e6c6d8dc78746d0828428b6c6256c4fff3eb111
2011-06-25 17:48:20 -07:00
Ben Komalo
66282fb6ff Improved "show pictures" support.
This is the UI part for remembering to show images based on senders.
It does not persist anything yet.

Change-Id: Iec40d9d1ace3661dabca2eed31ea6d0893be71e0
2011-06-25 16:54:09 -07:00
Brian Carlstrom
312b2fb561 Replace KeyChainActivity placeholder UI with more polished dialog (4 of 5)
frameworks/base

    Extended KeyChain.chooserPrivateKeyAlias to allow caller to supply
    preferred choice to be selected in chooser. This allows Email
    settings to highlight the current choice when allowing user to
    change settings.
	keystore/java/android/security/KeyChain.java
	api/current.txt

    Implemented KeyChain functionality to pass host and port
    information to KeyChainActivity for display.
	keystore/java/android/security/KeyChain.java

    KeyChain now sends a PendingIntent as part of the Intent it sends
    to the KeyChainActivity which can be used to identify the caller
    in reliable way.
	keystore/java/android/security/KeyChain.java

    Moved .pfx/.p12/.cer/.crt constants to Credentials for reuse.
    Added Credentials.install variant with no value for use from KeyChainActivity
	keystore/java/android/security/Credentials.java

packages/apps/CertInstaller
    Source of extension constants now in Credentials
	src/com/android/certinstaller/CertFile.java

packages/apps/Browser
    Have browser supply host and port information to KeyChain.choosePrivateKeyAlias
    Tracking KeyChain.choosePrivateKeyAlias API change
	src/com/android/browser/Tab.java

packages/apps/Email
    Tracking KeyChain.choosePrivateKeyAlias API change
	src/com/android/email/view/CertificateSelector.java

packages/apps/KeyChain

    KeyChain now depends on bouncycastle X509Name for formatting
    X500Principals, since the 4 X500Principal formatting options could
    not format emailAddress attributes in a human readable way and its
    the most important attribute to display for client certificates in
    most cases.
	Android.mk

    Changing the UI to a dialog, make the activity style transparent.
	AndroidManifest.xml
	res/values/styles.xml

    Layout for chooser dialog
	res/layout/cert_chooser.xml

    Layout for list items in chooser
	res/layout/cert_item.xml

    New resources for dialog including comments for translators.
	res/values/strings.xml

    New dialog based KeyChainActivity. Now also shows requesting app
    and requesting server. Now can preselect a specified alias. New
    link directly to CertInstaller.

	src/com/android/keychain/KeyChainActivity.java

    Fix KeyChainTestActivity to work with TestKeyStore changes that
    were causing network activity on the UI to look up the name of
    localhost. Also track KeyChain.choosePrivateKeyAlias API change.

	tests/src/com/android/keychain/tests/KeyChainTestActivity.java

Change-Id: I131f7708cede39669491a23ead3860907460d31f
2011-06-25 16:48:38 -07:00
Ben Komalo
5cba9c10ac Replace details dialog with expando subheader
Change-Id: I7b0f63b7b5ce7172ac32b8c00891005b9f2e28ee
2011-06-25 16:34:37 -07:00
Makoto Onuki
f9a9f52897 Fix header text on mailbox list fragment
Bug 4946676

Change-Id: I829c8df4a4e268e8807a3ec686dca5afdd173713
2011-06-24 18:57:47 -07:00
Makoto Onuki
6390b06e3b Merge "Add debug log to investigate bug 4905749" 2011-06-24 18:45:28 -07:00
Makoto Onuki
d8a2e33998 Add debug log to investigate bug 4905749
Change-Id: I1cfe12b0150490ec08caa02332bcca88521ff5fd
2011-06-24 18:44:31 -07:00
Makoto Onuki
329ca184e7 Merge "Yet another action bar fix..." 2011-06-24 18:43:49 -07:00
Ben Komalo
94c002349f Merge "Set list context through a central place." 2011-06-24 17:29:41 -07:00
Marc Blank
12b7932996 Merge "Clean up search handling in Controller" 2011-06-24 17:04:06 -07:00
Marc Blank
bad39b2e00 Clean up search handling in Controller
* Use same code for handling search mailbox for IMAP and EAS
* Allow "Load More" for EAS search mailbox

Change-Id: Id4a009c79a95302d627ff25f85e9c65bc461826f
2011-06-24 17:03:27 -07:00
Makoto Onuki
f4622a8ac7 Yet another action bar fix...
It's a temporary fix.  Proper fix underway...

Change-Id: I225e04168f7fae6a3b411659a27e79b28022ac40
2011-06-24 15:26:52 -07:00
Ben Komalo
78c450ab14 Set list context through a central place.
Bug: 4946658
Change-Id: I3f283088697b282b98a1c4e15ddf1f9641991806
2011-06-24 15:26:04 -07:00
Gilles Debunne
a8779053e5 Merge "Changed unknown source setting link" 2011-06-24 14:39:49 -07:00
Makoto Onuki
3c76df4f1f Workaround for bug 4946695
Proper fix on the way.

Change-Id: I22549d0e90b521d27271a8160fe8e43dae18defa
2011-06-24 14:21:27 -07:00
Gilles Debunne
9722c1bfed Changed unknown source setting link
This settings has been moved to Security.

Change-Id: Ifbb6edf28d258303bad5b39e0df34b9e8ea20d99
2011-06-24 12:31:02 -07:00
Ben Komalo
3db7f76fef Merge "Update notification text according to design" 2011-06-24 10:02:50 -07:00
Marc Blank
a05b6e1e92 Merge "New search implementation for IMAP in MessagingController" 2011-06-24 09:18:58 -07:00
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
6f93d2edca Update notification text according to design
- "UNSEEN new messages" is the title for multiple new messages
- the small number in the right shows the unread count

Change-Id: I48f761b727ea8abc9277d737a08789fa63d10871
2011-06-23 17:48:25 -07:00
Makoto Onuki
1ce33fd93f Revive the security hold check on the UI side.
Bug 4901767

Change-Id: Id8ccd3346f2d3008543df2107bab97ebe1a20fa6
2011-06-23 16:40:53 -07:00
Makoto Onuki
80d3875d30 Action bar: Use laoder to get current mailbox info
Before this CL, we had this crazy plumbing from MailboxListFragment
to ActionBarController to update the current mailbox name/message count.

This wouldn't work on 1-pane, so now ABC just gets the current mailbox id
from UIC and loads the name/count with its own loader.

Also...
- Fixed bug 4904450 and bug 4460470: Now we consistently use FolderProperties
to get proler display names and message counts.

- Renamed some confusing names in AccountSelectorAdapter

Change-Id: Ic7bea6da6d2859006fb8f9263024c7d5e62b1e7f
2011-06-23 16:06:45 -07:00
Ben Komalo
bf3e65b667 Disable hw acceleration temporarily
Bug: 4886133
Change-Id: I0f9efc200712815610ddc9013acc7eec25631180
2011-06-23 14:56:05 -07:00
Ben Komalo
bcdcc0458f Pass the entire list context to the listfragment
This allows us to read search properties and other things to determine
rendering state

Change-Id: If73269128a60e9992822774ebdba3d90a44d2d76
2011-06-23 13:32:24 -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
Ben Komalo
ed839dce77 Merge "Fix some things with shortcuts/widgets." 2011-06-23 11:53:22 -07:00
Ben Komalo
e10215eaff Fix some things with shortcuts/widgets.
- All mailboxes will be shown when selecting a shortcut for a normal
account.
- Combined unread won't show up in shortcuts for combined accounts
- only inbox is allowed for IMAP/POP widgets
- all mailboxes allowed for EAS widgets

Bug: 4725896
Change-Id: I5c77c2f5443e330ed451179761b1d9c8c0dd7619
2011-06-23 11:52:32 -07:00
Marc Blank
65cab2baa7 Merge "Prevent NPE when creating account..." 2011-06-23 10:59:34 -07:00
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
3873111033 Merge "Fix search bar sizing." 2011-06-21 23:16:21 -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
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
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
c9af8b2dbf Merge "Wait for initial sync in Welcome." 2011-06-21 14:37:12 -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
Makoto Onuki
9dad9ad973 Move restore account to EmailProvider.
In order to reduce the UI initialization code, move
let EmailProvider restore accounts when it opens the DB.

Backup can be moved too, but I just leave it as a TODO.

Change-Id: Id5c1810904db6abaecbfecbaa8d2d53834ebf07b
2011-06-20 18:19:17 -07:00
Jorge Lugo
ae95fbf4d0 Merge "Added quick responses." 2011-06-20 15:10:06 -07:00
Ben Komalo
2441dd5cbb Merge "Cleanup and collapse some methods together." 2011-06-20 14:49:47 -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
Jorge Lugo
d5fe048224 Improved saving of drafts when back key is pressed
In MessageCompose, pressing reply, reply all, or forward and then selecting
back without writing or modifying any part of the message will no longer
increase the draft count. Additionally, entering the compose window and
immediately rotating the screen before pressing the back key no longer
increases the draft count either.

Bug: 4584605
Bug: 4501806
Change-Id: I74db3f05d696b23fa7d0d64ae87e06fade4c57ee
2011-06-20 11:50:38 -07:00
Ben Komalo
a355a4abe2 Cleanup and collapse some methods together.
Change-Id: Ida38b63362c50052064d7a5342febfe9e4a9c89e
2011-06-20 11:30:24 -07:00
Ben Komalo
99401ebea7 Remove a layer of callback in inbox finder.
I'm changing it so that inbox finding happens at an earlier stage so
that the UIController.open() methods can be simpler. Specifically: I
want them to just always accept a mailbox, and not have to deal with an
intermediate state where it's still looking for a mailbox.

Change-Id: I1c5be783859a3bee7e46007e778de13eb1685cbe
2011-06-17 19:44:10 -07:00
Ben Komalo
facd131fad Merge "some brain dead typing shortening" 2011-06-17 19:42:06 -07:00
Ben Komalo
36f89da544 some brain dead typing shortening
Change-Id: I9342e8da52b412fd844b98ff76e61a9e4f9c5af7
2011-06-17 19:20:20 -07:00
Marc Blank
ed1dc9ee72 Support "Load More" for IMAP search
Change-Id: I47e5fd1fab421026ee52af72ba56338c69e9b467
2011-06-17 15:43:18 -07:00
Ben Komalo
ac11e3bb99 Some re-arrangements in UI for search.
This moves the logic for performing the search closer to where it will
actually happen (i.e. on Intent resolution). A lot of this is still
temporary code. I will follow up with some larger changes to extend the
UIController API so it doesn't have to do hacks internally.

Change-Id: I1eb84d26ee3dcbfa0b68dbd37dcb0a6180452962
2011-06-17 11:55:35 -07:00
Ben Komalo
f62fd3fd17 ensure that search mailboxes don't have parents
This causes issues in the mailbox list when trying to auto navigate to a
search mailbox

Change-Id: Ie4e43f20ec662a7c9304dd906ba5a58560cba9f5
2011-06-17 11:42:14 -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
Mindy Pereira
579d8d5da5 Merge "Integrate chips into Email." 2011-06-16 17:43:47 -07:00
Mindy Pereira
87763f0ae8 Integrate chips into Email.
Change-Id: Ice037a55a169037f725a667fad7714c7e9580b86
2011-06-16 17:41:04 -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
Ben Komalo
8401dba404 Merge "Handle upgrade from existing device admins" 2011-06-16 15:06:57 -07:00