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:
parent
4a6f2e419b
commit
8e51d6cf14
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue