summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-11-24 23:44:18 -0600
committerSamuel Holland <samuel@sholland.org>2017-11-24 23:44:18 -0600
commitf1febcf9b626a97a5aa75029b3ba90c26e468b2f (patch)
tree7da180360e6b992feacbdbe3111d3d3e4baf7013 /app/src/main/java
parent32338556303ab231bcd265e36a1e617e9bfbfe69 (diff)
ConfigList: Poor man's switch
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/wireguard/android/backends/VpnService.java4
1 files changed, 2 insertions, 2 deletions
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))