* mail-on-sd: (40 commits)
Added more comments to explain how the locking mecanism works for LocalStore
Fixed wrong method being called during experimental provider initialization (since provider isn't enabled, that didn't harm)
Add more comments about how the various StorageProviders work and how they're enabled
find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs
French localization for storage related settings
Remove unused SD card strings (replaced with storage indirection)
Merge mail-on-sd branch from trunk
Reset mail service on storage mount (even if no account uses the storage, to be improved)
find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs
Migraion -> Migration
move the Storage location preference into preferences rather than the wizard.
Made LocalStore log less verbose Added @Override compile checks
Added ACTION_SHUTDOWN broadcast receiver to properly initiate shutdown sequence (not yet implemented) and cancel any scheduled Intent
Be more consistent about which SQLiteDatabase variable is used (from instance variable to argument variable) to make code more refactoring-friendly (class is already big, code extraction should be easier if not referencing the instance variable).
Added transaction timing logging
Factorised storage lock/transaction handling code for regular operations.
Use DB transactions to batch modifications (makes code more robust / could improve performances)
Merge mail-on-sd branch from trunk
Update issue 888 Added DB close on unmount / DB open on mount
Update issue 888 Back to account list when underlying storage not available/unmounting in MessageView / MessageList
...
because a long SQL query takes more time before starting to return
results, K-9 was increasingly slow on large folders.
Doing two searches may take marginally more time but starts getting
results back to the UI much faster.
- Removed the contact names cache (memory leak)
- Changed Contacts.searchByAddress() to Contacts.getNameForAddress(). Cursor is now immediately closed.
- Only try to resolve contact names when "Global settings" -> "Show contact name" is checked
- Never resolve contact names if number of recipients exceeds a threshold
- Don't instantiate an empty Address array just to throw it away (less gabarge collection)
- Use a StringBuilder rather than a StringBuffer (faster as it isn't synchronized)
Added an option whether the registered name color is change or not
Avoid "Connection error" when MessageView is opened. The contacts.getName() might return null.
deleting by message_id. I believe this was our last serious leak in
our flash storage
deleting message headers was....just wrong. we've fixed other similar
bugs inherited from android 1.0 before.
themselves up for download.
To do so, we need to start storing the original content-id and
content-disposition for attachments - this includes a database upgrade.
Based on a patch from @achen.code
Our previous implementation of UID FETCH didn't ever take into account
maximum command line lengths. When fetching, say 800 messages from a
GMail IMAP server, we could easily overflow the max line length leading
to a fetch that didn't get all the messages we wanted to and was
truncated before the description of which fields we want. That caused
K-9 to fetch complete messages, exhaust memory and ultimately fail,
even when we were just trying to get message lengths.
An equivalent fix needs to be made to seach by UID.
alias resolver to the core java nio version with a better charset
database;
rather than falling back to not showing the user a failing message, fall
back to showing the user the message as ascii -- it makes it possible
to get _something_ out of an unknown-charset message, rather than just a
"ha ha. no." error.
A race condition made the outgoing certificate being compared to the old
incoming mHost,
throwing an exception with an untrusted certificate dialogue to accept
or decline.
Correct thread safety on some member variables when doing null checks.
Explicitly check for mMessageCount == -1 and stop=true in idling loop.
However, the original error message "Message count = -1 for folder"
will still arise in some circumstances and is a valid error to
report.
Provide for only showing folders that are subscribed on the server
(IMAP only)
Also:
Change default for Notification behavior to the old way. Make going
to the search for unread messages off by default.
Fix up some hiding of labels, etc. on the incoming server settings.
Check for message suppression in search results.
Fixes Issue 1664
Issue 1643: Some servers respond with an untagged EXISTS to every
NOOP. This change parses through all untagged responses in a loop
until no more are being generated, avoiding calling internalOpen each
time.
Issue 1664: I have never personally seen this error, and the log looks
like a thread safety problem. mMessageCount is being set in one
thread (the IDLE thread) but not properly visible in another thread
(the check mail thread). mMessageCount and other ImapFolder private
variables are now volatile in hopes of correcting this problem.
Enhance K-9 Mail to be more tolerant of non-compliant IMAP servers.
Do not require a space following the + in command continuation
requests. The rest of the token parser will swalow the space if it is
actually there but we don't really need it.
delimeter, but only if the server does not support NAMESPACE. Since
we've encountered non-compliant servers that freak out at the LIST
command, enclose in a try/catch structure so that failures do not
totally prevent IMAP communication.
- Created "controller" and "mail.filter" package
- Moved a lot of classes to new/other packages
- Removed unused classes: NoSuchProviderException, MessageDateComparator
Simplify WakeLocks use by pushing.
Correct fault in IMAP IDLE WakeLock usage. The ThreadLocal in
MessagingControllerPushReceiver meant that the WakeLock acquired when
the DONE was sent was not being released when entering back into IDLE
state.
Consolidate the account notification so that all Activities use the
methods in MessagingController.
Fixes Issue 1577
Issue 1551:
Some IMAP servers send untagged EXPUNGEs to IDLEing
clients without ever haven't sent an untagged FETCH. The untagged
EXPUNGEs are harder to deal with because they don't have a UID. So,
if the user has elected to have the IDLE connection start with a poll,
we can maintain a map of message sequence numbers to UIDs that we can
use to figure out which message to delete. To mitigate the risk of
the map falling out of date, we do a UID SEARCH UID before removing
the local copy of the message, just to make sure the message is really
gone from the server. If we detect an error, do another poll to
resync the map.
Issue 1577:
Restore the removal of notifications for an account when the account's
unread message count goes to 0.
Fixes Issue 1562
Issue 1474:
Provide new facility to totally wipe all data for an account but leave
settings intact. This is useful because sometimes storage is so full
that SQLite cannot perform the usual VACUUM or message deletion.
Add confirmation dialogs to destructive Clear and Recreate operations.
Remove destructive Clear from FolderList so as not to have to
duplicate the confirmation dialogs.
Issue 1562:
Suppress notifications when new messages arrive in Trash, Sent or
Drafts special folders.