Google makes more money from iOS than they do from Android. Of course Google doesn't mind if you switch hardware vendors, just so long as you keep using Google products.
Also, I disagree with the notion that Apple "heavily pushes vendor lock in". They certainly don't go out of their way to make it easy to switch, but I can't come up with any examples off the top of my head where they're deliberately making it harder to switch without having a good reason for that decision. After all, Apple doesn't really have to do anything at all to keep people invested in its ecosystem, since platform-specific software, by its very nature, already acts as a form of lock-in, and iOS has a lot of software that other platforms don't.
Also, I disagree with the notion that Apple "heavily pushes vendor lock in". They certainly don't go out of their way to make it easy to switch, but I can't come up with any examples off the top of my head where they're deliberately making it harder to switch without having a good reason for that decision. After all, Apple doesn't really have to do anything at all to keep people invested in its ecosystem, since platform-specific software, by its very nature, already acts as a form of lock-in, and iOS has a lot of software that other platforms don't.