/*
 * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
 */
package kr.co.zumo.app.lifeplus.util;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * NetworkUtil
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018-09-26]   [최초 작성]
 * @since 2018-09-26
 */
public class NetworkUtil {

  /**
   * NetworkInfo 를 반환한다.
   *
   * @param context
   * @return NetworkInfo
   */
  public static NetworkInfo getNetworkInfo(Context context) {

    ConnectivityManager manager = null;
    NetworkInfo networkInfo = null;

    try {
      manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    } catch (Exception e) {
      e.printStackTrace();
    }

    if (null != manager) {
      networkInfo = manager.getActiveNetworkInfo();
    }
    return networkInfo;
  }
}
