summaryrefslogtreecommitdiffhomepage
path: root/app/src
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-08-16 04:26:45 -0500
committerSamuel Holland <samuel@sholland.org>2017-08-16 04:26:45 -0500
commit8f0dcd0a32514360430f438581075482ded488c2 (patch)
tree71de37eac72e23c312095305a88b345caa2528e9 /app/src
parent452641a0eb09d7276e7f6ec6d4260ac509567664 (diff)
Config: add an isPrimary property
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src')
-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();