1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-03-15 08:29:24 +00:00
This commit is contained in:
M66B 2019-12-12 08:52:35 +01:00
parent 818045528f
commit 3084506c81

View file

@ -158,21 +158,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (networkState == null || accountStates == null)
return;
if (Looper.myLooper() == Looper.getMainLooper())
_post(command, networkState, accountStates);
else {
// Some Android versions call onDestroy not on the main thread
Log.e("### not main thread states=" + accountStates.size());
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
_post(command, networkState, accountStates);
}
});
}
}
private void _post(Bundle command, ConnectionHelper.NetworkState networkState, List<TupleAccountState> accountStates) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ServiceSynchronize.this);
boolean enabled = prefs.getBoolean("enabled", true);
int pollInterval = prefs.getInt("poll_interval", 0);