summaryrefslogtreecommitdiff
path: root/tests/src/se/leap/bitmaskclient/test
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-01-30 19:54:58 +0100
committerParménides GV <parmegv@sdf.org>2014-01-30 19:54:58 +0100
commitc1c7d1f7106afa4e2300f37355642c56641884e9 (patch)
treecb42ff7f92cf3dbfec92629f1be39884ced7a6ad /tests/src/se/leap/bitmaskclient/test
parent6c7eda789ac7ee5c0369409cb27430f0074dfc07 (diff)
Wi-Fi on/off method in ConnectionManager for tests
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);
+ }
}