docs: public static NetworkType getNetworkType(Context context) {
          ConnectivityManager cm = (ConnectivityManager) context
                  .getSystemService(Context.CONNECTIVITY_SERVICE);
          final NetworkInfo info = cm.getActiveNetworkInfo();
          if (info == null || !info.isConnectedOrConnecting()) {
              return NetworkType.NONE;
          }
          int type = info.getType();
          if (ConnectivityManager.TYPE_WIFI == type) {
              return NetworkType.WIFI;
          } else if (ConnectivityManager.TYPE_MOBILE == type) {
              return NetworkType.MOBILE;
          } else {
              return NetworkType.OTHER;
          }
      }