andreasgal/B2G — Issue #72: QEMU sensor not working
Author: shianyow
Created: 2011-12-04 13:53:42+00:00
State: open

Current QEMU sensor is not working, the logcat shows following error:
D/SensorService( 61): nuSensorService starting...
E/SensorService( 61): couldn't open device for module sensors (Invalid argument)

The reason is, QEMU sensor implementation sdk/emulator/sensors/sensors_qemu.c is using the deprecated HAL definition, it makes QEMU sensor registration failure.

Sensor HAL definition:
hardware/libhardware/include/hardware/sensors.h (use new structure: SENSORS_HARDWARE_POLL)
QEMU sensor implementation at HAL:
sdk/emulator/sensors/sensors_qemu.c (use deprecated structure: SENSORS_HARDWARE_CONTROL & SENSORS_HARDWARE_DATA)

To fix it, we need to update below 2 files from newer submodule sdk (branch tools_r13 or later).
1) sdk/emulator/qemud/qemud.c
2) sdk/emulator/sensors/sensors_qemu.c

Current submodule sdk is pointing to gingerbread-release of AOSP. Updating it to tools_r13 or later unfortunately forced to update another submodule "development" as well, it's a big change!!

A better approach maybe we maintain B2G's own submodule sdk with branch "gingerbread-release-b2g", and updating the 2 required files to make QEMU sensor working.