Huawei is under the microscope of the US Department of Justice for potential violations of trade sanctions. If the Chinese tech manufacturer happens to come to the same fate that befell counterpart ZTE — having to admit it breached embargoes and eventually coming under a 7-year moratorium from buying American products — it would be able to continue sourcing hardware from most of its current suppliers. But what about the software on its smartphones outside of China?

What about Google’s services on Android? What about Android itself? Replacing an operating system with an app-rich ecosystem is a tall task to undertake.

Well, Huawei had been keeping an OS in the back burner — in fact, we know it had been working since 2016 to build one as a counter to Google’s considerations to limit the openness of Android’s licensing terms.

But The South China Morning Post now reports from sources that the process actually started back in 2012 when those sanctions investigations began and also has OS projects for tablets and PCs.

Here’s what Huawei founder Ren Zhengfei reportedly said at an internal meeting at the time:

We are developing our own OS out of strategic consideration, because won’t we be doomed if they suddenly cut off our food, don’t allow us to use Android or Windows 8…

Similarly, I don’t oppose buying high-end chips from the US when we are also developing our own high-end chips. I think we should use their high-end chips as much as possible to understand it well. When they no longer sell their chips to Huawei, we’ll be able to use our own chips in large quantities, even if they’re a bit inferior, they can still be used.

Zhao Ming, president of Huawei subsidiary Honor, reiterated to Chinese media last week that it would continue to “work very closely with Google” and use Android. Without confirm or denying an existence of one at the company, he does mention that a new OS is “a matter of capacity and necessity.”

Indeed, the company spends on the ranks of Amazon and Alphabet on research and development — it dedicated $14 billion last year. Huawei subsidiary HiSilicon buys Qualcomm and MediaTek chipsets as part of that research and uses them to aid in development of Kirin systems-on-chips.

Yet, one of the Post‘s sources chips in the caveat that these efforts still aren’t on par with Google’s and that many third-party apps are non-existent.

Losing Google services on Android would imperil Huawei’s growth of its smartphone businesses not just in the United States, but in all non-China markets where it is now focused. It is second to Samsung in shipping the most Android smartphones in the world with 153 million units moved in 2017.