[G2 and Desire Z Android Development] icewewe:
BT Keyboard support?

Hi,

I'm running flinnycm101_vision_06 on my Desire Z. I'm trying to use a bluetooth keyboard with my phone, but it won't connect after pairing.

In the adb logcat I see errors about uhid not being present. I'm not sure what provides uhid, is it something I can install myself, or is it a part of the ROM?

adb output:

I/BluetoothBondStateMachine( 1367): Bond address is:E8:06:88:50:9D:65
I/bt-btif ( 1367): btif_dm_create_bond: bd_addr=e8:06:88:50:9d:65
I/BluetoothBondStateMachine( 1367): Entering PendingCommandState State
I/bt-btif ( 1367): btif_dm_generic_evt: event=33026
D/bt-btif ( 1367): bond_state_changed: state=1 prev_state=0
D/ ( 1367): HAL bt_hal_cbacks->bond_state_changed_cb
I/BluetoothBondStateMachine( 1367): bondStateChangeCallback: Status: 0 Address: E8:06:88:50:9D:65 newState: 1
D/BTIF_STORAGE( 1367): cfg2prop(L311): in, bd addr:e8:06:88:50:9d:65, prop type:4, len:4
D/btif_config.c( 1367): dump_node(L117): found node, p->name:DevClass, child/value:0x52d30030, bytes:4, p->used:4, type:2, p->flag:0
I/bt-btif ( 1367): btif_dm_upstreams_cback ev: BTA_DM_PIN_REQ_EVT
D/BTIF_STORAGE( 1367): prop2cfg(L239): in, bd addr:e8:06:88:50:9d:65, prop type:1, len:21
D/BTIF_STORAGE( 1367): prop2cfg(L239): in, bd addr:e8:06:88:50:9d:65, prop type:4, len:4
D/BTIF_STORAGE( 1367): prop2cfg(L239): in, bd addr:e8:06:88:50:9d:65, prop type:5, len:4
D/ ( 1367): HAL bt_hal_cbacks->remote_device_properties_cb
D/AudioHardwareMSM7X30( 107): value of device and enable is 6 1 ALSA dev id:6
I/BluetoothBondStateMachine( 1367): Bond State Change Intent:E8:06:88:50:9D:65 OldState: 10 NewState: 11
...
I/bt-btif ( 1367): btif_dm_upstreams_cback ev: BTA_DM_AUTH_CMPL_EVT
D/bt-btif ( 1367): btif_dm_auth_cmpl_evt: Storing link key. key_type=0x0, is_temp=0
I/bt-btif ( 1367): btif_dm_get_remote_services: remote_addr=e8:06:88:50:9d:65
D/btif_config.c( 1367): cfg_cmd_callback(L633): cmd type:1, size:0
D/btif_config.c( 1367): save_cfg(L578): in
W/bt-btif ( 1367): info:x0
I/bt-btif ( 1367): btif_dm_upstreams_cback ev: BTA_DM_BUSY_LEVEL_EVT
I/bt-btif ( 1367): btif_dm_upstreams_cback ev: BTA_DM_LINK_UP_EVT
D/bt-btif ( 1367): BTA_DM_LINK_UP_EVT. Sending BT_ACL_STATE_CONNECTED
D/ ( 1367): HAL bt_hal_cbacks->acl_state_changed_cb
I/bt-btif ( 1367): btif_dm_upstreams_cback ev: BTA_DM_BUSY_LEVEL_EVT
D/btif_config_util( 1367): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
D/btif_config.c( 1367): save_cfg(L597): out
I/HeadsetService( 878): Headset=false; Bluetooth=false
D/dalvikvm( 770): GC_CONCURRENT freed 218K, 13% free 3699K/4248K, paused 7ms+10ms, total 162ms
E/bt-btif ( 1367): services_to_search = 1fffffff
E/bt-btif ( 1367): ****************search UUID = 1200***********
W/bt-sdp ( 1367): process_service_search_attr_rsp
E/bt-btif ( 1367): services_to_search = 1ffffffe
E/bt-btif ( 1367): ****************search UUID = 0100***********
W/bt-sdp ( 1367): process_service_search_attr_rsp
I/bt-btif ( 1367): btif_dm_search_services_evt: event = 2
D/bt-btif ( 1367): btif_dm_search_services_evt:(result=0x0, services 0x100000)
E/bt-btif ( 1367): Index: 0 uuid:00001124-0000-1000-8000-00805f9b34fb
D/bt-btif ( 1367): btif_dm_search_services_evt Remote Service SDP done. Call bond_state_changed_cb BONDED
D/bt-btif ( 1367): bond_state_changed: state=2 prev_state=1
D/ ( 1367): HAL bt_hal_cbacks->bond_state_changed_cb
I/BluetoothBondStateMachine( 1367): bondStateChangeCallback: Status: 0 Address: E8:06:88:50:9D:65 newState: 2
D/BluetoothAdapterService(1088331968)( 1367): Get Bonded Devices being called
I/BluetoothBondStateMachine( 1367): Bond State Change Intent:E8:06:88:50:9D:65 OldState: 11 NewState: 12
D/BTIF_STORAGE( 1367): prop2cfg(L239): in, bd addr:e8:06:88:50:9d:65, prop type:3, len:16
D/btif_config.c( 1367): cfg_cmd_callback(L633): cmd type:1, size:0
D/btif_config.c( 1367): save_cfg(L578): in
D/btif_config_util( 1367): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new
D/btif_config.c( 1367): save_cfg(L597): out
D/ ( 1367): HAL bt_hal_cbacks->remote_device_properties_cb
D/BluetoothAdapterService(1088331968)( 1367): Get Bonded Devices being called
I/bt-btif ( 1367): btif_dm_search_services_evt: event = 4
D/CachedBluetoothDevice( 493): No profiles. Maybe we will connect later
I/BluetoothBondStateMachine( 1367): StableState(): Entering Off State
D/BluetoothInputDevice( 493): connect(E8:06:88:50:9D:65)
I/bt-btif ( 1367): btif_hh_handle_evt: event=0
I/bt-btif ( 1367): BTHH: btif_hh_connect
D/bt-btif ( 1367): Connect _hh
D/BTIF_HH ( 1367): HAL bt_hh_callbacks->connection_state_cb
D/BTIF_HH ( 1367): HAL bt_hh_callbacks->connection_state_cb
D/HidService( 1367): Connection state E8:06:88:50:9D:65: 0->1
W/HidService( 1367): no state change: 1
D/CachedBluetoothDevice( 493): Command sent successfully:CONNECT Address:E8:06:88:50:9D:65 Profile:HID
D/BluetoothAdapterProperties( 1367): CONNECTION_STATE_CHANGE: E8:06:88:50:9D:65: 0 -> 1
D/BluetoothAdapterService(1088331968)( 1367): Get Bonded Devices being called
D/BluetoothAdapterService(1088331968)( 1367): Get Bonded Devices being called
D/CachedBluetoothDevice( 493): onProfileStateChanged: profile HID newProfileState 1
D/LocalBluetoothManager( 493): setting foreground activity to non-null context
D/BluetoothDiscoverableEnabler( 493): handleModeChanged(): mode = 21
D/BluetoothManagerService( 386): checkIfCallerIsForegroundUser: valid=true callingUser=0 foregroundUser=0
D/BluetoothDiscoverableEnabler( 493): handleModeChanged(): mode = 21
W/bt-sdp ( 1367): process_service_attr_rsp
W/System.err( 493): Removed 2131231228
W/System.err( 493): Removed 2131231242
W/System.err( 493): Removed 2131231243
W/bt-sdp ( 1367): process_service_attr_rsp
E/bt-btif ( 1367): bta_hh_co_open: Error: failed to open uhid, err:No such file or directory
W/bt-btif ( 1367): new conn_srvc id:23, app_id:2
D/bt-btif ( 1367): btif_hh_upstreams_evt: event=BTA_HH_OPEN_EVT
W/bt-btif ( 1367): btif_hh_upstreams_evt: BTA_HH_OPN_EVT: handle=0, status =0
W/bt-btif ( 1367): BTA_HH_OPEN_EVT: Error, failed to find the uhid driver...
W/bt-btif ( 1367): bta_hh_co_close: dev_handle = 0, app_id = 2
D/bt-btif ( 1367): btif_hh_upstreams_evt: event=BTA_HH_CLOSE_EVT
D/bt-btif ( 1367): BTA_HH_CLOSE_EVT: status = 0, handle = 0
D/bt-btif ( 1367): btif_hh_upstreams_evt: uhid fd = -1
D/BTIF_HH ( 1367): HAL bt_hh_callbacks->connection_state_cb
D/bt-btif ( 1367): btif_hh_upstreams_evt: Closing uhid fd = -1
D/HidService( 1367): Connection state E8:06:88:50:9D:65: 1->0
E/bt-btif ( 1367): uhid_write: Cannot write to uhid:Bad file number
I/LocalBluetoothProfileManager( 493): Failed to connect HID device
D/CachedBluetoothDevice( 493): onProfileStateChanged: profile HID newProfileState 0
D/BluetoothAdapterProperties( 1367): CONNECTION_STATE_CHANGE: E8:06:88:50:9D:65: 1 -> 0

Thanks!