diff options
author | Zhihai Xu <zhihaixu@google.com> | 2013-12-06 14:29:29 -0800 |
---|---|---|
committer | Zhihai Xu <zhihaixu@google.com> | 2013-12-06 14:29:29 -0800 |
commit | 0b93f5ce4df14aa3d3100a8f9609a1c7ea4cdbd9 (patch) | |
tree | b61b299a36606b9417befa55e32822bc2e33173d /btif/src/btif_hh.c | |
parent | caf8deb58af8a5480d325ab443d5c49649222456 (diff) | |
download | android_system_bt-0b93f5ce4df14aa3d3100a8f9609a1c7ea4cdbd9.tar.gz android_system_bt-0b93f5ce4df14aa3d3100a8f9609a1c7ea4cdbd9.tar.bz2 android_system_bt-0b93f5ce4df14aa3d3100a8f9609a1c7ea4cdbd9.zip |
use bluetooth HID remote device name as input device name.
bug:12003067
Change-Id: I74e4921047a27ee79fa1e3cd58056fde2958e60f
Diffstat (limited to 'btif/src/btif_hh.c')
-rw-r--r-- | btif/src/btif_hh.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/btif/src/btif_hh.c b/btif/src/btif_hh.c index ee7277d68..228b8aded 100644 --- a/btif/src/btif_hh.c +++ b/btif/src/btif_hh.c @@ -937,9 +937,18 @@ static void btif_hh_upstreams_evt(UINT16 event, char* p_param) } { char *cached_name = NULL; - char name[] = "Broadcom Bluetooth HID"; - if (cached_name == NULL) { - cached_name = name; + bt_bdname_t bdname; + bt_property_t prop_name; + BTIF_STORAGE_FILL_PROPERTY(&prop_name, BT_PROPERTY_BDNAME, + sizeof(bt_bdname_t), &bdname); + if (btif_storage_get_remote_device_property( + &p_dev->bd_addr, &prop_name) == BT_STATUS_SUCCESS) + { + cached_name = (char *)bdname.name; + } + else + { + cached_name = "Bluetooth HID"; } BTIF_TRACE_WARNING2("%s: name = %s", __FUNCTION__, cached_name); |