With the recent LHCb data on ηc production and based on heavy quark spin symmetry, we obtain the long-distance matrix elements for both ηc and J/ψ productions, among which, the color-singlet one for ηc is obtained directly by the fit of experiment for the first time. Using our long-distance matrix elements, we can provide good description of the ηc and J/ψ hadroproduction measurements. Our predictions on J/ψ polarization are in good agreement with the LHCb data and pass through the two sets of CDF measurements in medium pt region. Considering all the possible uncertainties carefully, we obtained quite narrow bands of the J/ψ polarization curves.