summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/firewall/FirewallManager.java14
1 files changed, 10 insertions, 4 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 67cc4625..30ecebea 100644
--- a/app/src/main/java/se/leap/bitmaskclient/firewall/FirewallManager.java
+++ b/app/src/main/java/se/leap/bitmaskclient/firewall/FirewallManager.java
@@ -31,6 +31,7 @@ public class FirewallManager implements FirewallCallback, Observer {
public static String BITMASK_FORWARD = "bitmask_forward";
public static String BITMASK_POSTROUTING = "bitmask_postrouting";
static final String TAG = FirewallManager.class.getSimpleName();
+ private boolean isRunning = false;
private Context context;
@@ -91,14 +92,19 @@ public class FirewallManager implements FirewallCallback, Observer {
public void start() {
- startIPv6Firewall();
- TetheringState tetheringState = TetheringObservable.getInstance().getTetheringState();
- if (tetheringState.hasAnyDeviceTetheringEnabled() && tetheringState.hasAnyVpnTetheringAllowed()) {
- startTethering();
+ if (!isRunning) {
+ isRunning = true;
+ startIPv6Firewall();
+ TetheringState tetheringState = TetheringObservable.getInstance().getTetheringState();
+ if (tetheringState.hasAnyDeviceTetheringEnabled() && tetheringState.hasAnyVpnTetheringAllowed()) {
+ startTethering();
+ }
}
+
}
public void stop() {
+ isRunning = false;
stopIPv6Firewall();
stopTethering();
}