From c1c7d1f7106afa4e2300f37355642c56641884e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 30 Jan 2014 19:54:58 +0100 Subject: Wi-Fi on/off method in ConnectionManager for tests --- tests/src/se/leap/bitmaskclient/test/ConnectionManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/src') 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); + } } -- cgit v1.2.3