diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2018-06-27 23:10:37 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-30 21:19:59 +0200 |
commit | 363d0b9126895c97c1a488f6f20a2ada700fff6f (patch) | |
tree | b231b4dca17af170271a089eb1dc4ff8d268bc29 /app/src/main/java | |
parent | e985452f3b9d02cf8cf911fa61dc0b2b938e6a13 (diff) |
android: model: Make some methods static
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/model/Tunnel.java | 6 | ||||
-rw-r--r-- | app/src/main/java/com/wireguard/android/model/TunnelManager.java | 4 |
2 files changed, 5 insertions, 5 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 0b1ba895..fb8da252 100644 --- a/app/src/main/java/com/wireguard/android/model/Tunnel.java +++ b/app/src/main/java/com/wireguard/android/model/Tunnel.java @@ -80,21 +80,21 @@ public class Tunnel extends BaseObservable implements Keyed<String> { } public CompletionStage<State> getStateAsync() { - return manager.getTunnelState(this); + return TunnelManager.getTunnelState(this); } @Bindable public Statistics getStatistics() { // FIXME: Check age of statistics. if (statistics == null) - manager.getTunnelStatistics(this).whenComplete(ExceptionLoggers.E); + TunnelManager.getTunnelStatistics(this).whenComplete(ExceptionLoggers.E); return statistics; } public CompletionStage<Statistics> getStatisticsAsync() { // FIXME: Check age of statistics. if (statistics == null) - return manager.getTunnelStatistics(this); + return TunnelManager.getTunnelStatistics(this); return CompletableFuture.completedFuture(statistics); } 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 d0b30415..dc706643 100644 --- a/app/src/main/java/com/wireguard/android/model/TunnelManager.java +++ b/app/src/main/java/com/wireguard/android/model/TunnelManager.java @@ -112,12 +112,12 @@ public final class TunnelManager extends BaseObservable { .thenApply(tunnel::onConfigChanged); } - CompletionStage<State> getTunnelState(final Tunnel tunnel) { + static CompletionStage<State> getTunnelState(final Tunnel tunnel) { return Application.getAsyncWorker().supplyAsync(() -> Application.getBackend().getState(tunnel)) .thenApply(tunnel::onStateChanged); } - CompletionStage<Statistics> getTunnelStatistics(final Tunnel tunnel) { + static CompletionStage<Statistics> getTunnelStatistics(final Tunnel tunnel) { return Application.getAsyncWorker().supplyAsync(() -> Application.getBackend().getStatistics(tunnel)) .thenApply(tunnel::onStatisticsChanged); } |