* in onActivityResult, we not only need to update the Account, but also
the relevant HostAuth (both if coming from AccountSetupExchange)
Change-Id: I0657ff257fe949e46e100eb3e6cfec6162514aa9
* Otherwise, there's a chance that various activities will be
disabled (like MessageCompose), even if there are existing
accounts.
* Enable BootReceiver by default
Change-Id: Id4669c41a846545d8bac5ad85736e1508074864a
* syncServerId in the Message table can now be NULL; this broke a test
used by EasOutboxService and SyncManager to determine whether there
were sendable messages in the Outbox
* Changed test to allow for NULL in syncServerId
Change-Id: Id76c7a45bc306abe7a927ab2395700f54a01a298
* Add new introText column in the Body database
* Reply/Forward put the appropriate String into this new column
* Rfc822Output uses this when required when streaming the message
Change-Id: I34602fdb3f91692c46fc8bc31ba0e6f680d445a0
* If not, it will start the service
* This will catch cases in which the Email process has been killed
while alarms are set (this would be the vast majority of the time)
* Will look into ways of catching any remaining cases...
* Fixes#2131432
Change-Id: Id71e68d14b5d1b0402c866db49a07c7b1adf499d
* Our AccountManager listener was getting unregistered due to the way
ApplicationContext caches AccountManager in a static member
* The result was that AccountManager registers its listeners against the
FIRST context it is instantiated with! Future calls will all obtain
this pre-initialized AccountManager.
* In this case, AccountSetupOptions was the first caller (to create the
AccountManager Account for Exchange)
* The subsequent call to register a listener therefore had its registration
tied to the context of AccountSetupOptions, and was therefore leaked
when AccountSetupOptions finished!
* This caused a chain of problems - the leaked receiver, an Exception in
AccountManager when trying to ping the listener in an expired context,
and eventually the bug referenced above, which became a P1 issue
Change-Id: I478e28d21ca77419afa8011e4ed8101cdf67ab79
* Fixes#2135238 in which a change to a POP/IMAP mailbox
ended up causing a sync of that box as an EAS mailbox
* The fix is to check that mailboxes with changes actually
belong to an EAS account before trying to sync them
Change-Id: I832095ce61665813cbcfb2aa58e45a48db8a34e7
* Get rid of old Account.getxxxFolderName() calls.
* Clean up any call sites to them
* Properly rename the existing special folder name identifiers
* Use a hash table in MessagingController to improve identification
of special folders for IMAP accounts
* Fix a bug in Controller, which was creating new server-side folders
using localized names.
* Fix a bunch of code in Controller that was using mContext, instead of
using mProviderContext to support testability.
* Fix broken unit tests in ControllerProviderOpsTests
Fixes bug 1904373
* Check that SyncManager's thread is running when called for startSync;
if not, start the service via Intent
* Mostly fixes#2133115 (although there are possibly other cases for
SyncManager not running, this will cause any manual "Refresh" to start
it up.)
* Added large comment at onCreate to explain how all this works
Change-Id: Ib43211ddb36e2f79ee5b1f6973f8bc2bc499024c
* Improve appearance of basics screen and use simplified text
* Provide alternate text when in EAS account setup flow (from acct mgr)
* Change "Exchange/ActiveSync" button to "Exchange account"
* Add some spacing to the three buttons, to improve appearance
Bugs addressed:
2128055 Change string in account picker activity to Exchange
2132713 Welcome message for Email app is inappropriate when coming from
Settings -> Accounts & sync -> New account
* SmartReply doesn't put in header information related to the original, which
looks like a bug in EAS, so we add our own (as we do for SMTP)
* SmartForward works properly, but doesn't put any CRLF between the new text
and the original; we fix that by adding one after the original text.
* Addresses #2132658
Change-Id: I48efec0d02598a8e9ce2a54b4c66464e8e62e5d6
* Save reference to LoadMessageTask and cancel it in onDestroy
* Check whether we've already processed the source message
before calling processSourceMessage
* Fixes#2097361 (Duplicate addresses in reply/reply all)
* Fixes NPE (not in Buganizer) related to fast orientation changes
due to duplicated background task
Change-Id: Ib8115e29c9d88db1be009df4f549f925db8a1c19
* Don't use unneeded managed cursors
* Put more of the DB work in async
* Don't try to load HTML and plaintext simultaneously
* Explicitly catch & handle exceptions during db ops
Bug # 2087051 (see also bug # 2122960 re unexpected db exceptions)
Change-Id: I446086bc4f3a85b2e766b12d1f7271e61e3ae8d5
* Since transactions can be nested, get rid of pointless/dangerous
flag for indicating we're in a transaction.
* Fixes#2131847
Change-Id: I2955e8a7659533e8ee9e71b949a042570466df45
* Make sure to null out vars in onDestroy
* Use START_STICKY as return value for onStartCommand
* Start SyncManager from EasAuthenticator callback, rather from the
authenticator itself (otherwise, the Account might not have been
created when we start SyncManager)
Change-Id: I54ff8d5586e96f016b365587717710dee3202da8
The IMAP & POP messages are being stored with cc="" instead of null,
which is taken care of by testing the output of toFriendly() instead
of the raw field from the DB.
Change-Id: I9460e7ae098ac5cd0ccd527381ffd4e6d9defae4
We lost the reporting of connection errors in the UI. These were
originally displayed in FolderMessageList, under the name of each folder.
In the new implementation, we borrow the "undo" banner from Gmail and
display it whenever there is a connection error in a mailbox.
* Add banner, and code to animate it on/off the top of the list.
* Toggle banner whenever a connection state change occurs in MessageList
* Toggle banner whenever a connection state change occurs in MailboxList
* Slight change to callback semantics for sendMailCallback
As part of http://b/2087222 we have a new API specifically
for launching FastTrack. This allows SHOW_OR_CREATE to be
returned to its original behavior.
I've tested this change and confirmed that it's WAI, and
may have also fixed up some deprecated references.
* Remove SSL-Optional and TLS-Optional choices from UI
* Remove SSL-Optional and TLS-Optional choices from providers.xml
* Switch over most SMTP connections from 25 to 587
* Clean up the providers list which has a lot of "optional" cases
that were probably falling back to unencrypted.
Fixes bugs:
2110243 Settings UI shouldn't offer SSL/TLS (if available) options
2089070 Update list of providers
Change-Id: I57be57b349eed33a5284121d904528279a36a91c
* This reverts commit 3f224e7efe.
* Use StructuredName.DISPLAY_NAME for Email display name on upload
Change-Id: Ic11713773d0e5b0db452dce3c9c31680ca45dbf5
This cleans up a number of bugs that could be generically described as
"MailService and Notifications not being updated when accounts or account
settings are changed."
This also fixes a number of race conditions, one of which was causing
accounts to be refreshed in a nearly-endless loop, and another which
could cause an endless loop of alarms to be posted & fired..
Specific changes:
* Update/reschedule any time an account is edited (this was accidentally
broken and being handled on EAS only.)
* Make sure we reschedule if an account becomes unavailable
* Clear notifications whenever refreshing accounts
* Reload local copy of account settings whenever refreshing accounts
* When restoring prev sync times (this happens when process is killed),
be sure to also recalculate next sync times.
* Set flags on the pending intents to make sure old pending intents are
not being reused.
* Set a watchdog each time we check the mail, so if we are killed during
the mail check, we will be woken up again to retry.
* Fix a 2nd race condition in which a just-created account fails to sync,
due to not (yet) having an inbox.
* Clean up handling of Controller callback:
* Fix a minor bug in which refresh of non-inbox mailboxes would delay
the next timed sync of the inbox for that account.
* If the checkmail ended in an error (result != null) the service was
never rescheduled.
Bugs Fixed:
bug 2078149 - Update service and notifications when account settings
change or accounts are added/deleted.
bug 2084412 - Fix race condition caused by first intent being refired
bug 2071484 - Make sure we wake up later if killed during mail check
Change-Id: I3ee0d1b389c652351de5eb798c32a2daea244067
* This is not a backward-compatible change (sorry)
* Existing AccountManager EAS accounts and contacts are deleted
* Existing EmailProvider data is deleted
* Change works with new code (stadler) to avoid account duplication
Change-Id: Ife09c51fa714d91054d017b497bce603add5375a
* Write unit test to replicate failure(s) in POP3 use of parseInt. All
calls to parseInt must be guarded by try/catch NumberFormatException.
* Fix the failures
Bug # 2115586
The basic failure mode is to delete an account while it is being
synced or some other background activity. The fixes in this CL will
harden against this, but it will not be a perfect solution; That
will require shutting down all sync, which is difficult in the current
too-many-threads implementation.
Primary bug# 2112564
* Check for existing accounts with matching servername + username
* Show a dialog and block account creation
* Triggers in three cases:
* After input of an auto-setup account (e.g. Gmail or AOL)
* After input of manual setup (incoming) parameters
* After changing incoming parameters of *any* existing account
* Made some notes in EmailContent regarding fields in HostAuth that we
are not actually using.
* Added HostAuth unit tests
Primarily fixes bug # 1964449
Bonus fix for bug # 1594408
Change-Id: I49310faf6654280582e0ab3d3e40f2701bfcd21d
* SmartForward and SmartReply are EAS commands that automatically
include the original message and, if a forward, all original
attachments, regardless of whether they've been downloaded to
the device
* Both commands improve battery life by sending less data; greatly
so for SmartForward if there are attachments
Change-Id: I12432cd5275a3b54e9a80d5cd59da437c4a086cc
* Have Welcome start the service (in case the app has been reloaded)
* Have SyncManager.ping start the service if there's no instance of
SyncManager
Change-Id: I8bed2843a3e065d2db29fad67dfb0bb3a5d0ff5e
* Do a short ping in this case, which at least will allow the device
to sleep while waiting
* Addresses #2116749
Change-Id: I9e70feaeef1361e1d66652dc66b92f6ee14751bf
* Move creation of final reply/forward text (i.e. new text plus
the original) to Rfc822Output, where it belongs.
* Prepares the way for use of SmartForward/SmartReply in
Exchange and replying w/ multipart/alternative in SMTP
* Moved test from MessageCompose to new Rfc822OutputTests, and note
that new tests should be added (this is not a regression; there
were never enough tests here)
Change-Id: Ibefb842f47cc9223714856d99b8d4f55b55f49e3
* Also remove some logging and correct some erroneous logging
* Fix the backoff behavior on IOException
Change-Id: I5fb5a0bf73eaa681eb7b9c305c838e78e7ba88ab
BUG:1904421
* update READ/UNREAD indications
** don't change color chip
** change background color
* Change Date
* Change the position of attachement icon
* Change menu icon for folder
* Edit Controller.deleteMessage() to handle both cases
* Refactored to start from processPendingActionsSynchronous() and
dispatch to series of smaller methods to handle deletes vs. updates
and the details of the various specific operations.
* Added processPendingDeletesSynchronous() which looks for delete-from-
trash and does the right thing locally and/or remotely.
Fixes bug # 1811026
* Define new message-loaded state "FLAG_LOADED_DELETED" (used only for
POP3, which needs to write sentinel messages that are not displayed.)
* Also renamed the other flags to make the naming more consistent.
* Tweak MessageList query generation to inhibit display of deleted
message sentinels, and MessagingController won't try to resync them.
* Clean up implementation of Controller.deleteMessage()
* Add support for move to trash to MessagingController. This operates
in three primary modes:
* POP3 local delete (no server-side interaction)
* POP3 server delete
* IMAP server delete (and copy to IMAP trash mailbox)
* Add missing implementation in provider to delete all of the attachments
for a given message
* Fix progress reporting in activities (the test for error vs. progress
was inverted, which caused progress indicators to keep spinning
after errors.)
* Fix broken account settings UI (POP3 delete policy was not persisting)
Addresses bug 2097409
TODO delete from trash / empty trash
Change-Id: I00188e6dc2093823106e009f35b68c760227c9e6
* There is a better way of implementing this, which I'll write up in
Buganizer, but this will help our battery life testing
Change-Id: I2583f0cb9c62b38aee64166138385d7b14855832
* This is required to due a change in ContactsProvider2 that removes
type information for these fields
Change-Id: I993aebdcace0e1db538a85afdea3389fe41518d8
* Fixes 2048663, 2025029, and 2100131
* Add "Trust Certificates" checkbox in EAS account creation
* Use custom ClientConnectionManager for HttpClient with registry
for plain, ssl, and tssl (trusted ssl) connection
* Use a ConnectionPool for HttpClient connections
* Remove "Domain" checkbox in EAS account creation
* Remove tests related to the "Domain" field
* TODO Write a test for valid usernames (requires a bit of research)
<name>, <email address>, <domain>/<name, and <domain>\<name> are all
valid, but there might be others
Change-Id: I4a0338df5960bfd3d679a88aaf22d1c49f49992b
* Set reply/forward flag and sourceKey as appropriate in MessageCompose
* Update provider tests accordingly
Change-Id: I7f49d80a735314a1a38f09fbf1f234257c41af8c
* Also create a bogus account if none exists to prevent setup failure
* Fixes#2087413 (Email large tests failing with Unknown URI)
* Fixes#2097361 (Duplicate email address when replying...)
Change-Id: I9ca2ac5f98db43e9009c22421c69956440356e34
- fix doPrevious() which was not correctly moving the cursor due to
bug 2100645
- correctly handle configuration change (keyboard open/close) by saving
the current message
- reorder the operations in onDelete: first move the cursor, and next
delete, to avoid the possibility of the observer call happening with
the deleted message as messageId.
* People using multiple accounts without this change could end up with missing folders
* Fixes 2099514
* Database version incremented; this change will cause a database wipe
Change-Id: I08d23fa54d8194758e1f7c2ffb528a14bc184f08
- display "saved as draft" toast for save draft.
- don't display tost for send.
- don't cancel the sender task, let it complete.
- synchronize on mDraft although not sure that it's needed.
- fix the query for presence status.
- put it in an AsyncTask instead of Thread, remove from Handler.
- set the target rect when invoking the presence bar.
To improve functionality of next/prev buttons:
* Stop using managed query for next/prev cursor, so requery won't
run in UI thread. Add explicit lifecycle management.
* Requery on every onResume()
* Use a listener to catch external changes. This applies both to synced
changes and also local deletes.
* If we ever find ourselves out of the list, finish() immediately
to avoid any race conditions.
To reduce flicker & other problems during msg-to-msg navigation:
* Clear attachments list so it doesn't accrete as we navigate
* Clear body so we don't show previous body with newer headers
Fixes bug 2076472 and (possibly) 2069241 & 2078933
BUG: 2065601
* Show Unread Count of Accounts in AccountFolderList
* Change the background according to the folder's type
* Change the style of unread counts
TODO: Change background images of Unread Count
* Use concrete declarations, not the old sample code
* Remove unused "sample" code
* Create ExchangeSender.java
* Strip out the unused (old sample code) parts of ExchangeStore.java
* Unit test to make sure EAS is being offered
* Fix "account leak" in AccountSettingsTests
This was triggered by donut bug # 2092944 but the solution is
different because we support EAS here.
* Add reply columns to Body
* Remove a bunch of unused columns from Message
* Update SQL tables, content read/write, etc.
* Small tweaks to app code that was not-really-using the old columns.
* Update existing unit tests for new/changed columns
* Disable TagsTests to solve a tests failure (prexisting, not caused by
this CL)
Change-Id: Ief493796dfe219669755170d76786f91570cbb9b
* Respect the UPLOAD extra from SyncManager and check for changes before starting
a sync.
* Failure to do this was causing looping behavior
Change-Id: Idfb1c35782b6d3771f9455c6fe86489572a871c5
It was broken by CL 22378.
The bug was in the situation when "==" (two padding chars) were at
the end, the reading did not stop after the first '=',
and thus one more char of output was generated.
Add more unit-test for base64 decoding.
* Add \FLAGGED support to IMAP (writeback)
* Add code in Controller to kick MessagingController
* Rewrite pending commands system to scan through provider's updated
messages table and react
* Fix a unit test that I broke
* Cleaned out some of the old PendingCommand support
Addresses the 2nd half (upsync) of bug 1904385
TODO:
Can I add a unit test for IMAP flag writer?
Change-Id: I5a96a695d4f35fca1395506f165b86d9fb19b543
* Put most of onDestroy code into the run method of SyncManager's thread
* Clean up code for updating Mailboxes' SyncKey and interval
* Fixes 2080472
Change-Id: Ie16c851a686142d9fd1d810a942aa786690b1034
* Don't create our EmailProvider Account until we get a confirmation from
AccountManager that the system Account is created
* Put up an erorr dialog if AccountManager fails for some reason (this is
what we saw in bug #2072668)
- fix bug 2080075, reply to message without text body.
- workaround bug 2077496 by temporarilly disabling the address adapter.
- unit test for MessageCompose.buildBodyText()
- use precompiled regex
* Set the star and the read/unread states properly when a
message is downloaded for the first time.
* Update them on already-downloaded messages.
This is download only - not upload
Bug 1904385
Change-Id: Id03a0957677bb39f4a57ed0542eaa8accc36ab48
BUG: 1904403
* Change the text of READ/UNREAD button dynamically according to the state of selection
* Change the text of favorite button dynamically according to the state of selection
* Final list of options while normal mailbox is shown
* New list of options while smart folder is shown
* Correct lists of context options for drafts, outbox, trash, and
everywhere else (full list)
* Enable reply, reply all, and forward
TODO: needs a better icon for menu->folders
Resolves bug 1904421 items 4a, 4b, 5a
Resolves bug 2078092
This happens in two primary cases:
1. When a very large POP message was skipped during initial sync
2. When any message was interrupted during initial sync, e.g. by
a dropped connection.
Changes:
* Added loadMessageForView and callbacks to Controller (and touched all
files with Controller listeners)
* Rewrote loadMessageForView in legacy MessagingController to work with
provider.
* Update flow in MessageView to use loadMessageForView when needed.
* Restored the use of "loading.html" and "empty.html" assets (although
I think we should replace them with simple layouts & views.)
* Some random cleanup in MessageView
Satisfies bug # 2065563
* Refactor the sync adapters to separate out parsing from commit
* Use ContactsProvider to save the SyncKey for contacts
* Fixes#2072664 and #2072456
Change-Id: I1e85c498496e83d9523489636a75f366f7fbd106