summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-09-20 00:26:27 +0200
committercyBerta <cyberta@riseup.net>2019-09-20 00:26:27 +0200
commite52d759c635a25969079503991e825b3f373cbcc (patch)
tree37c57875ccee34c05f9a904be4f645c31ec26066 /app/src/main/java
parent67a2040e96048e164b592fab4b0e8f123a7dd68f (diff)
restart vpn after pluggableTransports was selected or deselected
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java
index 380b765e..7d97dfbb 100644
--- a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java
@@ -44,6 +44,7 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import de.blinkt.openvpn.core.VpnStatus;
import se.leap.bitmaskclient.EipFragment;
import se.leap.bitmaskclient.FragmentManagerEnhanced;
import se.leap.bitmaskclient.MainActivity;
@@ -51,6 +52,7 @@ import se.leap.bitmaskclient.Provider;
import se.leap.bitmaskclient.ProviderListActivity;
import se.leap.bitmaskclient.ProviderObservable;
import se.leap.bitmaskclient.R;
+import se.leap.bitmaskclient.eip.EipCommand;
import se.leap.bitmaskclient.fragments.AboutFragment;
import se.leap.bitmaskclient.fragments.AlwaysOnDialog;
import se.leap.bitmaskclient.fragments.LogFragment;
@@ -263,8 +265,15 @@ public class NavigationDrawerFragment extends Fragment {
if (ProviderObservable.getInstance().getCurrentProvider().supportsPluggableTransports()) {
useBridges.setVisibility(VISIBLE);
useBridges.setChecked(getUsePluggableTransports(getContext()));
- useBridges.setOnCheckedChangeListener((buttonView, isChecked) ->
- usePluggableTransports(getContext(), isChecked));
+ useBridges.setOnCheckedChangeListener((buttonView, isChecked) -> {
+ usePluggableTransports(getContext(), isChecked);
+ if (VpnStatus.isVPNActive()) {
+ EipCommand.startVPN(getContext(), false);
+ closeDrawerWithDelay();
+ }
+ });
+
+
} else {
useBridges.setVisibility(GONE);
}