"Taiwan," he said, pointing to the island off the mainland Chinese coast. "Taiwan is not a country, it is a part of China. You can't take this." Loading A new customs regulation was being zealously enforced, as China ramped up diplomatic fury at Taiwan's independence-leaning government. "There is nothing on this globe that suggests Taiwan is not a part of China," I replied, deadpan, a journalist wised up to the One China Policy. "The typeface used for the city of Taipei is the same size as Beijing. It shows Taipei is a capital. It isn't," he said.

I got out a black marker and put a line through Taipei. "You can't take it, it is out of my hands," he repeated. I returned with a kitchen knife and scratched out the offending capital, acting not as a journalist but a mother who didn't want to explain to a seven-year-old why the precious globe had disappeared. Living in Beijing in a time of deteriorating international relations, I had determined to try to keep geopolitics at the office and out of my home, but failed. Raising an Australian boy in Beijing threw up interesting dilemmas.

Raising an Australian boy in Beijing threw up interesting dilemmas. Like the time I returned from a reporting trip in Xinjiang in China's far western desert. I had been detained and trailed by police who sought to stop foreign reporters speaking to Uighur Muslims, as the government locked up the Muslim population there en masse in re-education centres. I opened the door to find my son at home dressed in Chinese police uniform for Halloween. "You're under arrest," he declared, oblivious. I said nothing. A little boy who liked police, just like his Chinese playmates, he was a hit on the trick-or-treating circuit. When I told this story to a high-profile Hong Kong democracy activist curious about life in Beijing, she questioned whether this was the right approach. But as an Australian journalist in China, I saw my job as the independent observer – "independent always" – looking for facts, not an activist. Covering the trade war between the United States and China I would look through Australian eyes for the impact on Australia. As the Tweets raged against China supposedly banning Peppa Pig, I could still see Peppa everywhere, beloved by Chinese four-year-olds.

Foreign journalists were certainly among the groups (churches and non-government organisations were others) singled out for police scrutiny in China, amid overblown fears of foreign infiltration. But boys the world over liked to play police, I reasoned, so why disrupt a childhood? The array of Chinese armed truck toys, Lego police stations and Long March rockets at our place grew. Beijing's military museum held wonders like the downed "US imperialist" drone. When my son wanted to play spies with invisible ink, we asked him to keep his voice down, lest any real spies got the wrong idea. But geopolitics closed in. The Huawei technology wars I reported on from the office rippled into our lives, as my son's Canadian playmates were whisked away overseas last Christmas. Expat families reacted with shock to the arrest of a former Canadian diplomat on the streets of Beijing, and another Canadian at the airport the same day, in retaliation for Canada's arrest of a Huawei executive. Was any foreigner fair game in hostage diplomacy? Chinese-Australian writer Yang Hengjun was arrested a month later, accused of espionage in a separate incident the Australian government believes is unrelated to Huawei.

Pro-democracy blogger Yang Hengjun has been detained in China since January. Credit:AAP By the end of this year, my son had put the police toys aside. With my frequent absences in Hong Kong covering six months of protests, it became too hard to say nothing when I returned home coughing, with a burning throat and threw my clothes into the washing machine to remove toxic gas. My son worked out the connection between police and tear gas. The TV screen went black as the BBC crossed to Hong Kong, and our Chinese friends were instead fed state propaganda that Hong Kong was beset by "terrorists". But my son worked out the connection between police and tear gas. On the streets of Hong Kong I watched children traumatised as police beat protesters, firing rubber bullets and tear gas canisters at head height. Many protesters were school students and as the months rolled on even heckling police from the footpath or carrying a gas mask in a backpack on the subway could earn arrest. Eighty arrested teachers were suspended from schools.

The breakdown of trust between little boys and police will be an enduring legacy of Hong Kong Chief Executive Carrie Lam's mishandling of the 2019 political crisis. However the protests may end in the short term, a generation of Hong Kong children have been radicalised because instead of negotiating, a government sent out police to crack down on a population who had come to the streets peacefully. The reason for Lam's inflexibility is Beijing. As Chinese President Xi Jinping forces the Communist Party further into the core of Chinese life – in universities, schools, churches and offices – demands for democratic reform in Hong Kong do not fit the Five Year Plan. Demonstrators hold signs during a protest in the Causeway Bay district of Hong Kong. Credit:Bloomberg For the first two years of my posting, Xi's control appeared absolute. As the trade footprint of the world's second-largest economy grew, he was lauded internationally when he spoke in support of globalisation at Davos in 2017. When the party's twice-a-decade summit was held later that year, general secretary Xi's eponymous ideology was written, Mao-like, into the constitution. Breaking convention, no heir apparent was appointed. A corruption crackdown swept away enemies. By 2018, term limits on the president were removed, potentially allowing Xi to remain president for life.

