Not sure if this also applies to the Galaxy S3, but you can try to look for sensors with a type value above TYPE_DEVICE_PRIVATE_BASE
. Many phones (for example Nexus 5x and Pixel 3) have one or even multiple sensors that exhibit a temperature reading through this and you usually can tell by the name of the sensor (for example "BMI160 Temperature" or "BMP380 Temperature", both on a Pixel 3).
These "vendor defined sensors" are usually from sensors that require a temperature reading for compensation/calibration (BMI160 is the IMU and BMP380 the barometer of the Pixel 3). Especially barometers are very likely to have a temperature channel.
However, there is a good reason that the manufacturer does not offer these temperature readings through the official TYPE_AMBIENT_TEMPERATURE
type:
Placing a thermometer inside an enclosed device that heats itself from the inside is not a good method to measure the ambient temperature. Especially if the temperature reading is only meant to compensate temperature drift of the sensor, you will not get anything useful as you mostly measure the temperature of the inside of your phone. Even if a phone officially measures ambient temperature, the results will not be very precise for the same reasons.
..Galaxy S4 and Galaxy Note 3, which currently are the only devices with a real temperature sensor..
; I'm not sure about other workaround, but you only have barometer in S3, maybe you can estimate the temperature from the barometer data? well, I'm really not sure about that.. – Avogadro