判断是wifi还是3g网络 @param context @return
(Context context)
| 71 | * @return |
| 72 | */ |
| 73 | public static boolean isWifi(Context context) { |
| 74 | ConnectivityManager cm = (ConnectivityManager) context |
| 75 | .getSystemService(Context.CONNECTIVITY_SERVICE); |
| 76 | NetworkInfo networkINfo = cm.getActiveNetworkInfo(); |
| 77 | if (networkINfo != null |
| 78 | && networkINfo.getType() == ConnectivityManager.TYPE_WIFI) { |
| 79 | return true; |
| 80 | } |
| 81 | return false; |
| 82 | } |
| 83 | } |
nothing calls this directly
no outgoing calls
no test coverage detected