hwbinder vs vndbinder

2,920 views
Skip to first unread message

Ajai Jose

unread,
May 4, 2018, 1:45:51 PM5/4/18
to android-platform
Hi,
  I have a vendor service in native layer which is the server and client is a service in java layer doing IPC over Binder. Note there is no hardware access so this is not a HAL piece of code.
It works today using /dev/binder. but post oreo the change should be....

1. use vndbinder for both services. however from Java we cannot call like       ProcessState::initWithDriver(“/dev/vndbinder”);
or
2. use hwbinder and HIDLize the IPC communication.  Even though the code is not accessing hardware.

Please suggest what is the best way. also let me know if initWithDriver can be possible from Java layer.

thanks!

platisd

unread,
May 7, 2018, 1:51:43 PM5/7/18
to android-platform
From what I understand the way to do this from now on is via HIDL. At least that's how we do it.

Steven Moreland

unread,
May 9, 2018, 10:01:28 AM5/9/18
to android-platform
vndbinder is really only used for vendor<->vendor communication. Since there isn't much (or any?) Java code running in a vendor context, we never added an initWithDriver API to Java. This is because most Java code is forked from system processes and so will be running in a system context. You can always use initWithDriver from JNI (and I'd be happy to accept a patch on AOSP adding it).

hwbinder has 'hw' in it, but it doesn't need to be restricted to hardware. It is really used for any system<->vendor communication. This sounds like the best option for you.

Jubeom Kim

unread,
Oct 2, 2018, 1:54:03 AM10/2/18
to android-platform
Hi,
'ProcessState::initWithDriver(“/dev/vndbinder”)' at JNI
Is it compilable on Android-Studio?

I added '#include <binder/ProcessState.h>' to JNI source code to use ProcessState::initWithDriver() in JNI.
But build error happened at Android-Studio.

fatal error: 'binder/ProcessState.h' file not found
#include <binder/ProcessState.h>
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

Do you have any idea?
Reply all
Reply to author
Forward
0 new messages