How China Keeps Tabs on Foreigners