Fixed not stopping send service in some cases

master
M66B 1 week ago
parent 05331a1cf0
commit 63c4416631

@ -152,6 +152,15 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
Log.w(ex);
}
}
if (unsent != null && unsent.count == 0) {
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);
}
});
@ -172,15 +181,6 @@ 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) +

Loading…
Cancel
Save