summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2020-01-29 02:55:25 -0600
committercyberta <cyberta@riseup.net>2020-01-29 02:55:25 -0600
commit7fbea5459e59de1327f2c76a23f5940d67e4ae8d (patch)
treec11fbdcb5a51b23e842e785b364a069b3f75c681 /app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java
parentec4cafb1026db8f461d94908dbdfcd8281d235a4 (diff)
implement wifi tethering
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java34
1 files changed, 33 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java b/app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java
index 50fead91..9708639a 100644
--- a/app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java
+++ b/app/src/main/java/se/leap/bitmaskclient/tethering/TetheringState.java
@@ -1,7 +1,39 @@
package se.leap.bitmaskclient.tethering;
-public class TetheringState {
+public class TetheringState implements Cloneable {
public boolean isWifiTetheringEnabled;
public boolean isUsbTetheringEnabled;
public boolean isBluetoothTetheringEnabled;
+ public boolean isVpnWifiTetheringAllowed;
+ public boolean isVpnUsbTetheringAllowed;
+ public boolean isVpnBluetoothTetheringAllowed;
+ public String wifiInterface = "";
+ public String usbInterface = "";
+ public String bluetoothInterface = "";
+ public String wifiAddress = "";
+ public String lastWifiAddress = "";
+ public String usbAddress = "";
+ public String bluetoothAddress = "";
+
+ public boolean tetherWifiVpn() {
+ return isWifiTetheringEnabled && isVpnWifiTetheringAllowed;
+ }
+
+ public boolean tetherUsbVpn() {
+ return isUsbTetheringEnabled && isVpnUsbTetheringAllowed;
+ }
+
+ public boolean tetherBluetoothVpn() {
+ return isBluetoothTetheringEnabled && isVpnBluetoothTetheringAllowed;
+ }
+
+ public boolean hasAnyDeviceTetheringEnabled() {
+ return isBluetoothTetheringEnabled || isUsbTetheringEnabled || isWifiTetheringEnabled;
+ }
+
+ public boolean hasAnyVpnTetheringAllowed() {
+ return isVpnWifiTetheringAllowed || isVpnUsbTetheringAllowed || isVpnBluetoothTetheringAllowed;
+ }
+
+
}