simplify:
return networkInfo.isAvailable() && networkInfo.isConnected();