From 8f0dcd0a32514360430f438581075482ded488c2 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Wed, 16 Aug 2017 04:26:45 -0500 Subject: Config: add an isPrimary property Signed-off-by: Jason A. Donenfeld --- app/src/main/java/com/wireguard/config/Config.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/src/main') 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 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(); -- cgit v1.2.3