Yet the party leadership and its security apparatus sensed before any Western onlookers that 2019 – the year of anniversaries – held danger. Warnings for police to be on the lookout for "colour revolution" in January appeared paranoid. As the economy slowed amid a trade war with the US, and a killer virus wiped out a third of the nation's pig herd, the anniversaries rolled in. The centenary of the May 4 student protest movement segued potently into the 30th anniversary of the Tiananmen Square massacre four weeks later. Almost on cue, pent-up frustration with communist China erupted in Hong Kong as a million people took to the streets on June 9. The protests haven't stopped. I was caught between two major news events, seemingly worlds apart. What was unimaginable in January was that the next anniversary, October 1, the 70th of communist China's founding, would collide with boiling street anger in Hong Kong. Blood was spilt that day.

In Beijing, a choreographed military spectacle was watched on TV by hundreds of millions of mainland Chinese, who probably felt genuine national pride. I was caught between two major news events, seemingly worlds apart. I flew from Hong Kong to Beijing on September 30, only to be told upon landing that I was banned from collecting my tickets to the military parade the next day. I flew back to Hong Kong, sleepless, after police there began firing live rounds on October 1, hitting a teenage protester, and did a TV news update for Nine. Chinese female militia members march in formation during a parade to commemorate the 70th anniversary of the founding of Communist China. Credit:AP During my China posting I witnessed the rise of the digital surveillance state. In 2017, People's Liberation Army soldiers stood guard at my office and apartment compound gates. They were soon replaced by cameras, lots of cameras, as white cyclopes appeared on most street corners. Facial recognition screens I had first seen in Xinjiang soon replaced ticket collectors at Beijing train stations. More than 700 million Chinese had smartphones and were ditching cash and telephone networks to rely on Tencent's most convenient WeChat app to pay and socialise.

Digital China is on track to be a world leader. Fibre runs to the home in ancient Beijing "hutong" alleys, delivering 100MB to pensioners while Australia argues over the failure of the NBN. 5G has already begun rolling out. But in an authoritarian state there is a catch. I listened as Tencent founder Pony Ma revealed at China's own "World Internet Conference" that when WeChat used artificial intelligence to allow commuters to scan a barcode with their smartphone at the subway instead of buying a ticket, there was also a "security" feature. "It also gives authorities access to the real identity of passengers," he said. President Xi Jinping after inspecting troops during a parade to celebrate the 70th anniversary of the founding of Communist China in October. Credit:Getty Artificial intelligence and big data – pushed as a research priority by Xi – were starting to be deployed against the population. China's government-controlled media hyped up the potency of AI cameras that could scan faces in the massive crowd at Qingdao's famous beer festival, for example, and match them to criminal databases, leading to arrests. As AI improved "security", it was also diminishing what small space was left for privacy.

A question mark remains over whether the billions of pieces of data generated by all those cameras can yet be processed swiftly enough for authorities to join the dots – outside localised trials. My personal answer came when I drove to the outskirts of Beijing to cover a protest by parents unable to enrol children in the local school. It was a middle-class area, and these parents had organised on social media to picket the local government. A sea of umbrellas must have initially obscured my presence from the security cameras as I interviewed angry parents happy to speak to the media. When the secret police moved in, they held a video camera to my face first. When the secret police moved in, they held a video camera to my face first. I smiled. When they returned 10 minutes later, a dozen men in black T-shirts demanded I go with them. They addressed me by my Chinese name, Haiyun, recorded only on my government-issued press card, which I hadn't shown. The foreign journalist dataset had been loaded into the facial recognition system.

I had great material, but looking at the parents' faces when the undercover police arrived, I decided I couldn't use it. The typical "picking quarrels" charge for a public protest in China led to jail time, and there were six-year-olds here. The Communist Party is paranoid about the presence of foreign media at protests, even over livelihood issues, because it accuses foreigners of trying to foment colour revolution. Back in Australia, politicians were arguing in a similar tone about "Chinese foreign interference". A circle of mistrust. Before I left Sydney in 2017, I lunched with a group of former China correspondents, who each reflected that Australians still knew little about China despite our newspapers opening a bureau in Beijing in 1973. Returning in 2019, I don't think that situation has improved. Living in China it is clear that climate change and environment policies are being prioritised in a way that Australia, selling coal, refuses to understand.

Australians in China repeatedly told me they were unhappy with the noisy domestic political debate back home over "Chinese interference". It seems anyone working in China was well aware of the hurdles for foreigners there, and Australia's "China debate" was breeding more suspicion, the opposite to the long-term project of making China more open to the world. The hurdle was the increasing reluctance of Chinese people to go on the record. For a reporter on the ground trying to report China as it really is, the hurdle was the increasing reluctance of Chinese people to go "on the record" in foreign media, unwilling to risk the trouble this might bring. Insightful interviewees pulled out of stories as the geopolitical winds blew. One time, I travelled 1800 kilometres to Chongqing to stand outside an office door, interview unconfirmed after months of faxes. "We're here," my photographer colleague announced. Officials finally relented and the gates to the trans-continental train yard, the birthplace of Xi's Belt and Road Initiative, were unlocked.