1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-29 15:51:17 +00:00

Use model/Folder defaults for the camera folder (fixes #352) (#353)

This commit is contained in:
Catfriend1 2019-03-06 01:38:31 +01:00 committed by GitHub
parent 4b2dfd3b1b
commit e57caf96c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -963,6 +963,7 @@ public class ConfigXml {
* Returns if changes to the config have been made. * Returns if changes to the config have been made.
*/ */
private boolean changeDefaultFolder() { private boolean changeDefaultFolder() {
Folder defaultFolder = new Folder();
Element folder = (Element) mConfig.getDocumentElement() Element folder = (Element) mConfig.getDocumentElement()
.getElementsByTagName("folder").item(0); .getElementsByTagName("folder").item(0);
String deviceModel = Build.MODEL String deviceModel = Build.MODEL
@ -975,8 +976,9 @@ public class ConfigXml {
folder.setAttribute("path", Environment folder.setAttribute("path", Environment
.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath()); .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath());
folder.setAttribute("type", Constants.FOLDER_TYPE_SEND_ONLY); folder.setAttribute("type", Constants.FOLDER_TYPE_SEND_ONLY);
folder.setAttribute("fsWatcherEnabled", "true"); folder.setAttribute("fsWatcherEnabled", Boolean.toString(defaultFolder.fsWatcherEnabled));
folder.setAttribute("fsWatcherDelayS", "10"); folder.setAttribute("fsWatcherDelayS", Integer.toString(defaultFolder.fsWatcherDelayS));
setConfigElement(folder, "useLargeBlocks", Boolean.toString(defaultFolder.useLargeBlocks));
return true; return true;
} }