Fix recently introduced automatic repo scan bug
This commit is contained in:
parent
222001f14d
commit
8415cc2e0a
@ -88,16 +88,20 @@ public class UpdateService extends IntentService {
|
||||
|
||||
// See if it's time to actually do anything yet...
|
||||
if (receiver == null) {
|
||||
long lastUpdate = prefs.getLong("lastUpdateCheck",
|
||||
System.currentTimeMillis());
|
||||
long lastUpdate = prefs.getLong("lastUpdateCheck", 0);
|
||||
String sint = prefs.getString("updateInterval", "0");
|
||||
int interval = Integer.parseInt(sint);
|
||||
if (interval == 0)
|
||||
if (interval == 0) {
|
||||
Log.d("FDroid", "Skipping update - disabled");
|
||||
return;
|
||||
if (lastUpdate + (interval * 60 * 60) > System
|
||||
.currentTimeMillis())
|
||||
}
|
||||
long elapsed = System.currentTimeMillis() - lastUpdate;
|
||||
if (elapsed < interval * 60 * 60) {
|
||||
Log.d("FDroid", "Skipping update - done " + elapsed
|
||||
+ "ms ago, interval is " + interval + " hours");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
boolean notify = prefs.getBoolean("updateNotify", false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user