package IMuAHx_6.QxJ9d_1.PGPF6hQ_2;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
/* compiled from: NetUtil.java */
/* loaded from: classes.dex */
public class KQgRr5e_0 {
    public static int KQgRr5e_0(Context context) {
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
        if (activeNetworkInfo == null || !activeNetworkInfo.isConnected()) {
            return -1;
        }
        int type = activeNetworkInfo.getType();
        if (type == 1) {
            return 1;
        }
        return type == 0 ? 0 : 2;
    }
}
