You are approaching it from the wrong angle. Microsoft used to give away it's operating system (easy to pirate), hence why all those little shops that made computers when you didn't have to buy software. Now that is no longer it is more of a level playing field. Now Google is giving away it's software, but the scale of sales are so much more massive, the software isn't so large a factor.
One could compare this to Betamax and VHS, but the Betamax (a better device) was priced to about twice the price until near the end when VHS was 90% of the market and Betamax couldn't recover because rental stores all had VHS. The current iPhones are a little above or the same as the top line others, there is little price difference. Apple is still good here, I think the iPhone is well positioned. The licensing is a factor as any can be made anywhere for cheap components, while the Betamax was made in Japan, but with today's methods Apple outsources and is the same method everyone else uses. No advantage to anyone.
The only advantage here is Google developing and giving away the operating system to keep makers weak and keep options open for their own company (good long term thinking).
Long term - 5 years from now. Phones will be powerful enough and "smart" enough that it will do everything one wants for a commoditized price. The operating systems and components will not matter as much. Right now we have large jumps in improvement that will slow down. The established players will fight it out and the price will go down to $250-400 instead of $400-700.
Can Apple sort itself out for that time? They have the cash to bleed. Management stability so shouldn't have the implosion that happened at Nokia. Nothing is guaranteed but the company is as strong as anyone else right now.