Communication between AOSP JNI and HIDL

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

Communication between AOSP JNI and HIDL

5,761 Views
msingh1920
Contributor V

Hi Sir,

I am working on AOSP version 9.0 and using iMX8M Mini EVK development Kit and developing a android application which will use my custom system service to access HAL functionality.


I am able to create custom system service in AOSP framework and able to use it from from my Android App.

but while interfacing JNI layer and HIDL layer I am facing issue.

I am following below link for creating my custom HIDL and trying to access it from JNI layer -

https://devarea.com/android-hidl-and-project-treble/#.XZMirXUzY8o

and

https://www.jianshu.com/p/ca6823b897b5

I am also following the Light Example from AOSP to create my own custom HIDL and JNI layer.

AOSP File Path =>

JNI -> com_android_server_lights_LightsService.cpp         << framework/base/services/core/jni >>

HIDL -> Light.cpp / Light.h / ILight.Hal       << hardware/interfaces/light >> 

I am Successfully able to build the JNI layer and HIDL layer separately but i am not able to access HIDL from my JNI layer code. I am trying to use Binderized Mode as shown in above links and in AOSP Light Example. 

After successfully compiling the AOSP code when i try to run it on iMX8M EVK it is not booting and when i checked the logcat it is waiting for my HIDL service. Boot is getting stuck at android logo itself.

Please Suggest how can I use HIDL in Pass through or Binderized Mode and access it from my JNI code.

NOTE : I am referring above mentioned link and AOSP Light Example for creating my JNI and HIDL code.

Thanks,

Maneesh

0 Kudos
11 Replies

4,488 Views
Janpk
Contributor I

Hi @maneeshsingh192

Could you please share the code.

Thanks

0 Kudos

4,729 Views
devendradevadig
Contributor III

Dear Maneesh Singh,

I am leaning to write HAL, JNI and service in Android by using to Android 9 BSP using i.MX8M Mini board.
I am new to Android 9. Please can you share the example you tried on Android 9 BSP, so that will be helpful to me to understand HAL, JNI and Service by referring example  ? 
 
Thanks and Regards,
Devendra
0 Kudos

4,729 Views
vinothkumars
Senior Contributor IV

Hi maneeshsingh,

Will you please provide your implementation.

VinothS

Regards,
Vinothkumar Sekar
0 Kudos

2,123 Views
kumarijyoti9994
Contributor II

Hi Vinoth,

We are trying to use CAN on imx8qxp board (Android Automotive 12.1.0_1.1.0) but we cannot see the CAN interface.

We have tried to update the flexcan in dts files. But we are getting following logs in kernel logs:

can_stby : disabling

can_en : disabling

Could you please support?

 

0 Kudos

4,729 Views
msingh1920
Contributor V

Hi Vinothkumar,

For JNI to work you need complete framework in place like system service, JNI, HIDL, HAL etc.

I am still working on it and will update you once I will made any progress.

Thanks,

Maneesh

0 Kudos

4,729 Views
vinothkumars
Senior Contributor IV

Thank you  Maneesh,

Which communication are you using for Vehicle HAL and Vehicle Driver and How you are verify the data pass from Vehicle Driver to HAL ?

Regards,

VinothS

Regards,
Vinothkumar Sekar
0 Kudos

4,729 Views
krishnan_ramesh
Contributor III

Hi maneeshsingh vinothkumars,

I am looking at can communication from vehicle HAL up to the application layer in android automotive? Any idea about this?

Also, can u share implementation for the same?

Regards,

Ramesh

0 Kudos

4,729 Views
vinothkumars
Senior Contributor IV

Hi Ramesh

Share your mail Id and information about your board and android version.

Thanks,

Vinoth S,

Regards,
Vinothkumar Sekar
0 Kudos

4,729 Views
krishnan_ramesh
Contributor III

Hi vinothkumars‌,

Thank you.

Working on Android 10 latest nxp automotive release on the IMX8 QXPMEK board.

Any open-source implementation and documents for this Share the links to this email id - shriyanayak1992@gmail.com

Regards,

Ramesh

0 Kudos

4,488 Views
Janpk
Contributor I

Hi Ramesh,

I am also looking into communication from vehicle HAL up to the application layer in android automotive?

 

Do you have any example code to start wtih.

Thanks

0 Kudos

4,729 Views
diegoadrian
NXP Employee
NXP Employee

Hello,

This question is more related to how the Android USB HAL interface with the Android framework. I highly suggest you to ask your question on the Google support page. They could help you and have a better understanding of this problem.

Community forum - Android Help  

I apologize for the inconvenience this could give you.

Best regards,

Diego.

0 Kudos