Huawei has developed its own proprietary operating systems, and it’s ready to implement them in case its US legal battle leads to a ban on the export of US-made products and services like Android and Windows.

“We have prepared our own operating system, if it turns out we can no longer use these systems, we will be ready and have our plan B,” Huawei executive Richard Yu shared in a recent interview with Die Welt. Huawei began working on an Android replacement as early as 2012 when the US opened an investigation into Huawei and ZTE, according to the South China Morning Post, and it was still developing the system in 2016. The announcement of its “plan B” operating system comes at a time when Huawei is ensnared in an ongoing legal battle with the US, which could result in the company being banned from receiving exports from the US. If it comes to that, Huawei says it will be ready.

Related How China rips off the iPhone and reinvents Android

Recently, Huawei sued the US in response to a ban that prevents its tech from being used in “federal networks, effectively also preventing major government contractors from using Huawei equipment,” according to a report from The Verge’s Colin Lecher. Huawei’s suit states that the US “unconstitutionally singled out Huawei for punishment” and that a ban on Huawei would put America behind other regions in the race to build out 5G networks.

Yu shared that Huawei would “prefer to work with the ecosystems of Google and Microsoft,” but that it’s ready to switch over to its in-house operating system should the legal climate worsen. Since Huawei makes the Kirin processors found in most of its smartphones, it would be in a much better position to weather a ban than ZTE, which suffered a three-month ban in 2018. That prevented ZTE from using Google’s Android operating system and from receiving exports from US companies to develop its smartphones.

Even though it says it’s ready with an OS replacement for its computers, Huawei would need to find new hardware partners since it relies on Intel processors in its Windows laptops. With Intel and Qualcomm off the table and MediaTek processors generally reserved for cheaper, low-performance devices like Chromebooks, Huawei may need to start developing its own laptop-grade processors.