How to solve SELinux Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to solve SELinux Error

1,291 Views
puneeth989
Contributor I

Hi,

   

      I am trying to run my amfm application in imx8qxp android 9. I want to access jni and hidl functions.

   I am able to access jni function from java layer, but not able to access hidl function from jni layer.

   I did the following steps in device/fsl/imx8q folder.

   1. added amfm in manifest.xml

            <hal format="hidl">
              <name>android.hardware.amfm</name>
              <transport>hwbinder</transport>
              <version>2.0</version>
              <interface>
                  <name>IAMFM</name>
                  <instance>default</instance>
              </interface>
       </hal>

2. mek_8q.mk file

      PRODUCT_PACKAGES += \
       android.hardware.amfm@2.0-impl \
       android.hardware.amfm@2.0-service

I am getting the error as,

SELinux : avc:  denied  { find } for interface=android.hardware.amfm::IAMFM pid=4099 scontext=u:r:untrusted_app:s0:c65,c256,c512,c768 tcontext=u:object_r:default_android_hwservice:s0 tclass=hwservice_manager permissive=0

If any one knows the solution please reply.

Tags (1)
0 Kudos
2 Replies

1,181 Views
IvanRuiz
NXP Employee
NXP Employee

Hello,

If your application is trying to communicate to native libraries written in c++, it will be necessary to do it through JNI.

Regarding HIDL, this is intended to be used for Inter-process communication (IPC), it will be good to decide whether it is necessary that it is binderized or via pass-through mode, nevertheless, this last is not supported in Java according to Android source info.

Since this implementation is from Android layers perspective, it would be helpful to please ask in Google's support page. They may have a better understanding of this problem for a proper implementation of your custom driver and how the HIDL setup shall be done.

Thank you for your comprehension.

BR,

Ivan.

0 Kudos

1,181 Views
puneeth989
Contributor I

Ok. Thank you.

0 Kudos