Chinese tech giant Huawei will invest US$800 million in a new factory in Sao Paolo, Brazil as it doubles down on efforts in Latin America to compensate for being excluded from the US market, the Business Insider reported.

The Chinese communications technology titan already has roots in Brazil: It has operated in the country for over 20 years and employs 2,000 workers at a networking-equipment manufacturing plant in São Paulo. The news comes amid continued threats of bans that would block US companies from conducting business with Huawei.

According to Brazilian news outlet O Globo, in order to accelerate the construction of a 5G network in the country, Huawei is planning for a 5G frequency spectrum auction next March. It plans to produce 5G smartphones at the new factory.

Brazil is the fourth-largest smart phone market in the world. It also imposes heavy import tariffs on smart phones, so many smartphone makers, such as Samsung, LG, and Nokia have built factories in Brazil.

US President Donald Trump has urged governments worldwide to shun Huawei, arguing that its equipment could be vulnerable to eavesdropping by China’s government.

But despite pressure from the United States, Brazil’s Vice President Hamilton Mourao has said the country has no plans to limit Huawei’s business in Brazil, nor will it ban the company from building domestic 5G networks.

However, the country’s unpredictable President Jair Bolsonaro could go against this sentiment and, following the US’s lead. Bolsonaro touts himself as a “pro-America president” and has said he wants closer ties with the US.

Meanwhile, Huawei has promised billions of dollars in new facilities and thousands of jobs to countries that give its brand a fair shot.

For instance, in Italy, Huawei announced plans to invest US$3.1 billion over the next three years and create 1,000 jobs, but called for fairness in the country’s 5G deployments — a thinly veiled pitch for Italy to include Huawei equipment in those deployments.

And in Poland, the company said it would spend almost 3 billion złoty (US$789 million) over the next five years, though it also said the investment was dependent on its role in Poland’s 5G deployments.

In South America, Huawei is the fourth-largest smartphone vendor, behind Samsung, Motorola and Apple, with an 8% market share, according to Statcounter.

Brazil’s mobile phone market holds a growing revenue opportunity despite decreased unit sales due to macroeconomic factors — revenue from phone sales jumped 8% year-over-year to US$3.5 million in Q1 2019, according to IDC data.

A local factory could help the phone maker reduce device prices, as it would no longer have to ship devices from its factories in China. This could make the phones particularly attractive in the cost-sensitive Brazilian market.

Meanwhile,  Huawei execs recently revealed the company’s “plan B” for the company’s future.

Richard Yu, CEO of Huawei’s Business Group, quickly unveiled the new Huawei operating system, called HarmonyOS, Forbes reported.

Harmony is not a mobile phone system to replace Android but rather is designed to work on devices from tablets to phones, smartwatches to cars and much else besides. And one other key thing: it’s open-source.

It means that Harmony can be adopted by third-party manufacturers who want to ensure their Internet of Things devices can talk to others, the report said.

While it’s been confirmed that current devices such as the Huawei P30 Pro will be able to receive the next version of Google’s phone operating system, Android Q, it’s not clear yet what will happen to future devices.

Huawei has made it very clear that it doesn’t want to abandon Android, saying it wants to keep working with its American partners. Switching to Harmony would only happen if Huawei was forbidden to use Android.