This was a small hiccup point when I visited Beijing last winter. It's not very consistently enforced, but often it will bring attention.
As it as a longer trip, I brought my normal-sized can of shaving gel, which is 200ml. Obviously for flying this goes in checked luggage.
For long-distance trains, it was caught by the machines but after they took it out and I explained what it was, they let it go.
For public transit in Beijing, it was hit or miss, but once I was refused entry to the PKX express because it was too large (I took a taxi, whatever). I say hit or miss, because it was not even mentioned when I passed thru the same contrôle a few days prior.
Long story short : Stick with the 150ml limit if you can. Otherwise, I am sure shaving creme is something readily available for purchase there.