How to solve SELinux Error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to solve SELinux Error

1,406 次查看
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.

标记 (1)
0 项奖励
回复
2 回复数

1,296 次查看
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 项奖励
回复

1,296 次查看
puneeth989
Contributor I

Ok. Thank you.

0 项奖励
回复