Issue 418

When no accounts are set for automatic sync, the MailService is
stopped.  When the MailService is stopped, the Android platform is
given greater leeway in killing the entire K9 process in order to free
system resources.
This commit is contained in:
Daniel Applebaum 2009-05-14 02:26:23 +00:00
parent 4a6f2e419b
commit 8e51d6cf14

View file

@ -41,7 +41,7 @@ public class MailService extends Service {
private Listener mListener = new Listener();
// private int mStartId;
private int mStartId;
public static void actionReschedule(Context context) {
Intent i = new Intent();
@ -68,7 +68,7 @@ public class MailService extends Service {
setForeground(true); // if it gets killed once, it'll never restart
Log.v(Email.LOG_TAG, "***** MailService *****: onStart(" + intent + ", " + startId + ")");
super.onStart(intent, startId);
// this.mStartId = startId;
this.mStartId = startId;
// MessagingController.getInstance(getApplication()).addListener(mListener);
if (ACTION_CHECK_MAIL.equals(intent.getAction())) {
@ -151,6 +151,7 @@ public class MailService extends Service {
if (shortestInterval == -1) {
Log.v(Email.LOG_TAG, "No next check scheduled for package " + getApplication().getPackageName());
alarmMgr.cancel(pi);
stopSelf(mStartId);
}
else
{