Apple reported lackluster earnings on Tuesday as the company’s iPhone sales continued to slide. The numbers make it clear that the future of the consumer products behemoth is no longer in its consumer products. The fix? Apple should release a version of iOS for non-Apple devices. This suggestion will seem like heresy to the brand’s loyalists, but it may be necessary for the success of the company.

Imagine those Samsung, LG, and Xiaomi smartphones having an original Apple operating system on them rather than the imitations they are presently running. Offered the choice, users would upgrade in droves. And those users would download new applications and sign up for Apple’s subscription services, giving the company a cut of everything they purchased, as well as valuable data and marketing opportunities. Google’s Android business would finally have a formidable rival.

Apple should release a version of iOS for non-Apple devices.

Apple’s second-quarter profits were 27% lower than in the same quarter last year. On the bright side, it said that quarterly revenue from its services business—the App Store, iTunes, and streaming music—grew by 19% year-over-year to $6 billion, making these services its second-largest revenue earner after the iPhone.

If Apple made iOS available on other phones, it would not only multiply the markets for its service businesses but would also allow the devices to become a platform for all sorts of new products and subscriptions that other companies would develop.

Apple has reportedly been working for years on developing video-streaming services that act as a version of Apple Music for TV and movies. If the company opens its platform, these could potentially be made available to billions of people.

The reason Apple’s profits are falling is that it doesn’t have any bold new products. Also its worldwide market share in smartphones is shrinking. According to Gartner, Apple’s marketshare fell to 14.8% in the first quarter of this year from 17.9% a year earlier. At the same time, the overall market grew by 3.9%, and Android increased its market share to 84.1%.

The reason Apple’s profits are falling is that it doesn’t have any bold new products.

Instead of owning a big chunk of a large pie as Google does, Apple owns a decreasing share of an increasing market. Yes, Apple’s slice has been the most profitable, but, as this quarter’s results indicate, that will not last.

Microsoft offers a cautionary tale. The company was protective of its core operating system for the longest time, causing it to lose the smartphone market. When Microsoft released its mobile operating system, Windows RT, in 2012, Microsoft bundled its Office product into it and charged resellers a price of around $85 per device. This made Windows more expensive, in some cases, than the hardware. And even though Microsoft changed strategy after Satya Nadella took over as CEO in 2014, and started giving Windows away, it could not regain the momentum it had lost. Today, Microsoft retains a paltry 0.7% of the smartphone market.

Without expanding its operating system, the future looks bleak for Apple. Full-featured smartphones can be purchased for as little as $50 in China and India today. That price will fall to less than $25 over the next three or four years, and billions of people will be purchasing them. But these will be Android-powered devices. Apple will find that its market share has shrunk to the low single digits and that it has become even less relevant in the consumer space. Yet, unlike Windows RT, which was inferior to Android, iOS is far better than Android. That is why Apple needs to grab this market while it still has an advantage.

Without expanding its operating system, the future looks bleak for Apple.

Will doing so eat into iPhone revenue? Yes, it will in some markets, but that is happening anyway. Chinese competitors such as Huawei and Xiaomi Corp. are selling devices with comparable hardware, for a fraction of the price of the iPhone. As a result, the iPhone’s market share in China reportedly fell from 16% in 2015 to less than 13% in 2016. Apple doesn’t even have the best devices any more. Consumer Reports recently ranked the Samsung Galaxy S7 far higher than the iPhone 6s. Samsung has also topped Apple in customer-satisfaction surveys.

And then the question is whether iOS can run on non-Apple devices. It surely can. Hackers have been demonstrating that for years. One ported key parts of the iOS core to the Nokia N900 in 2013. I have myself installed an older version of Mac OS X on a Dell desktop and been able to dual boot between Windows and OS X on the same hard drive. Most of the components of an iPhone are purchased from third-party suppliers, so there is little that is proprietary.

Making iOS available on other devices will remove a critical competitive advantage that the iPhone enjoys, but it will create many new revenue streams and will be better for Apple’s long-term survival. Apple’s innovation machine has largely stalled; the iPhone was the company’s last major product invention. Declining market share may be just what it will take to jolt Apple’s hardware designers and product developers out of their complacency and get them aspiring to deliver products as imaginative and groundbreaking as the iPhone once was.