Fixed how the autosync offset was being calculated.

Really, how did this work before? Oh well, that's why we code review... =/
pull/14/head
Tim Su 15 years ago
parent 89959b7784
commit c2ec12b343

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timsu.astrid"
android:versionCode="108"
android:versionName="2.8.3">
android:versionCode="110"
android:versionName="2.8.4">
<!-- ============================ Metadata ============================ -->

@ -100,12 +100,10 @@ public class SynchronizationService extends Service {
latestSyncMillis = lastAutoSyncDate.getTime();
long offset = 0;
if(latestSyncMillis != 0)
offset = Math.min(offset, Math.max(0, latestSyncMillis + interval -
System.currentTimeMillis()));
offset = Math.max(0, latestSyncMillis + interval - System.currentTimeMillis());
// give a little padding
offset = Math.max(offset, AUTO_SYNC_MIN_OFFSET);
offset = AUTO_SYNC_MIN_OFFSET;
timer.scheduleAtFixedRate(new TimerTask() {
@Override

Loading…
Cancel
Save