From 54f201174d3fa66053871532e0ba4b0bf3729337 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Tue, 16 Jan 2018 05:52:17 -0600 Subject: TunnelManager: Use constants directly where appropriate Signed-off-by: Samuel Holland --- app/src/main/java/com/wireguard/android/model/TunnelManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/com/wireguard/android') diff --git a/app/src/main/java/com/wireguard/android/model/TunnelManager.java b/app/src/main/java/com/wireguard/android/model/TunnelManager.java index 9e03cc39..381e7f77 100644 --- a/app/src/main/java/com/wireguard/android/model/TunnelManager.java +++ b/app/src/main/java/com/wireguard/android/model/TunnelManager.java @@ -90,7 +90,7 @@ public final class TunnelManager extends BaseObservable { configStore.delete(tunnel.getName()); } catch (final Exception e) { if (originalState == State.UP) - backend.setState(tunnel, originalState); + backend.setState(tunnel, State.UP); // Re-throw the exception to fail the completion. throw e; } @@ -199,7 +199,7 @@ public final class TunnelManager extends BaseObservable { configStore.rename(tunnel.getName(), name); final String newName = tunnel.onNameChanged(name); if (originalState == State.UP) - backend.setState(tunnel, originalState); + backend.setState(tunnel, State.UP); return newName; }).whenComplete((newName, e) -> { // On failure, we don't know what state the tunnel might be in. Fix that. -- cgit v1.2.3