Skip to content

bluebinder: add support for AIDL Bluetooth HAL#40

Open
NotKit wants to merge 5 commits intomasterfrom
aidl
Open

bluebinder: add support for AIDL Bluetooth HAL#40
NotKit wants to merge 5 commits intomasterfrom
aidl

Conversation

@NotKit
Copy link
Copy Markdown

@NotKit NotKit commented Jan 24, 2026

Add support for AIDL Bluetooth HAL found on Android 14. First attempt to get AIDL HAL on /dev/binder, then fallback to /dev/hwbinder for HIDL if not present.

@monich
Copy link
Copy Markdown
Contributor

monich commented Jan 24, 2026

how about collecting the differences between the protocols into some sort of a protocol description struct (and picking the appropriate one at startup) to avoid something like (protocol == BLUETOOTH_PROTOCOL_AIDL) ? something : something_else all over the place.

not only the code would be easier to read when all the related things are grouped together, imagine if the protocol changes again - what kind of spaghetti this becomes.

@mlehtima
Copy link
Copy Markdown
Contributor

This PR is missing the needed change to allow /dev/binder in systemd service file the same way that is done for /dev/hwbinder https://github.com/mer-hybris/bluebinder/blob/master/bluebinder.service#L16

Copy link
Copy Markdown
Contributor

@mlehtima mlehtima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fix the earlier comment about allowing /dev/binder in service file

g_main_loop_quit(proxy->loop);
*status = GBINDER_STATUS_FAILED;
return NULL;
if (proxy->protocol->rpc_protocol == BINDER_RPC_PROTOCOL_AIDL) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this too looks like a candidate for a protocol specific callback. but of course ifs work too, it's a matter of personal preference. I like when all protocol specific stuff is concentrated in one place and abstracted from the generic code with aninterface.

#error "unknown byte order"
#endif

#ifndef hci_iso_hdr
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't work so use instead "#ifndef HCI_ISO_HDR_SIZE" and maybe add a comment before like "For compatibility with old bluez5"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants