Closed fadedbee closed 2 years ago
With the stanza:
<hal format="hidl">
<name>android.hardware.sensors</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>ISensors</name>
<instance>default</instance>
</interface>
</hal>
The errors are now:
09-03 15:52:50.873 3890 3987 I ServiceManagement: getService: Trying again for android.hardware.sensors@1.0::ISensors/default...
09-03 15:52:51.873 3890 3987 W ServiceManagement: Waited one second for android.hardware.sensors@1.0::ISensors/default
09-03 15:52:51.874 3890 3987 I ServiceManagement: getService: Trying again for android.hardware.sensors@1.0::ISensors/default...
09-03 15:52:52.874 3890 3987 W ServiceManagement: Waited one second for android.hardware.sensors@1.0::ISensors/default
09-03 15:52:52.876 3890 3987 I ServiceManagement: getService: Trying again for android.hardware.sensors@1.0::ISensors/default...
09-03 15:52:53.876 3890 3987 W ServiceManagement: Waited one second for android.hardware.sensors@1.0::ISensors/default
I chose version 1.0, after reading https://source.android.com/devices/sensors/hal-interface and https://source.android.com/devices/sensors/sensors-hal2
(The ST Sensors HAL has get_sensors_list()
from 1.0 but not getSensorsList()
from 2.0.)
The problem I had was that the vendor AOSP distribution was not including Sensors at all.
The solution was to add:
PRODUCT_PACKAGES += android.hardware.sensors@1.0-impl
PRODUCT_PACKAGES += android.hardware.sensors@1.0-service
to smarc_mx8mq.mk and correct the stanza to:
<hal format="hidl">
<name>android.hardware.sensors</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>ISensors</name>
<instance>default</instance>
</interface>
<fqname>@1.0::ISensors/default</fqname>
</hal>
I've followed the instructions in the README.md and I now have the following shared object libraries:
I have added logging to these libraries and can see that they are not being used. (None of the logging is output.)
This is confirmed by:
With
adb logcat
I see:This makes it look as if I need to add sensors.imx8.so to a manifest, but device/embedian/imx8m/smarc_mx8mq/manifest.xml looks like:
The stanzas do not specify library (path) names. I do not see how adding a sensors stanza will help.
How do I make Android use these new shared libraries and see the accelerometer?