| | |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.ServiceConnection; |
| | | import android.net.ConnectivityManager; |
| | | import android.net.NetworkInfo; |
| | | import android.os.IBinder; |
| | | |
| | | import cn.com.basic.face.discern.entity.Device; |
| | |
| | | } |
| | | |
| | | |
| | | public boolean networkNotAvailable() { |
| | | boolean connected = false; |
| | | ConnectivityManager connectivityManager = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); |
| | | if(connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState() == NetworkInfo.State.CONNECTED || |
| | | connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState() == NetworkInfo.State.CONNECTED) { |
| | | connected = true; |
| | | } |
| | | return !connected; |
| | | } |
| | | |
| | | |
| | | } |