The Trump administration is locked in a messy trade war with China that isn't showing any signs of ending. The situation seems to be escalating day by day as both sides are unwilling to reach a compromise. President Trump has threatened to further raise tariffs on Chinese imports if there's no progress on trade talks at the end of this month.

There are a ton of companies and industries suffering thanks to the U.S.-China trade war, but there's one unlikely beneficiary that could witness a turnaround in its fortunes: Apple (NASDAQ:AAPL). The iPhone maker has been struggling to sell its premium devices thanks to the emergence of Huawei, but Trump's trade war could prove to be a tailwind for Apple. Let's see why.

Huawei is being frozen out

Huawei has turned out to be a worthy competitor for Apple in recent years. In fact, the Chinese company occupied the second place in global smartphone shipments in the first quarter of 2019 with a market share of 19%, according to IDC. This is a nice jump from the year-ago period's market share of 11.8%.

Apple's fortunes, on the other hand, have nosedived over the same period. The company has now slipped to third in global smartphone shipments with a market share of 11.7%. A year ago, Apple occupied the second spot with a market share of 15.7%. The iPhone maker's shipments fell an alarming 30% year over year during the first quarter, while Huawei saw a 50% spike.

However, Huawei's growth seems all set to take a hit as it is the poster boy of the U.S.-China trade war. The U.S. is going all-out to freeze Huawei, with the Trump administration blacklisting the Chinese conglomerate that's known for supplying networking gear and smartphones.

As Huawei is now on the U.S.'s Entity List, meaning any U.S. company looking to do business with the Chinese company will have to obtain an export license from the Commerce Department. As it turns out, the Department follows a policy of denying such applications, as reported by Politico.

Not surprisingly, Huawei is witnessing major fallout from this move as several companies are now unwilling to do business with the chipmaker. For instance, Western Digital has stopped shipping its data-storage products to the Chinese company. Alphabet's Google had also taken the step to suspend its business with Huawei, restricting updates on the Chinese company's Android-powered devices.

Moreover, chipmakers such as Broadcom, Qualcomm, and Xilinx are also stopping Huawei from using their products and technology.

Huawei claims that it has enough chips in storage to last for six months of smartphone production. At the end of those six months, it aims to start making its own chips, and also deploy its own operating system to replace Android. But there's one problem that Huawei might not be able to overcome.

British chip designer ARM has reportedly told employees to immediately stop providing services and technology to Huawei. That's because ARM licenses technology from U.S. companies as well, which is why it falls under the ambit of the U.S. ban on Huawei.

This is bad news for Huawei as 98% of smartphones globally contain at least one chip designed by ARM. This means Huawei will now have to design certain chips from scratch as it cannot license ARM technology anymore under the current scenario.

But the lack of parts and technology is just one side of the equation. As leading technology providers cut off their supplies to Huawei, consumers might lose confidence in the Chinese smartphone maker. This has the potential to dent sales, and probably allow Apple to claw back its smartphone market share.

Apple might have an upper hand

Apple lost ground in the smartphone space to Huawei as the latter started delivering cutting-edge products at competitive prices. But the iPhone maker's sales could get a shot in the arm thanks to the U.S. ban on Huawei for a few simple reasons.

As I have already stated, Huawei runs the risk of losing consumer confidence. If you're worried that you might lose Android support to your smartphone, there's a good chance you might not buy a device from that brand.

Second, Apple is expected to remain unaffected (or less affected) by the U.S.-China trade war despite its manufacturing footprint in China. That's because Foxconn, which is Cupertino's largest manufacturing contractor, recently said that 25% of iPhone production capacity is outside of China. Foxconn went on to add that it has "enough capacity to meet Apple's demand," and it could move its entire production out of China if needed.

But even if Apple doesn't elect to move its production out of China and decides to absorb the costs of any tariff, the iPhone maker's earnings per share will take a hit of only 6% to 7%, Bloomberg reports. Passing on the tariffs to customers could increase iPhone prices in a range of 9% to 16%, and that could reduce demand by 10% to 40%.

So, it would make sense for Apple to absorb the higher tariffs if they come into play later this month. That's because if Apple manages to eat into Huawei's market share, its sales should improve and help offset some of the margin losses.

Apple's sales in Europe fell nearly 23% in the first quarter of 2019, while Huawei's shipments had shot up 66%. As such, Apple has a lot to gain from Huawei's travails.

Moreover, Apple won't have to run from pillar to post for parts and technology like Huawei. So, it should ideally be able to produce phones in larger quantities compared to its Chinese rival, which now has to work on developing in-house chips.

As such, don't be surprised to see an uptick in iPhone sales as those who were looking to buy a Huawei device shift to Cupertino's offerings or other Android phones, making Apple an unlikely beneficiary of the U.S.-China trade war.

This article originally appeared in The Motley Fool.

Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Harsh Chauhanhas no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Alphabet (A and C shares), and Apple. The Motley Fool owns shares of Qualcomm and has the following options: long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool recommends Broadcom Ltd and Xilinx. The Motley Fool has a disclosure policy.

iPhone handheld
The logo of FaceTime is pictured on an Iphone screen in Berlin on January 29, 2019. AFP/Getty Images/Odd Andersen