diff options
author | Samuel Holland <samuel@sholland.org> | 2018-01-07 20:33:07 -0600 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-01-07 20:33:07 -0600 |
commit | 0ab3e294321e5a50d61474ff29391d40edf9e443 (patch) | |
tree | e3ba84d6149092a9cc4a47d818194b5a78bce7a2 /app/src/main/java/com/wireguard/android | |
parent | 11f851abf800e3f1314d8ee0f272801cd08b3f0c (diff) |
Tunnel: Remove UNKNOWN state
It's never used.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src/main/java/com/wireguard/android')
-rw-r--r-- | app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java | 2 | ||||
-rw-r--r-- | app/src/main/java/com/wireguard/android/model/Tunnel.java | 7 |
2 files changed, 1 insertions, 8 deletions
diff --git a/app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java b/app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java index 93ddcc32..0bca1bd7 100644 --- a/app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java +++ b/app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java @@ -35,8 +35,6 @@ public final class WgQuickBackend implements Backend { } private static State resolveState(final State currentState, State requestedState) { - if (requestedState == State.UNKNOWN) - throw new IllegalArgumentException("Requested unknown state"); if (requestedState == State.TOGGLE) requestedState = currentState == State.UP ? State.DOWN : State.UP; return requestedState; 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 9cdcf71f..6edb6acd 100644 --- a/app/src/main/java/com/wireguard/android/model/Tunnel.java +++ b/app/src/main/java/com/wireguard/android/model/Tunnel.java @@ -69,15 +69,11 @@ public class Tunnel extends BaseObservable implements Keyed<String> { @Bindable public State getState() { - if (state == State.UNKNOWN) - manager.getTunnelState(this).whenComplete(ExceptionLoggers.E); return state; } public CompletionStage<State> getStateAsync() { - if (state == State.UNKNOWN) - return manager.getTunnelState(this); - return CompletableFuture.completedFuture(state); + return manager.getTunnelState(this); } @Bindable @@ -133,7 +129,6 @@ public class Tunnel extends BaseObservable implements Keyed<String> { public enum State { DOWN, TOGGLE, - UNKNOWN, UP } |