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
To fix "IllegalStateException: Can not perform this action after
onSaveInstanceState".
Bug 4522010
Change-Id: I640fab0d51b02467f2f91d0d33091e1daac356fd
- 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
* Rename ExchangeUtils to EmailServiceUtils
* Create calls for Exchange to use (eventually remove these)
* Get rid of lots of nonsense in ExchangeStore
Change-Id: Ic538cfe1de57eca24088ee1f590264283d12f511
This is the UI part for remembering to show images based on senders.
It does not persist anything yet.
Change-Id: Iec40d9d1ace3661dabca2eed31ea6d0893be71e0
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
* Use same code for handling search mailbox for IMAP and EAS
* Allow "Load More" for EAS search mailbox
Change-Id: Id4a009c79a95302d627ff25f85e9c65bc461826f
* 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
- "UNSEEN new messages" is the title for multiple new messages
- the small number in the right shows the unread count
Change-Id: I48f761b727ea8abc9277d737a08789fa63d10871
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
- 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
* 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
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
* 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
- 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
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
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
* 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
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
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
* 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
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
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
- 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
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
* 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
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
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
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
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
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
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
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
* 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
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
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
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
This enables the provider to count the number of contacted
per email address basis, which should improve auto-complete
quality.
Bug: 4371572
Change-Id: I4f0e586d3edff5a460e33dc7d9f9680119a8d568
This is a stopgap fix prior to getting designs in to at least make the
various message view components visible on screen so people can at least
use the app.
Note that this also removes reply all/forward, as per the design (the
idea is you can switch in the compose view, so we don't want to waste
real estate in the message view).
Bug: 4644072
Change-Id: I86f041678373a0fbc79a2e135a47cd1e5b1357c7
This simply allows the user to select a certificate from the KeyChain to
use for credentials.
Text and UI not finalized.
Change-Id: Ib86abc3c2e899640218122caa12308dc9646dab6
- Instead of the search dialog, show the search widget on the action bar.
- Launches a new activity for search, but still uses the temporary search code
- Search still works only on two-pane.
Change-Id: I1d36ad3416c7dff9579cf37e40e49e31c9d99219
When moving messages using the move-to dialog, exclude the source folder from
the list of valid targets.
bug 4585929
Change-Id: Id02c05f38d1623f0c059d84e50ee1b51a1cdec1a
For the one pane view, it's possible that an account has zero items in the
recent list (this is only possible for accounts that do not have neither
a "drafts" nor a "sent" folder). In such situations, we will still want to
have some header to distinguish between the accounts and the "show all
folders" item.
Change-Id: Ic5d6368b88ba4a28904c3b78a6489d06345a901e
* Remove per-store limitations
* Use constants for VISIBLE_WINDOW, rather than having the
potential for differences between Stores
Change-Id: Idd5e0874bba6e3390e4f093bcb03f4b1bb399c11
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
This is a stop gap fix for b/4584196
There was a race condition in which the actionbar callback happened
prior to the fragments being ready, and so any callbacks on a mailbox
would explode (and the spinner mistakenly thought the header was a
mailbox)
Change-Id: Id0a24d252472faf97088175b5c413ef554dc3b76
We don't need to worry about state loss here. If the fragment state is already
saved, the loader will re-fire when the fragment resumes and we'll proceed to
mailbox selection / account list as expected.
Also; only add the account selection fragment to the back stack if there is
more than one account.
bug 4558901
Change-Id: I38290fa378ac80ef5a5c8cf25c38b6e820715366
- Allow going back from the message view to the message list with restoring
all the state on the message list. (batch selection and scroll position)
- Also make "back" work for the message list <-> mailbox list navigation,
but only 1 level at most.
(Only the system back key works for this; the action bar home icon will
not.)
- As discussed offline, it uses our custum "back stack" (which can hold
at most 1 fragment) using the new fragment APIs, attach and detach.
- Removed commitFragmentTransaction() from the base class, as now there's
nothing really in common between the two UI controllers in terms of how
they use the fragment transaction.
Change-Id: Id626ce99beb1f4dceb999dc04bf7d3e5d57a8198
For the non two pane devices, we only show the recent mailbox list in the
account spinner (and not on the mailbox list fragment).
For two pane devices, we only show the recent mailbox list in the mailbox
list fragment (and not on the account spinner)
Change-Id: I1094626532ad6d6548ef441929d94546c97304a3
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
Because isViewCreated() is used by updateSelectionMode() which is called from
onDestroyView(), we can't use getView() to determine if the CAB should be
shown.
Change-Id: I8d868998031115800766000fb0128f1d1d3541cd
Fixes two issues:
1. if a recent folder was selected from the spinner, the user could not
re-select it (even if they navigated to another mailbox using the mailbox
list) unless they manually selected another element in the spinner
2. the recent item "show all folders" did not set the associated account
position, so, when selecting that item, the spinner was not showing the
correct view.
Change-Id: I469f9f28aebd36a348534def28a4c476c0df366d
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
should be used.
From now on, UiUtilities.useTwoPane() should be used to see which UI
should be used.
You can pass the DEBUG_PANE_MODE extra when launching Welcome
to force which UI mode to use. (See the comment inside Welcome.)
Change-Id: Iefa3737e4979eb55f7986a9033ff9c6266d32f52
The one pane view will always have something in the recent list (either the
default recent list or the "all folders" item).
Change-Id: Ic264b59dc25504a8ce75bea6efae53a0d5dede87
- Now we "uninstall" a fragment in Fragment.onDestroyView.
i.e. a fragment transaction is actually executed.
- Maintain our own "about to be removed" fragment list to avoid
double removal of a fragment.
Change-Id: I61328e0a09a7af00cbb0e6ba10a2d39c11b5c3dc
Previously, we were deciding whether to show the spinner if the returned cursor
had more than 1 element. However, the cursor would _always_ have more than one
element because it contains a header in addition to the account information.
We now save away the number of accounts and the size of the recent list into the
cursor so we can use those counts to determine if the spinner should be shown.
Both of these counts are necessary as we want to show the spinner even if there
is only a single account as long as it has at least one recent mailbox.
Change-Id: If428c496a548a25f6b5cd7301ddb5c0d6876750c
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
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
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
- Now that fragment useage is simplified (e.g. no new fragment
creation for nested mailbox navigation), most of the fragment
operation code for 2-pane is reuseable for 1-pane as well,
so moeved it to the base class.
- Temporarily added "Show all folders" as a menu option on 1-pane.
- Added "opener account id/mailbox id" to the message view fragment.
They are not used by the fragment itself, but they're used
by the UI controller for the back navigation. (And now the UI
controller doesn't maintain the current IDs by itself; rather
it gets them from the currently-active fragment.)
- Use async fragment transaction on 1-pane too, now that it always
gets the current state from the active fragment.
- Changed the timing when we install fragments from onAttachFragment
to fragments' onActivityCreated. So now all installed fragments are
created.
TODO Now that all installed fragments are guaranteed to be created,
remove all special trealment for the fragment argument accessor.
(They were meant be safe to call before onCreate, but it's not
necessary any more.)
Change-Id: I0ed100c3f0b460835b164c0dc908ea483a4e46ee
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
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
the spannable string builder assumes the given char sequence is non-null.
we now ensure that's always the case.
Change-Id: I12e7081e5348d797feab6ad17452b73a52feaf13
The mailbox list for widget configuration should only include two mailboxes --
1. an account's full inbox (both read & unread) and 2. an account's unread
inbox (similar to #1, but, only contains unread messages)
This also applies for the combined account view.
Change-Id: I5640fd8572d385703db04ca613f5b1f35f3952da
- Moved MailboxFinder logic to UIControllerBase so it can be reused for 1-pane.
- Make sure MailboxFinder runs only while the activity is resumed.
(we don't want to get callbacks when it's not, because we can't perform
fragment transactions.)
- Make sure MailboxFinder is restarted if the activity gets re-created
while it's still running.
Bug 4522010
Change-Id: I4486ecfa44dd700d28c424bc5eb7104d3043cf7d
- The drawable for the active drop target background was static, and
shared between items. But StateListDrawable has inernal state and
shouldn't be shared.
- Also make sure not to set the same background more than once.
For some reason, they will cause visal glitches when we switch to synchronous
fragment transaction.
Change-Id: I10fede2ad4e595f74d61768907b5b70fd5d4da21
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
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