He also came to know the inner workings of China 's communications regulators ; before his Columbia stint , he worked for three years in local government as an adviser to the deputy mayor of Shanghai , responsible for media .