China and India killing each other and wrecking their futures is the American wet dream. No more threats of Asian rising powers. The way China is acting with regards to India is exactly trying not to fall into this US trap. India continues to provoke and escalate, while China always tries to talk India out of it to no avail. India says that the Galwan incident is Chinese provocation. But who really started this whole mess? Its India with their abrogation of Article 370 and subsequent aggressive rhetoric and moves against Aksai Chin. India is too stupid to see this old American trick of divide and conquer, so it is a lost cause trying to reason with them. China has no choice, but to manage this new reality.
Attacking India wouldn't necessarily weaken China. US going to war with Iraq didn't end the threat from the Americas, although it arguably deflected them from other things for a few years.
Demostrating the PLA in 2020 against a suitably weak yet overconfident and overhyped target can send signals to the rest of the world that China is a reliable military ally, it would further increase the status of its arms products and show other challengers that a conflict with them is not worthwhile.