The COVID-19 quarantine in China is thought to have reduced ambient air pollution. The overall exposure of the population also depends, however, on indoor air quality and human mobility and activities. Here, by integrating real-time mobility data and a questionnaire survey on time-activity patterns during the pandemic, we show that despite a decrease in ambient PM2.5 during the quarantine, the total population-weighted exposure to PM2.5 considering both indoor and outdoor environments increased by 5.7 μg m-3 (95% confidence interval, 1.2-11.0 μg m-3). The increase in population-weighted exposure was mainly driven by a nationwide urban-to-rural population migration before the Spring Festival coupled with the freezing of the migration backward due to the quarantine, which increased household energy consumption and the fraction of people exposed to rural household air pollution indoors. Our analysis reveals an increased inequality of air pollution exposure during the quarantine and highlights the importance of household air pollution for population health in China.