Don't check for online status too often.

This commit is contained in:
dosiecki 2015-02-13 14:49:47 -08:00
parent 4fc012b7f8
commit 8f91d3412b
2 changed files with 2 additions and 1 deletions

View file

@ -203,9 +203,9 @@ public class NBSyncService extends Service {
}
if (OfflineNow) {
OfflineNow = false;
NbActivity.updateAllActivities(false);
}
OfflineNow = false;
// do this even if background syncs aren't enabled, because it absolutely must happen
// on all devices

View file

@ -9,6 +9,7 @@ public class NetStateReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// poke the sync service when network state changes, in case we were offline
if (!NBSyncService.OfflineNow) return;
Intent i = new Intent(context, NBSyncService.class);
context.startService(i);
}