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 | c32344427d051d05b13be8a05525abb482dd2def (patch) | |
tree | d3e57e02dd71d538a1e97076a4f425365bdd9423 /src/de/blinkt/openvpn | |
parent | 0dcf5ccb571aabfddb6b617890e3d57ed4a0bfc9 (diff) |
Accessing wifi state... (commented out, not as useful as I thought)
--HG--
extra : rebase_source : 1cee26b2048cff54c805bba0be54c0b29f81b936
Diffstat (limited to 'src/de/blinkt/openvpn')
-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();
|