MCPcopy Create free account
hub / github.com/Freelander/Android_Data / isWifiEnabled

Method isWifiEnabled

fake_land/NetworkUtils.java:42–50  ·  view source on GitHub ↗

判断WIFI是否打开 @param context @return

(Context context)

Source from the content-addressed store, hash-verified

40 * @return
41 */
42 public static boolean isWifiEnabled(Context context) {
43 ConnectivityManager mgrConn = (ConnectivityManager) context
44 .getSystemService(Context.CONNECTIVITY_SERVICE);
45 TelephonyManager mgrTel = (TelephonyManager) context
46 .getSystemService(Context.TELEPHONY_SERVICE);
47 return ((mgrConn.getActiveNetworkInfo() != null && mgrConn
48 .getActiveNetworkInfo().getState() == NetworkInfo.State.CONNECTED) || mgrTel
49 .getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS);
50 }
51
52 /**
53 * 判断是否是3G网络

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected