Don't force 60s rescan interval on start (fixes #786)

This commit is contained in:
Felix Ableitner 2016-11-19 14:45:19 +09:00
parent 936ab38a92
commit ac5e35636a
2 changed files with 11 additions and 12 deletions

View File

@ -3,6 +3,7 @@ package com.nutomic.syncthingandroid.activities;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.SwitchCompat;
import android.text.Editable;
@ -332,7 +333,16 @@ public class FolderActivity extends SyncthingActivity
mFolder = new Folder();
mFolder.id = getIntent().getStringExtra(EXTRA_FOLDER_ID);
mFolder.label = getIntent().getStringExtra(EXTRA_FOLDER_LABEL);
mFolder.rescanIntervalS = 259200; // Scan every 3 days (in case inotify dropped some changes)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
// Scan every 3 days (in case inotify dropped some changes)
mFolder.rescanIntervalS = 259200;
}
else {
// FileObserver does not work correctly on Android Marshmallow.
// Nougat seems to have the same problem in emulator, but we should check this again.
// https://code.google.com/p/android/issues/detail?id=189231
mFolder.rescanIntervalS = 60;
}
mFolder.versioning = new Folder.Versioning();
String deviceId = getIntent().getStringExtra(EXTRA_DEVICE_ID);
if (deviceId != null) {

View File

@ -122,17 +122,6 @@ public class ConfigXml {
changed = true;
}
// FileObserver does not work correctly on Android Marshmallow.
// Nougat seems to have the same problem in emulator, but we should check this again.
// https://code.google.com/p/android/issues/detail?id=189231
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (!r.getAttribute("rescanIntervalS").equals("60")) {
Log.i(TAG, "Set 60s rescan interval on folder " + r.getAttribute("id"));
r.setAttribute("rescanIntervalS", "60");
changed = true;
}
}
if (applyHashers(r)) {
changed = true;
}