FileDocCategorySizeDatePackage
ConnectivityManagerCompatGingerbread.javaAPI DocAndroid 5.1 API1985Thu Mar 12 22:22:56 GMT 2015android.support.v4.net

ConnectivityManagerCompatGingerbread

public class ConnectivityManagerCompatGingerbread extends Object
Implementation of ConnectivityManagerCompat that can use Gingerbread APIs.

Fields Summary
Constructors Summary
Methods Summary
public static booleanisActiveNetworkMetered(android.net.ConnectivityManager cm)

        final NetworkInfo info = cm.getActiveNetworkInfo();
        if (info == null) {
            // err on side of caution
            return true;
        }

        final int type = info.getType();
        switch (type) {
            case TYPE_MOBILE:
            case TYPE_MOBILE_DUN:
            case TYPE_MOBILE_HIPRI:
            case TYPE_MOBILE_MMS:
            case TYPE_MOBILE_SUPL:
            case TYPE_WIMAX:
                return true;
            case TYPE_WIFI:
                return false;
            default:
                // err on side of caution
                return true;
        }