mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-28 03:36:45 +02:00
Improved send quit
This commit is contained in:
@@ -151,10 +151,6 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
|
||||
getMainHandler().removeCallbacks(quit);
|
||||
if (unsent == null || unsent.count == 0)
|
||||
getMainHandler().postDelayed(quit, STOP_DELAY);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -176,6 +172,15 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
|
||||
}
|
||||
handling = ops;
|
||||
|
||||
if (handling.isEmpty()) {
|
||||
if (!getMainHandler().hasCallbacks(quit)) {
|
||||
long at = new Date().getTime() + STOP_DELAY;
|
||||
EntityLog.log(ServiceSend.this, "Send quit at " + new Date(at));
|
||||
getMainHandler().postDelayed(quit, STOP_DELAY);
|
||||
}
|
||||
} else
|
||||
getMainHandler().removeCallbacks(quit);
|
||||
|
||||
if (process.size() > 0) {
|
||||
EntityLog.log(ServiceSend.this,
|
||||
"Send process=" + TextUtils.join(",", process) +
|
||||
|
||||
Reference in New Issue
Block a user