Actually, nowadays, temperature sensor is changed into CPU built-in sensor or thermal resistor. In addition, such a sensor is fitted inside the chip. That’s to say, the programmer can check it.
PS: There are four contact points of battery in a non all-in-one phone, two of which are used to monitor electricity and temperature.