No company wants to report that its sales have declined. But when you’re Apple, which has consistently seen its revenues grow for more than twelve years, it’s not just bad news but a serious kink in a joyful narrative of boundless possibility. Earlier this week the company—the most valuable in the U.S.—told shareholders that revenues had declined by thirteen per cent. Apple’s chief executive, Tim Cook, did his best to spin the numbers—temporary currency fluctuations were to blame; sales will rise again as the iPhone SE continues its rollout; the company will rebound thanks to “the incredible strength of the Apple ecosystem.” But Cook couldn’t assuage fears about the biggest reason for the revenue decline: a twenty-six-per-cent drop in sales in China, Taiwan, and Hong Kong, accounting for fifty-eight per cent of the over-all decline in Apple’s growth. The company’s stock price promptly plummeted.

China is enormously important to Apple and other tech companies right now. The country’s billion-plus consumers represent a tremendous opportunity for growth. When China’s economy slows, as it has recently, Apple’s revenues are inevitably hurt. But Apple also got a perhaps more worrisome sign for the long term just days before its quarterly earnings report, when China blocked its citizens from accessing iTunes Movies and iBooks—just the latest move showing that the country’s response to U.S. tech companies’ ambitions will be to fortify its borders. Where much of the planet has embraced the Internet as more or less open and transnational, China is striving to make it closed and national.

Shutting down iTunes was by no means the most dramatic move made by the government of President Xi Jinping this week; it also passed significant restrictions on the thousands of foreign N.G.O.s currently operating in China, including a requirement that they submit to police inspection and supervision. China views the proliferation of Western, and especially U.S., technology as a stealth attempt to assert American economic and political power at its expense. Through that lens, blocking Western content and Western companies is an act of national defense. It is also a challenge to the notion of a liberating and open Internet, and China, in particular, has tried to build a wall around its citizens, not only via censorship and surveillance but by acting to limit the influence of foreign companies and organizations that might undermine Communist Party control.

In 2009, the country blocked Facebook, purportedly because the service had been used by protesters in the province of Xinjiang. Repeated attempts by Facebook’s C.E.O. Mark Zuckerberg to persuade the Chinese authorities to rescind that ban have been unsuccessful. Prominent Western media outlets, such as the Times and Bloomberg, have been blocked, as well. In tandem with these moves, Chinese authorities have fostered and sheltered domestic companies, which already have the advantage of a keener understanding of the country’s unwritten rules of commerce—of what boundaries are elastic and which lines can’t be crossed. Chinese authorities have quietly formalized a list of Western technology giants—Microsoft, Qualcomm, Google, Intel, Cisco, I.B.M., Oracle, and Apple, the so-called eight guardian warriors—identified by the Party as companies that had “seamlessly penetrated” Chinese society And, for years, the Party has built up mainland competitors that could provide the same technology and services, first by studying and working with U.S. companies and then, once the Chinese versions of the tech giants were sufficiently developed, by making it more and more difficult for those eight and their like to operate in the Chinese market. And you could argue that China doesn’t need those foreign companies. If a Chinese company like Alibaba can provide abundant online shopping and payment systems and Baidu can provide Internet search for the country’s 1.4 billion people, why does China need Amazon or Google?

Which brings us to this week, and the moves against Apple. While preventing books and movies from flowing into iPhones and iPads doesn’t directly impact the sale of those devices, an iPhone without its content store is ultimately like a flat-screen TV without streaming or cable: it’s a nice piece of pricey hardware with limited function. While China’s move might disappoint some customers, it’s of a piece with its goal of fostering domestic competitors to Apple and its Silicon Valley peers. Last year, Xiaomi, a company barely five years old, sold more smartphones in China than any other company. Estimates place Xiaomi’s valuation at more than forty billion dollars, and its devices aren’t just competing with Apple on price and functionality; they are starting to win the war of cool.

The pace at which China is building its walled-off world, filled with hardware and software created by Chinese companies, with only selectively allowed non-Chinese content, is accelerating. Lately, the government has lately been shutting down virtual private networks (V.P.N.s), which had been the primary means for Chinese citizens to access Web content restricted by government censors. Of course, there’s no guarantee that China’s ambitions to create this hermetically sealed Internet will succeed. That said, on the same day that Apple reported earnings, the Wall Street Journal reported that Chinese regulators have moved to halt a burgeoning joint venture between Disney and Alibaba to stream Disney content to Chinese consumers. No explanation was given, but perhaps none was needed.