Having an office in China (they actually have several) is different from having a market in China. They pulled out the market.
Fun anecdote: In 2010, it was Sergey Brin (now a president of Alphabet) who drove Google's withdrawal from China. In 2018, in what I'm sure is just a coincidence, the public found out that Google's project shares the name with Brin's yacht: Dragonfly.