Commit Graph

48 Commits

Author SHA1 Message Date
Andrew Chen 41756802a1 Move hasConnectivity() method into a helper method.
It's now used in multiple places, so unify the logic into one place.
2012-10-05 09:07:16 -07:00
cketti be70120ee5 Use Service.onStartCommand() instead of deprecated Service.onStart() 2011-11-10 06:36:14 +01:00
cketti c5cc62b570 Removed AutoSyncHelper and use API 5 methods directly 2011-11-10 05:05:05 +01:00
cketti 807907cb9e Merge branch 'master' into issue549
Conflicts:
	res/values/strings.xml
	src/com/fsck/k9/service/MailService.java
2011-10-29 05:22:07 +02:00
cketti f345c33728 Removed useless try block 2011-10-29 05:10:13 +02:00
cketti 2d1f9f9c84 Reworked MailService to cut overhead when executing background tasks
Since MailService uses the auto shutdown mode of CoreService we can't
use CoreService.execute() with a startId parameter that is null. So this
change should also fix the problem some users reported where the pushers
weren't set up correctly.

See issue 2777
2011-10-29 05:08:37 +02:00
cketti afd355f83c Use Preferences.getAvailableAccounts() where appropriate 2011-10-18 05:09:20 +02:00
Jesse Vincent cbaa9f5b3d Work around cases where mail was last checked in the future.
Sometimes, user devices will have their clock misset. Previously, K-9
would just stop checking mail until the device caught up with the
future.
2011-09-05 22:16:04 -04:00
Jesse Vincent 8223e4d4bf Removed some doc annotations from chrisk's fix for the service stopping
issue (2777)
2011-09-04 16:13:19 -04:00
Christian Knecht 7cd6334c64 Stop service(s) if not in use - Fixes Issue 2777 2011-09-04 16:00:02 -04:00
Jesse Vincent 12d1097a24 Big, scary massive "ant astyle" to get us back to something
approximating AOSP coding standards.
2011-02-06 17:09:48 -05:00
Dan Applebaum 4842051de6 Immediately update the title bar when the syncing status changes due to external events. 2011-02-04 23:19:06 -05:00
Dan Applebaum ea3619b733 Display a message in the titlebar when K-9 Mail is not performing any message synchronization. This state will happen when no network is available, when background ops/background data/auto-sync settings turn off synchronization, or when no account is set for polling or pushing.
This revision respects the intention of r3011 that when K-9 Mail is
set for pushing only no message is displayed, as that condition is a
normal state.  However, it provides valuable feedback in other cases
that synchronization is off-line, as was done in r1433.

Although the case when the user has intentionally set no account for
polling or pushing can be considered "normal" and therefore unworthy
of a message, it turns out to be a significant burden to detect that
situation when the network is offline, since we normally do not even
try to figure out the account configurations in that case.  Therefore,
without making substantial, otherwise unwarranted, changes to
MailService.java, "Syncing off" would be displayed sometimes to such a
user, and sometimes not.  Since it is presumably a rare case, and
there is minimal harm to display the "Syncing off" message, the
message will be consistently displayed when no account is set for
polling or pushing.

Note to translators:
"Syncing off" is different than "Polling off".  The new phrase "Syncing
off" means that K-9 Mail is not performing any synchronization with
any mail server.  The prior non-English phrases for "Polling off" are
currently in-place as translations for "Syncing off", as it seems that
the meanings are close enough that it would be better to show the
obsolete translations that to fallback to the English "Syncing off".
However, better translations of "Syncing off" would be welcome.
2011-02-04 23:19:06 -05:00
Jesse Vincent de806f7715 astyle 2011-01-06 16:55:08 +00:00
Jesse Vincent fb6dfb3bde removed a commented-out method to show notifications on changes to
system connectivity
2010-11-28 21:48:29 +00:00
Jesse Vincent 14055691a3 Merge branch 'mail-on-sd'
* 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
  ...
2010-11-13 21:40:56 +00:00
cketti 5b88a99de0 Got rid of some compiler warnings. 2010-11-04 03:11:34 +00:00
Jesse Vincent ddccd11ef7 Try to send pending messages whenever we refresh pushers. should help
with "stuck" unsent messages on push-only accounts
2010-10-25 03:19:43 +00:00
Jesse Vincent 4f0bce1569 Simplify many, many boolean conditions with help from IntelliJ 2010-08-29 23:39:26 +00:00
Jesse Vincent ff5024eaec astyle 2010-08-18 02:48:55 +00:00
Jesse Vincent de16b21124 Add debug logging when K-9 doesn't enable push because the user has
configured push to be off.
2010-08-11 03:36:49 +00:00
Thialfihar 014b6c19c3 svn:eol-style=LF for src and XML resources
Fixes issue 1982
2010-07-13 21:49:28 +00:00
Jesse Vincent 1a66072910 find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs --unpad=paren 2010-05-30 04:17:00 +00:00
cketti 58b8479612 Code refactoring:
- Created "controller" and "mail.filter" package
- Moved a lot of classes to new/other packages
- Removed unused classes: NoSuchProviderException, MessageDateComparator
2010-05-19 18:17:06 +00:00
Daniel Applebaum 71c43b9634 Fixes Issue 1482
Utilize cketti's AutoSyncHelper in order to provide a way to make K-9
Mail obey the global Auto-sync setting.  K-9 Mail doesn't obey the
Auto-sync setting by default because K-9 Mail isn't listed as one of
the listed applications.
2010-05-15 21:26:15 +00:00
Jesse Vincent ba021597c4 astyle 2010-05-12 02:51:59 +00:00
Daniel Applebaum 6aeac22dad Fixes Issue 300
Fixes Issue 772
Fixes Issue 852

