external/bluetooth/bluedroid
リビジョン | 07ea194ac2518e98961632c4d1909f0af0809ea9 (tree) |
---|---|
日時 | 2014-03-13 08:04:46 |
作者 | Zhihai Xu <zhihaixu@goog...> |
コミッター | Android (Google) Code Review |
Merge "DO NOT MERGE use bluetooth HID remote device name as input device name." into klp-dev
@@ -938,9 +938,18 @@ static void btif_hh_upstreams_evt(UINT16 event, char* p_param) | ||
938 | 938 | } |
939 | 939 | { |
940 | 940 | char *cached_name = NULL; |
941 | - char name[] = "Broadcom Bluetooth HID"; | |
942 | - if (cached_name == NULL) { | |
943 | - cached_name = name; | |
941 | + bt_bdname_t bdname; | |
942 | + bt_property_t prop_name; | |
943 | + BTIF_STORAGE_FILL_PROPERTY(&prop_name, BT_PROPERTY_BDNAME, | |
944 | + sizeof(bt_bdname_t), &bdname); | |
945 | + if (btif_storage_get_remote_device_property( | |
946 | + &p_dev->bd_addr, &prop_name) == BT_STATUS_SUCCESS) | |
947 | + { | |
948 | + cached_name = (char *)bdname.name; | |
949 | + } | |
950 | + else | |
951 | + { | |
952 | + cached_name = "Bluetooth HID"; | |
944 | 953 | } |
945 | 954 | |
946 | 955 | BTIF_TRACE_WARNING2("%s: name = %s", __FUNCTION__, cached_name); |