In Europe its kind of important to distinguish customs and immigration, because Schengen IS NOT EQUAL European Untion IS NOT EQUAL European Free Trade Association IS NOT EQUAL European Economic Area. Those, customs and immigration checks could happen at completely different places.
At this time I am not even sure how China handles customs and immigration (e.g. for those on the direct Australia - Beijing flights on Air China with a stop in Shanghai; and for those connecting at PEK from an international CA flight to a domestic CA flight).
I know of one recent experience. I have travelled with a colleague twice to the US for business. That colleague told me that the US had exit immigration controls.
In turns out that the colleague thought that the TSA guys, conducting the ID card checks, were immigration officers.