Improved send quit

pull/217/head
M66B 9 months ago
parent ac21940289
commit 43bb732e08

@ -151,10 +151,6 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
} catch (Throwable ex) { } catch (Throwable ex) {
Log.w(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; 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) { if (process.size() > 0) {
EntityLog.log(ServiceSend.this, EntityLog.log(ServiceSend.this,
"Send process=" + TextUtils.join(",", process) + "Send process=" + TextUtils.join(",", process) +

Loading…
Cancel
Save