Browse Source

TunnelManager: Use constants directly where appropriate

Signed-off-by: Samuel Holland <samuel@sholland.org>
master
Samuel Holland 6 years ago
parent
commit
54f201174d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/src/main/java/com/wireguard/android/model/TunnelManager.java

+ 2
- 2
app/src/main/java/com/wireguard/android/model/TunnelManager.java View File

@@ -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.


Loading…
Cancel
Save