summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/com/wireguard/config/Config.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/config/Config.java b/app/src/main/java/com/wireguard/config/Config.java
index e39832ba..9f1dbf4c 100644
--- a/app/src/main/java/com/wireguard/config/Config.java
+++ b/app/src/main/java/com/wireguard/config/Config.java
@@ -30,6 +30,7 @@ public class Config extends BaseObservable
private final Interface iface = new Interface();
private boolean isEnabled;
+ private boolean isPrimary;
private String name;
private final ObservableList<Peer> peers = new ObservableArrayList<>();
@@ -73,6 +74,11 @@ public class Config extends BaseObservable
return isEnabled;
}
+ @Bindable
+ public boolean isPrimary() {
+ return isPrimary;
+ }
+
public void parseFrom(final InputStream stream)
throws IOException {
peers.clear();
@@ -102,6 +108,11 @@ public class Config extends BaseObservable
notifyPropertyChanged(BR.enabled);
}
+ public void setIsPrimary(final boolean isPrimary) {
+ this.isPrimary = isPrimary;
+ notifyPropertyChanged(BR.primary);
+ }
+
public void setName(final String name) {
if (name != null && !name.isEmpty() && !isNameValid(name))
throw new IllegalArgumentException();