Example #1
0
 public static boolean getOutstandingEntryFlag() {
   if (outstandingEntryFlag == -1) {
     synchronized (RemoteModelDao.class) {
       if (PluginServices.getActFmPreferenceService().isLoggedIn()) outstandingEntryFlag = 1;
       else outstandingEntryFlag = 0;
     }
   }
   return outstandingEntryFlag > 0;
 }
Example #2
0
 @Override
 public void onReceive(Context context, Intent intent) {
   lastSyncFromNetworkChange = Preferences.getLong(PREF_LAST_SYNC_FROM_NETWORK_CHANGE, 0L);
   if (DateUtilities.now() - lastSyncFromNetworkChange > DateUtilities.ONE_MINUTE * 10) {
     NetworkInfo info = intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
     if (info != null
         && NetworkInfo.State.CONNECTED.equals(info.getState())
         && PluginServices.getActFmPreferenceService().isLoggedIn()) {
       ActFmSyncThread syncThread = ActFmSyncThread.getInstance();
       syncThread.repopulateQueueFromOutstandingTables();
       Preferences.setLong(PREF_LAST_SYNC_FROM_NETWORK_CHANGE, DateUtilities.now());
     }
   }
 }