AllThingsD, Barra says that he has had a close relationship with Xiaomi for years, because the company was started by a number of ex-Googlers including Bin Lin, who had been in charge of Google's mobile engineering team in China. Barra and the Google team were always impressed with what Xiaomi was doing because while the company was forking Android, "it was a fully compatible fork". Even Google's head of Android User Experience, Matias Duarte was impressed with how Xiaomi was extending Android.In an interview with
Barra says that the talks concerning his move to Xiaomi have been ongoing for about a year, and that he was always interested because he saw it as a once-in-a-lifetime opportunity not unlike what it would have been like to be at Google when it was first starting. Barra (and many analysts) believe that Xiaomi has the potential to be in the conversation with companies like Google and Amazon in the future, because it makes quality hardware, but aims to sell it at cost and make its profits through software services.
Barra was open with Google about his opportunity, saying that himself, Google execs, and Xiaomi have been discussing this since around the time when Andy Rubin stepped down, which was back in March. Ultimately, Google realized that if it was going to lose a top guy, the best place to be would be a "friend", and Google and Xiaomi have been close partners.
Of course, Barra still has a long way to go, admitting that he has only just started learning Chinese, and maybe more importantly that he doesn't really know how to run a company, but he intends to learn fast.