mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-07 10:42:07 +00:00
* model/Options: Add crash*, stun* and unackedNotificationID * ConfigXml: Dismiss unackedNotificationID "crAutoEnabled" * ConfigXml/getOptions: Add unackedNotificationID, crash*, stun*
This commit is contained in:
parent
b4c0121720
commit
d1f9bdf9f4
2 changed files with 27 additions and 5 deletions
|
@ -47,6 +47,20 @@ public class Options {
|
|||
// Since v1.0.0, see https://github.com/syncthing/syncthing/pull/4888
|
||||
public int maxConcurrentScans = 1;
|
||||
|
||||
// Since v1.2.0
|
||||
public String crashReportingURL = "https://crash.syncthing.net/newcrash";
|
||||
public boolean crashReportingEnabled = true;
|
||||
public int stunKeepaliveStartS = 180;
|
||||
public int stunKeepaliveMinS = 20;
|
||||
public String stunServer = "default";
|
||||
|
||||
// Items that may be temporarily missing because they are empty.
|
||||
/**
|
||||
* Possible notification IDs:
|
||||
* crAutoEnabled (crash reporting after upgrade to v1.2.0)
|
||||
*/
|
||||
public String unackedNotificationID = "";
|
||||
|
||||
public static class MinHomeDiskFree {
|
||||
public float value = 1;
|
||||
public String unit = "%";
|
||||
|
|
|
@ -309,11 +309,13 @@ public class ConfigXml {
|
|||
for (int i = 0; i < childNodes.getLength(); i++) {
|
||||
Node node = childNodes.item(i);
|
||||
if (node.getNodeName().equals("unackedNotificationID")) {
|
||||
if (node.equals("fsWatcherNotification")) {
|
||||
Log.i(TAG, "Remove found unackedNotificationID 'fsWatcherNotification'.");
|
||||
options.removeChild(node);
|
||||
changed = true;
|
||||
break;
|
||||
switch (getContentOrDefault(node, "")) {
|
||||
case "crAutoEnabled":
|
||||
case "fsWatcherNotification":
|
||||
Log.i(TAG, "Remove found unackedNotificationID '" + node + "'.");
|
||||
options.removeChild(node);
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -908,6 +910,12 @@ public class ConfigXml {
|
|||
options.setLowPriority = getContentOrDefault(elementOptions.getElementsByTagName("setLowPriority").item(0), options.setLowPriority);
|
||||
// minHomeDiskFree
|
||||
options.maxConcurrentScans = getContentOrDefault(elementOptions.getElementsByTagName("maxConcurrentScans").item(0), options.maxConcurrentScans);
|
||||
options.unackedNotificationID = getContentOrDefault(elementOptions.getElementsByTagName("unackedNotificationID").item(0), options.unackedNotificationID);
|
||||
options.crashReportingURL = getContentOrDefault(elementOptions.getElementsByTagName("crashReportingURL").item(0), options.crashReportingURL);
|
||||
options.crashReportingEnabled =getContentOrDefault(elementOptions.getElementsByTagName("crashReportingEnabled").item(0), options.crashReportingEnabled);
|
||||
options.stunKeepaliveStartS = getContentOrDefault(elementOptions.getElementsByTagName("stunKeepaliveStartS").item(0), options.stunKeepaliveStartS);
|
||||
options.stunKeepaliveMinS = getContentOrDefault(elementOptions.getElementsByTagName("stunKeepaliveMinS").item(0), options.stunKeepaliveMinS);
|
||||
options.stunServer = getContentOrDefault(elementOptions.getElementsByTagName("stunServer").item(0), options.stunServer);
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue