The reality is probably that companies are making a bet on some far fetched technology, so for example Fuschia or the developers behind it could lead to something insanely profitable, but there's only a 20% chance. If you're in a good year then the investment is worthwhile because the expected value is still positive. If you're in a bad year you can't afford to wait for the investment to pan out (not to mention your risk model goes totally out of whack; if the market is doing poorly consumers won't shell out cash for this new tech) so you have to cut costs in that area.
In this particular case, though, you're probably right. Android itself was one of those whacky ideas that no one expected to gain any traction. Google funds moonshot projects as a matter of company culture and self-identity and it seems to actually make them money. Of course, the possibility still exists to cut them for short-term gain and I doubt no one factors that into their equation at all.