Issue 300: Handle incoming IMAP tokens in a case-insensitive manner

Issue 772: Add Yahoo workaround

Issue 852: Add configurable IMAP IDLE refresh frequency in Incoming
server settings

Also:
Add configuration option for whether push system executes a poll on
each connect.

Move the configuration for the maximum number of push folders to the
Incoming server Settings.
2010-05-09 15:27:41 +00:00
Jesse Vincent 8af7f4a7b6 find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs --unpad=paren 2010-04-29 04:59:14 +00:00
cketti 57cc4cd735 Code cleanup. Fixed lots of warnings reported by Eclipse.
- Removed unused imports
- Removed unused variables/code
- Parametrized raw types
- Added @Override annotations
- Added hashCode() when equals() was overriden
2010-04-16 12:20:10 +00:00
Daniel Applebaum e83a428107 Far more advanced poll scheduler. Now it remembers that finish time
of the last successful periodic mail and computes the next start time
as an offset from that successful finish.  The ramifications of this
new method is that changing polling interval on an account does not
force delaying all accounts to poll next in the future by the new
interval.  Instead, K-9 Mail now adjusts the next poll time based on
what the next poll time should be based on the last poll finish and
the new interval.  

Example 1: In the old way, if the old polling interval was 1 hour, and
the next poll was 50 minutes away (10 minutes have passed), and you
changed the interval to 15 minutes, the poll would happen 15 minutes
from now.  In the new way, the next poll will happen only 5 minutes
from now, which is 15 minutes since the last poll.

Example 2: In the old way, if the old polling interval was 1 hour, and
the next poll was 10 minutes away (50 minutes have passed), and you
changed the interval to 30 minutes, the poll would happen 30 minutes
from now.  The next poll would then happen actually 80 minutes after
the previous poll completed.  In the new way, it'll actually happen
immediately, because the time for the next poll, based on the new
schedule, has already passed.

Similar scenarios happen when a loss of network connectivity
occurs. In the old way, polling would resume using the restoration of
connectivity as the starting point.  Each time network connectivity
was lost and restored, the next poll would be further delayed.  *If
connectivity was lost and restored frequently, a poll might never
happen!* In the new way, the next poll is rescheduled based on the
time of the last successful poll, so will be rescheduled just like it
was before the loss of connectivity.  If the time has already been
passed, the poll will happen immediately.
2010-02-10 06:18:35 +00:00
Daniel Applebaum 790ae2e25c Fixes Issue 1194
Do both a poll and push reset when connectivity or background data
status changes.
2010-02-09 01:14:55 +00:00
Daniel Applebaum 164ee7cbfd Fixes Issue 1059
Only reschedule polling and setup pushing when necessary due to
particular setting changes.  Makes the K-9 Mail UI much more
responsive to setting changes that do not affect polling and pushing.

The poll schedule is deliberately only rescheduled when the period is
decreased.  An increase in period will still allow the next scheduled
check to happen as originally scheduled.
2010-02-07 21:23:33 +00:00
Jesse Vincent 64469e4b4e ran artistic style against src/com/fsck/k9/ 2010-01-14 01:07:28 +00:00
Daniel Applebaum 14587c3f30 Eliminate pointless, useless, deprecated, NOOP, incorrectly commented call. 2010-01-12 19:28:21 +00:00
Daniel Applebaum 64525028de Move execute into a re-usable location 2010-01-12 14:09:30 +00:00
Daniel Applebaum c86a46deb1 Preparatory for more BroadcastReceivers 2010-01-04 00:47:11 +00:00
Jesse Vincent 6a8ea924c9 Further log cleanup 2010-01-03 02:07:21 +00:00
Jesse Vincent eb54a99aab EOLs got twisted by something. fixing 2010-01-03 02:07:14 +00:00
Jesse Vincent 875dc31d5a Log message cleanup 2010-01-03 01:50:32 +00:00
Daniel Applebaum 921b022fb5 Enhanced header in Accounts, MessageList and Folder to show the unread
count, scoped for the Activity, the in-progress operation, the account
on which the operation is in progress, the folder for the operation,
when appropriate, and the progress of the operation, when it applies
to multiple items.  For the MessageList, also use the determinate
progress bar to show progress for synchronization of the folder being
displayed.

Fixes Issue 924.

Also, a minor change that might help with Issue 913, by putting the
insertion of the pending command into a background thread.
2009-12-20 00:02:46 +00:00
Jesse Vincent f31b2702a4 Massive rename to K9, step 1.
Conflicts:

	src/com/android/email/Email.java
2009-12-15 02:50:53 +00:00
Jesse Vincent eedfc0a839 step 1 of rename 2008-12-16 23:07:33 +00:00
Jesse Vincent f961cac9ac Allow notification without ringtone 2008-12-11 19:13:55 +00:00
Jesse Vincent 5491dee81b Damn it. Weird symlink-in-checkout bug. There goes our commit history. Sorry, all.
Guess I should go back to svk
2008-11-01 21:32:06 +00:00
Jesse Vincent 12c6e53141 bin directory should never have been checked in 2008-11-01 21:23:45 +00:00
Jesse Vincent c7de66484d more renaming. 2008-10-28 02:14:16 +00:00
Jesse Vincent c00ec35921 Grand insane rename, step 3 2008-10-28 01:22:17 +00:00
Jesse Vincent 7051cf8cc0 move step 2 2008-10-28 01:19:57 +00:00