Shanghai has built around 150 smart public toilets, but you'd better not spend longer than 15 minutes inside or an alert will be sent to municipal workers to check on you.
The new toilets are part of China's efforts to extend AI into almost every aspect of daily life and come hot on the heels of smart rubbish bins and AI-powered traffic lights.
Each toilet stall has a human body sensor, using infrared rays and ultrasound to detect the person inside and how long they have been sitting there, according to a document released by the city government.
Sensors also monitor the air quality inside the cubicle and a water-saving feature will adjust the water level based on occupancy time.
Beijing, Guangzhou and Shenzhen are also working to make public toilets smarter. More than 700 cities in China have proposed or are in the process of building smart infrastructure, according to a report by the Qianzhan Industry Research Institute earlier this year.
By 2019, the market size of China's smart cities is expected to exceed 10 trillion yuan and is predicted to reach 25 trillion yuan by 2022.
Technology is being applied to everything from airport security and crime prevention to garbage sorting in China. In the southern hi-tech hub of Shenzhen, jaywalkers have already been named-and-shamed by pilot facial recognition schemes.
Still, not everyone may be so enthusiastic about the new toilet facilities.
"I think it's OK with me but probably not a good idea to watch my phones inside the toilet".
"This could be embarrassing for me," said some local residents.