|
@@ -68,7 +68,6 @@ import de.tudarmstadt.informatik.hostage.ui.activity.MainActivity;
|
|
|
*/
|
|
|
public class SyncUtils {
|
|
|
public static final int SYNC_SUCCESSFUL = 0x0;
|
|
|
- private static final long SYNC_FREQUENCY = 60 * 60; // 1 hour (in seconds)
|
|
|
|
|
|
public static final String CONTENT_AUTHORITY = "de.tudarmstadt.informatik.hostage.androidsync";
|
|
|
private static final String PREF_SETUP_COMPLETE = "sync_setup_complete";
|
|
@@ -111,8 +110,10 @@ public class SyncUtils {
|
|
|
ContentResolver.setSyncAutomatically(account, CONTENT_AUTHORITY, true);
|
|
|
// Recommend a schedule for automatic synchronization. The system may modify this based
|
|
|
// on other scheduled syncs and network utilization.
|
|
|
+ SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
+ long syncFrequency = pref.getInt("pref_sync_frequency", 5*60); // default is 5min
|
|
|
ContentResolver.addPeriodicSync(
|
|
|
- account, CONTENT_AUTHORITY, new Bundle(),SYNC_FREQUENCY);
|
|
|
+ account, CONTENT_AUTHORITY, new Bundle(),syncFrequency);
|
|
|
newAccount = true;
|
|
|
}
|
|
|
|