This post talks about the Integration of GPS/GNSS HAL module support in Android 10 for iMX8mm or imx8 series SoC/SOMs.
1. in the file android_build/device/fsl/imx8m/evk/<device.mk> specific to your board, add the following lines.
PRODUCT_PACKAGES += \
android.hardware.gnss@1.0-service \
android.hardware.gnss@1.0-impl
2. Add the following lines for permissions. in the same device.mk file. frameworks/native/data/etc/android.hardware.location.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.xml \
frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml\
3. in path android_build/device/fsl/imx8m/evk/ go to manifest.xml and add the following llines
<hal format="hidl">
<name>android.hardware.gnss</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IGnss</name>
<instance>default</instance>
</interface>
</hal>
4. add the vendor_specific implementation of shared library name in
android_build/device/fsl/imx8m/ProductConfigCommon.mk
PRODUCT_PACKAGES += \
gps.imx
5. ensure that the vendor specific HAL implementation nmea mesg parsing code is present at
android_build/vendor/nxp-opensource/imx/ folder and its Android.mk should build shared library named gps.imx.
6. proper permissions should be given to the serial port of the GPS / nmea device in init.rc, ueventd.rc etc.
7. This mentioned solution works when SELinux policies are in permissive mode.
8 for the device which runs in SELinux enforced mode, implementor has to write appropriate SEPolicies, .te files file_contexts etc otherwise avc access denial may occur.
#imx8m series #android-10 #GPS/GNSS
Hi,
Please refer these article to write selinux policy:
https://documentation.suse.com/en-us/sle-micro/6.0/html/Micro-selinux/index.html
https://source.android.com/docs/security/features/selinux/device-policy
Best Regards,
Zhiming