summaryrefslogtreecommitdiff
path: root/tests/src/se/leap/bitmaskclient/test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/se/leap/bitmaskclient/test')
-rw-r--r--tests/src/se/leap/bitmaskclient/test/ConnectionManager.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/src/se/leap/bitmaskclient/test/ConnectionManager.java b/tests/src/se/leap/bitmaskclient/test/ConnectionManager.java
index 62a8f0ad..f1cbff19 100644
--- a/tests/src/se/leap/bitmaskclient/test/ConnectionManager.java
+++ b/tests/src/se/leap/bitmaskclient/test/ConnectionManager.java
@@ -2,10 +2,11 @@ package se.leap.bitmaskclient.test;
import android.content.Context;
import android.net.ConnectivityManager;
+import android.net.wifi.WifiManager;
+import android.util.Log;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import android.util.Log;
public class ConnectionManager {
static void setMobileDataEnabled(boolean enabled, Context context) {
@@ -24,4 +25,9 @@ public class ConnectionManager {
}
}
}
+
+ static void setWifiEnabled(boolean enabled, Context context) {
+ WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
+ wifiManager.setWifiEnabled(enabled);
+ }
}