https://www.bloomberg.com/news/articles/2016-01-21/google-s-... $22 billion profit.
iOS is a bit more complicated to value, but they've made more than $10 billion just in app store commissions (even not counting increased sales of hardware due to iOS). So if you consider the cost of iOS development as weighed against their hardware sales, and book the software as profit, you'd get more than $10 billion. The real profit numbers are probably higher.
Anyway, the point is that there's no reasonable way to assert that either one of them isn't profitable.
Samsung is pulling in about $4B profit per quarter from their smartphones. "Marginal"? In what universe is $16B per year "marginal"? Certainly not this universe.
Just as a point of reference, Samsung's smartphone profits are greater than Walmart's profits. It's greater than the overwhelming bulk of world corporations.
At the scale of investment required to run a mobile business, Android is generally a bad thing, it's commodifying them in the way that Intel did to the desktop PC market.
It's Galaxy, not universe!