From 870b2bf36d8fe170e114acd61cef82d15bb3d237 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 28 Mar 2020 15:58:12 -0600 Subject: ObservableTunnel: do not cache stats Signed-off-by: Jason A. Donenfeld --- ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ui/src/main/java/com/wireguard/android') diff --git a/ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt b/ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt index 00cbc5a0..99a46041 100644 --- a/ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt +++ b/ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt @@ -97,10 +97,11 @@ class ObservableTunnel internal constructor( } private set - val statisticsAsync: CompletionStage = if (statistics == null || statistics!!.isStale) - manager.getTunnelStatistics(this) - else - CompletableFuture.completedFuture(statistics) + val statisticsAsync: CompletionStage + get() = if (statistics == null || statistics!!.isStale) + manager.getTunnelStatistics(this) + else + CompletableFuture.completedFuture(statistics) fun onStatisticsChanged(statistics: Statistics?): Statistics? { this.statistics = statistics -- cgit v1.2.3