How to access sensors not listed by SensorManager?

35 Views Asked by At

Some devices have a pressure-sensitive virtual home button, that is considered a pressure sensor, not a button. As far as I know these Samsung Galaxy devices are affected: S8, S8+, S9, S9+, Note10, Note10+ and Fold.

Screenshot of Samsung Galaxy S9 and S9+ specs on https://www.samsung.com/global/galaxy/galaxy-s9/specs/. Sensors: Iris, Fingerprint, HR, Pressure (!), Gyro, Proximity, Accelerometer, Geomagnetic, RGB Light, Barometer, Hall sensor. Buttons: On/Off, Volume, Bixby. (Home key is not on the list.)

Since it is a sensor, it should be listed by SensorManager:

for (Sensor s : ((SensorManager) getSystemService(SENSOR_SERVICE)).getSensorList(Sensor.TYPE_ALL))
        Log.d("Sensor", s.getName());

But it wasn't when I was testing on such a device. How else could it be accessed? I don't know enough about HAL (Hardware Abstraction Layer). I don't know if drivers of the Linux kernel can be used directly. Or is there an undocumented way to access the pressure-sensitive virtual home button?

0

There are 0 best solutions below