diff options
author | cyberta <cyberta@riseup.net> | 2020-01-31 17:59:46 -0600 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2020-01-31 17:59:46 -0600 |
commit | 47f463122392963d81c3e12c7ffbb0443bead6ce (patch) | |
tree | 10bfa0653f254c97a28bb9ac423e6325d4440cdf /app/src/main/java/se/leap/bitmaskclient/firewall | |
parent | 0c80399b8708027770b591764d70c1cc5853b70f (diff) |
add UI in navigation drawer to enable/disable ipv6 firewall and to show/hide experimental features
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/firewall')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/firewall/FirewallManager.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/firewall/FirewallManager.java b/app/src/main/java/se/leap/bitmaskclient/firewall/FirewallManager.java index 30ecebea..c148497b 100644 --- a/app/src/main/java/se/leap/bitmaskclient/firewall/FirewallManager.java +++ b/app/src/main/java/se/leap/bitmaskclient/firewall/FirewallManager.java @@ -94,7 +94,9 @@ public class FirewallManager implements FirewallCallback, Observer { public void start() { if (!isRunning) { isRunning = true; - startIPv6Firewall(); + if (PreferenceHelper.useIpv6Firewall(context)) { + startIPv6Firewall(); + } TetheringState tetheringState = TetheringObservable.getInstance().getTetheringState(); if (tetheringState.hasAnyDeviceTetheringEnabled() && tetheringState.hasAnyVpnTetheringAllowed()) { startTethering(); @@ -105,8 +107,13 @@ public class FirewallManager implements FirewallCallback, Observer { public void stop() { isRunning = false; - stopIPv6Firewall(); - stopTethering(); + if (PreferenceHelper.useIpv6Firewall(context)) { + stopIPv6Firewall(); + } + TetheringState tetheringState = TetheringObservable.getInstance().getTetheringState(); + if (tetheringState.hasAnyDeviceTetheringEnabled() && tetheringState.hasAnyVpnTetheringAllowed()) { + stopTethering(); + } } public void startTethering() { @@ -119,12 +126,12 @@ public class FirewallManager implements FirewallCallback, Observer { task.execute(); } - private void startIPv6Firewall() { + public void startIPv6Firewall() { StartIPv6FirewallTask task = new StartIPv6FirewallTask(this); task.execute(); } - private void stopIPv6Firewall() { + public void stopIPv6Firewall() { ShutdownIPv6FirewallTask task = new ShutdownIPv6FirewallTask(this); task.execute(); } |