OSDN Git Service

Fix Bluetooth crash when pairing with 8th HOGP device
authorRuina Liu <ruina.liu@mediatek.com>
Mon, 11 Sep 2017 08:28:21 +0000 (16:28 +0800)
committerAndre Eisenbach <eisenbach@google.com>
Tue, 31 Oct 2017 15:56:20 +0000 (15:56 +0000)
commit2e3c3d782993c475e608291896db73b0960fa9dd
tree687ac826be5a60ee794a346c6445f4c2cd1c96d4
parentc1a13bcb4356fa0c3c64d8f062bcad8e646b840c
Fix Bluetooth crash when pairing with 8th HOGP device

In function bta_hh_hdl_event, when handling with
the event of BTA_HH_API_GET_DSCP_EVT after bonded
with 8th HOGP device, no correct p_cb will be found,
due to mapping error between the device handle and
dev cb for HOGP. Then NPE happen.
Change to map le_cb_index into the device handle for
HOGP, so that HOGP and HID can be separately maintained
maximum to 14 device

Test: Pair with 14 HOGP devices
Change-Id: I8556f1ffea160862c2e52f874ef334f68c17050e
bta/hh/bta_hh_act.cc
bta/hh/bta_hh_int.h
bta/hh/bta_hh_le.cc
bta/include/bta_hh_api.h