Xiaomi said total smartphone shipments in the second quarter rose to 32 million.

Huawei's market share in China surged by 31% in the June quarter, according to market research firm Canalys, while Xiaomi's share shrank by a fifth. But Canalys reckons Xiaomi's shipments to Europe surged 48%.

The company, which listed last year, gets the majority of its revenue from mobile handsets, but also makes money selling online ads and other consumer devices.

Huawei has received a lot of support from Chinese customers who are buying the company's phones after it was blacklisted by the United States, limiting access to U.S. components and technology.

Diversification

Xiaomi's internet services unit, which makes money primarily by placing ads across various apps, accounted for 8.8% of its revenue, flat from one year prior.

When Xiaomi listed in July 2018, executives touted the business unit as key to the company's continued growth.

On an earnings call, leaders instead highlighted the company's so-called "AIoT" strategy, short for "Artificial Intelligence and Internet of Things," in which it invests in artificial intelligence and smart home devices.

The firm has invested in several companies making semiconductors or other key hardware components, trying to emulate the success of Huawei's HiSilicon semiconductor division.

In the second quarter, Xiaomi funded Verisilicon, a Shanghai-based chip design firm. It also invested in Bestechnic, which designs chips for audio devices.

Several of the companies in which Xiaomi has invested had recently listed or plan to list on China's newly-opened STAR market, including scooter-maker Ninebot, which acquired the Segway brand in 2015.

Xiaomi's chief financial officer, Chew Shou Zi, said the investments stem in part from the company's hopes to build a "Chinese supply chain", while improving its internal research and development abilities.