I think this is exactly backwards. Xi was previously exploiting the US’s preoccupation with the Middle East to build up China’s military and militarize South China Sea islands.
With a large chunk of the US military bogged down in a multi-front stalemate with Taliban all across Afghanistan, and maintaining stability in a destabilized Iraq, it was the perfect time for CCP to exploit their limited capabilities.
The US withdrawal from Afghanistan and drawdown in Iraq is clearly about freeing up those forces to refocus on China and possibly Russia, in a pivot back to Great Power competition and balance of power strategies.
The CCP is publicly trying to convince East Asia that the US withdrawal from Afghanistan means the US won’t stand by its allies there, but that’s just posturing. I’m pretty sure both those allies and the CCP know it means exactly the opposite.