Don't repopulate app lists if no repos were changed on update (much faster)
This commit is contained in:
parent
dc88ba57e2
commit
154b0bda45
@ -269,9 +269,11 @@ public class FDroid extends FragmentActivity {
|
||||
if (resultCode == UpdateService.STATUS_ERROR) {
|
||||
Toast.makeText(FDroid.this, message, Toast.LENGTH_LONG).show();
|
||||
finished = true;
|
||||
} else if (resultCode == UpdateService.STATUS_COMPLETE) {
|
||||
} else if (resultCode == UpdateService.STATUS_CHANGES) {
|
||||
repopulateViews();
|
||||
finished = true;
|
||||
} else if (resultCode == UpdateService.STATUS_SAME) {
|
||||
finished = true;
|
||||
} else if (resultCode == UpdateService.STATUS_INFO) {
|
||||
pd.setMessage(message);
|
||||
}
|
||||
|
@ -45,9 +45,10 @@ import android.support.v4.app.TaskStackBuilder;
|
||||
public class UpdateService extends IntentService implements ProgressListener {
|
||||
|
||||
public static final String RESULT_MESSAGE = "msg";
|
||||
public static final int STATUS_COMPLETE = 0;
|
||||
public static final int STATUS_ERROR = 1;
|
||||
public static final int STATUS_INFO = 2;
|
||||
public static final int STATUS_CHANGES = 0;
|
||||
public static final int STATUS_SAME = 1;
|
||||
public static final int STATUS_ERROR = 2;
|
||||
public static final int STATUS_INFO = 3;
|
||||
|
||||
private ResultReceiver receiver = null;
|
||||
|
||||
@ -314,10 +315,14 @@ public class UpdateService extends IntentService implements ProgressListener {
|
||||
errmsg = "Unknown error";
|
||||
sendStatus(STATUS_ERROR, errmsg);
|
||||
} else {
|
||||
sendStatus(STATUS_COMPLETE);
|
||||
Editor e = prefs.edit();
|
||||
e.putLong("lastUpdateCheck", System.currentTimeMillis());
|
||||
e.commit();
|
||||
if (changes) {
|
||||
sendStatus(STATUS_CHANGES);
|
||||
} else {
|
||||
sendStatus(STATUS_SAME);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user