diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-08-12 23:01:24 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-08-12 23:01:24 +0200 |
commit | c7baf0994a529e6a350faa7ec421c33b1def08f1 (patch) | |
tree | 1992749354015407e6c4e00eddee10cd78204ee4 /src/de/blinkt/openvpn/NetworkSateReceiver.java | |
parent | 04224f3c2d7d18ce420f686abea1d6981a0946c2 (diff) |
Accessing wifi state... (commented out, not as useful as I thought)
Diffstat (limited to 'src/de/blinkt/openvpn/NetworkSateReceiver.java')
-rw-r--r-- | src/de/blinkt/openvpn/NetworkSateReceiver.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/NetworkSateReceiver.java b/src/de/blinkt/openvpn/NetworkSateReceiver.java index a649bd65..6c38a0cb 100644 --- a/src/de/blinkt/openvpn/NetworkSateReceiver.java +++ b/src/de/blinkt/openvpn/NetworkSateReceiver.java @@ -6,7 +6,11 @@ import android.content.Intent; import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
+import android.net.NetworkInfo.DetailedState;
import android.net.NetworkInfo.State;
+import android.net.wifi.SupplicantState;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
import android.preference.PreferenceManager;
public class NetworkSateReceiver extends BroadcastReceiver {
@@ -37,10 +41,23 @@ public class NetworkSateReceiver extends BroadcastReceiver { if(extrainfo==null)
extrainfo="";
+ /*
+ if(networkInfo.getType()==android.net.ConnectivityManager.TYPE_WIFI) {
+ WifiManager wifiMgr = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
+ WifiInfo wifiinfo = wifiMgr.getConnectionInfo();
+ extrainfo+=wifiinfo.getBSSID();
+
+ subtype += wifiinfo.getNetworkId();
+ }*/
+
+
+
netstatestring = String.format("%2$s %4$s to %1$s %3$s",networkInfo.getTypeName(),
networkInfo.getDetailedState(),extrainfo,subtype );
}
+
+
if(networkInfo!=null && networkInfo.getState() == State.CONNECTED) {
int newnet = networkInfo.getType();
|