Bluetooth keyboard stopped working in KitKat

cancel
Showing results for 
Search instead for 
Did you mean: 

Bluetooth keyboard stopped working in KitKat

574 Views
jblack547
Contributor II

When we ported KitKat 4.4.2_r1 to our custom board (based on SabreSD) from Jelly Bean and the keyboard stopped working. In other words, the bluetooth keyboard used to work in Jelly bean and now it does not work in KitKat. The new bluedroid stack can pair with the keyboard just fine but there is no data when using an app. The logcat shows that the stack sees the keyboard and is passing data up the stack. This seems to be a common problem with KitKat and the bluedroid stack in general. I tried to erase the cache, I tried the keylayout fix. I am looking through patch sets in bluedroid and see no direct mention of a fix for HID devices. Anyone else having issues or have solved this problem?

Labels (2)
0 Kudos
1 Reply

62 Views
jblack547
Contributor II

We found a work around.

bluedroid/btif/co/bta_hh_co.c

//Create and send hid descriptor to kernel

    memset(&ev, 0, sizeof(ev));

    ev.type = UHID_CREATE;

    strncpy((char*)ev.u.create.name, dev_name, sizeof(ev.u.create.name) - 1);

    ev.u.create.rd_size = dscp_len;

    ev.u.create.rd_data = p_dscp;

    ev.u.create.bus = BUS_BLUETOOTH;  <-- changed this to BUS_USB and the keyboard started working

    ev.u.create.vendor = vendor_id;

    ev.u.create.product = product_id;

    ev.u.create.version = version;

    ev.u.create.country = ctry_code;

    result = uhid_write(p_dev->fd, &ev);

Not sure if this is the correct solution, but it is a solution.