From f1febcf9b626a97a5aa75029b3ba90c26e468b2f Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 24 Nov 2017 23:44:18 -0600 Subject: ConfigList: Poor man's switch Signed-off-by: Jason A. Donenfeld --- app/src/main/java/com/wireguard/android/backends/VpnService.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/backends/VpnService.java b/app/src/main/java/com/wireguard/android/backends/VpnService.java index 25eb4ade..275b719c 100644 --- a/app/src/main/java/com/wireguard/android/backends/VpnService.java +++ b/app/src/main/java/com/wireguard/android/backends/VpnService.java @@ -241,9 +241,9 @@ public class VpnService extends Service @Override protected void onPostExecute(final Boolean result) { + config.setIsEnabled(!result); if (!result) return; - config.setIsEnabled(false); enabledConfigs.remove(config.getName()); preferences.edit().putStringSet(KEY_ENABLED_CONFIGS, enabledConfigs).apply(); if (config.getName().equals(primaryName)) @@ -267,9 +267,9 @@ public class VpnService extends Service @Override protected void onPostExecute(final Boolean result) { + config.setIsEnabled(result); if (!result) return; - config.setIsEnabled(true); enabledConfigs.add(config.getName()); preferences.edit().putStringSet(KEY_ENABLED_CONFIGS, enabledConfigs).apply(); if (config.getName().equals(primaryName)) -- cgit v1.2.3