Google doesn't have to make software in order to make money. About half of its revenue comes from advertising. All Google has to do is to grow the number of consumers who use the Internet. As long as Gmail, Google Search, and Android keep people using Google to search, then Google can sell ads, and then Google can make money. AdSense and AdWords are revolutionary. It's so easy to buy and sell ads using the Google system. The bottom line is to force the advance of Internet capable systems.
That's why Google fostered Android. You can hate Android, but you can't deny that it increased the number of mobile Internet devices, and that most of those users rely upon Google services. Chrome made web-browsing more consistent, which meant that webmasters could make better pages, which meant more advertising. So Google doesn't care who makes the smart phones so long as smart phones are being made.