Also includes a fix for saving a draft that's already
been saved (used to create a new one).
The following were unused:
- accountIdAddToField
- mailboxIdAddToField
- uisendmail
- uisavedraft
- uiupdatedraft
- uisenddraft
Deleting those also allows us to remove the translation
from the Bundle used by calls to the ContentValues used by
update (since the update paths are now gone).
Change-Id: I87f2875e3272177a128a8ff65541e51b1f2d05fc
MatrixCursor doesn't do this, so we need to add our own cache.
Depends on Ia5ffd31f54a2a335f495df5e0d1a0886ee08c14b
Change-Id: Ica78e3cec747bf86fcef16508156e359216c64fe
Migrate the old value as necessary.
Update the unit tests.
Cherry-picked from I1c276ffde3496cbc66846ed4a007088d39f20382 with
minor changes.
Bug: 7624838
Change-Id: I1b3fa331b62f556701bacba5ce9cd64305d9b52a
* Put most setup parameters in services.xml (at a later date
these can be obtained directly from services, but we're not
in a position to modify Exchange until next OS release)
* Make more parts of setup reference service information rather
than directly refer to specific protocols
* Base account type buttons on declared services
* Continue the effort to make Stores obsolete
Change-Id: I50d08f3c0676e606b6b6c09fc22571ee5a7690e6
Linkify email addresses in expanded message details
Remove divider line in upper header on phone
Embolden sender name
Twiddle expanded details line spacing and padding to match Gmail
Add space char to collapsed details recipient enumerator (comma)
Bug: 5520692
Bug: 5520787
Change-Id: Iad4a265168d111aa01654a33a9a14f7968fc3181
* Remove PolicyService APIs policiesRequired, policiesUpdated,
isSupported, clearUnsupportedPolicies, and isActiveAdmin
* Add PolicyService API setAccountPolicy, which is the sole
method by which security policies are promulgated
* Add protocolPoliciesEnabled and protocolPoliciesUnsupported
to the Policy class; these are packed, localized strings
indicating policies that the protocol itself have enabled
and/or cannot support (i.e. these are policies that are
unknown to the DPM, e.g. don't load attachments)
* Differentiate in security notifications between three kinds
of policy changes - changes that don't require user
intervention (e.g. reducing requirements), changes that
require user intervention (the legacy notification), and
changes that make the account unsyncable (e.g. the server
adding an unsupportable policy). Handle all possible policy
changes cleanly.
* Make security notifications per account (with multiple
accounts, notifications would get arbitrarily munged)
* Expose ALL enforced policies via the account settings
screen in two categories: policies enforced (including
both policies enforced by the DPM and policies enforced
by the protocol) and policies unsupported (note that these
can only be seen if policies are changed after an account
is created; we do not allow the creation of an account
when any required policies are unsupported). Add a
button that forces a sync attempt, for accounts that
are locked out, but whose policies have changed on
the server (this would otherwise require a reboot).
* Updated unit tests
Bug: 5398682
Bug: 5393724
Bug: 5379682
Change-Id: I4a3df823913a809874ed959d228177f0fc799281
This test has been disabled for over a year. I call it unnecessary and a
burdern at this point.
Bug: 2938323
Change-Id: I98bd67a0ed3bb1b880a5e7b6bcf8c90b8cf2de46
We always switched to combined view when we tapped "Starred" in a
mailbox list. This was confusing since tapping to show the mailbox list
will take you to the mailbox list for the combined view, even if there's
only one account on the device! Other confusing things happened like
showing coloured account chips, even if there's only one account.
This fixes it so that we pass the account ID when building the
selection. Lots of wiring to make it happen, but very little change
overall.
Bug: 5388326
Change-Id: I1fe52f211cceca0c1b26581e200f3c7adcd0734a
* We were using the deprecated ConnectivityManager for this; we should now be
using the setting in ContentResolver
* Also, remove broadcast receiver code that is no longer relevant
Bug: 5405352
Change-Id: I985a95071aea92d235a2708925f775b817ba2328
Welcome had some assumptions that some things had to be done
asynchronously, such as checking inbox status.
This can now be done on the UI thread and so transition into Email can
be done immediately in onCreate, except if there's reconciliating to
be done
Bug: 4599569
Change-Id: Iaaac21e73c985c60e1b7974fb0429948b35968e4
* Change handling of the providers.xml file to allow asterisk
as a placeholder for an individual domain name part
(the previous behavior was a very greedy wildcard)
* Add hotmail aliases using the new scheme
* Update unit tests
Bug: 5318329
Change-Id: I73a0dfcb956830b18c5460a1b3ddfc58459d08c9
This is needed so Exchange can fire up Email activities.
No change other than the move.
Bug: 5122497
Change-Id: I6ee3f61654745fafd444314ecf75eb8ae6bbd01d
We seemed to not properly fallback to querying the database if the cache
did not contain a mailbox of a specific type. We may want to consider
caching mailboxes related to PIM data, but for now this is a quick fix.
Also fixes unit tests.
Bug: 5019661
Change-Id: Idcac0a6f15aa7f174890ae586f478fbb8f6e05b7
- use title as ticker text
- also properly play notification sounds on new messages. Before, if you
left a notification unread, and a new message comes in, no sound would
be played. Since fixing that, it introduces another issue where on
initial sync, tons of new messages come in (and the sync could take > 1
min). We throttle them with a 15 second interval. The notification is
always updated to reflect the most up to date information, but sounds
will never be played closer than 15 seconds together.
Bug: 5020191
Bug: 5067059
Change-Id: I5ca474fd3b210ee856035bd78bd72931da80fe40
This fixes a crash on account deletion, leaving around bad accounts that
were in limbo
Also remove a test for an unsupported operation
Bug: 5051951
Change-Id: Ieebc7f769075614ae1a656cf123d8ce0313e611d
* Move AccountReconciler to the Email app (from EmailCommon)
* Ensure that Controller.deleteAccountSync() performs ALL actions
needed to clean up after an account deletion (delete attachment
files, reset policies, refresh the UI, etc.)
* Add reconcileAccounts() API to AccountService
* Remove accountDeleted() and restoreAccountsIfNeede() from the
AccountService API
* Remove unused callback
Bug: 4883073
Bug: 4767084
Change-Id: I43ffaf009db1a6f306bb0f2a74fb4dd3b2c4b966
* This prevents the possibility of RejectedExecutionException when
selecting large numbers of items
Change-Id: I8f9ba287d69021fdb99b4a8a30cc79755f669b97
Note: all unicode sending unit tests are broken due to chip issues. I've
filed a separate bug on that.
Bug: 5012204
Change-Id: I17392f65e5bd8349780b79d9cbe10492d8e7a7d9
The default recent list should be pre-populated and fall off the list as
normal. The previous implementation showed a default list if there were
no touched mailboxes, but then the default list disappeared as soon as
there was one touched.
Bug: 5020673
Change-Id: Ifad607a9d36feff837ab42d039ce9209f223f345
This is a manual cherry-pick of c379ebe372
This reverts commit 7fd14be804
The introduction of proper SD cards breaks the invariant that "external"
storage can be encrypted. Unfortunately, this means that accounts with
that policy bit set will have to be removed for now.
Accounts with the security policy set will be forced to go through
security provisioning on the next sync, using the regular mechanisms of
showing a notification with "Security update required", and then having
it fail. :(
Bug: 4466311
Change-Id: I68119b14f8d198779c2073296e228bc6772136ee
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
* 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
* 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
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
This helps post runnable to the handler and cancel pending runnables
at once.
It'll be used for delay-call methods that initiate a fragment transaction,
and cancel then in onSaveInstanceState().
Change-Id: Ib8bdb0e676e756854ab067a27e5e0f397219a4b4
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
- 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
- "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
* 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
* 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
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
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
* 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
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
* 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
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
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
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
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
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
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