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 { public enum State { DOWN, TOGGLE, - UP + UP; + + public static State of(final boolean running) { + return running ? UP : DOWN; + } } public static class Statistics extends BaseObservable {