summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/android
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/com/wireguard/android')
-rw-r--r--app/src/main/java/com/wireguard/android/model/Tunnel.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/android/model/Tunnel.java b/app/src/main/java/com/wireguard/android/model/Tunnel.java
index 6edb6acd..67c5144e 100644
--- a/app/src/main/java/com/wireguard/android/model/Tunnel.java
+++ b/app/src/main/java/com/wireguard/android/model/Tunnel.java
@@ -129,7 +129,11 @@ public class Tunnel extends BaseObservable implements Keyed<String> {
public enum State {
DOWN,
TOGGLE,
- UP
+ UP;
+
+ public static State of(final boolean running) {
+ return running ? UP : DOWN;
+ }
}
public static class Statistics extends BaseObservable {