mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-11 04:25:53 +00:00
Don't force 60s rescan interval on start (fixes #786)
This commit is contained in:
parent
936ab38a92
commit
ac5e35636a
2 changed files with 11 additions and 12 deletions
|
@ -3,6 +3,7 @@ package com.nutomic.syncthingandroid.activities;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.widget.SwitchCompat;
|
import android.support.v7.widget.SwitchCompat;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
|
@ -332,7 +333,16 @@ public class FolderActivity extends SyncthingActivity
|
||||||
mFolder = new Folder();
|
mFolder = new Folder();
|
||||||
mFolder.id = getIntent().getStringExtra(EXTRA_FOLDER_ID);
|
mFolder.id = getIntent().getStringExtra(EXTRA_FOLDER_ID);
|
||||||
mFolder.label = getIntent().getStringExtra(EXTRA_FOLDER_LABEL);
|
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();
|
mFolder.versioning = new Folder.Versioning();
|
||||||
String deviceId = getIntent().getStringExtra(EXTRA_DEVICE_ID);
|
String deviceId = getIntent().getStringExtra(EXTRA_DEVICE_ID);
|
||||||
if (deviceId != null) {
|
if (deviceId != null) {
|
||||||
|
|
|
@ -122,17 +122,6 @@ public class ConfigXml {
|
||||||
changed = true;
|
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)) {
|
if (applyHashers(r)) {
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue