OSDN Git Service

Hearing Aid: Removes all registrations for connection when disconnect HA
authorweichinweng <weichinweng@google.com>
Mon, 21 Jan 2019 11:22:33 +0000 (19:22 +0800)
committerweichinweng <weichinweng@google.com>
Tue, 29 Jan 2019 02:56:13 +0000 (10:56 +0800)
* On the current design, when the disconnect Hearing Aid is triggered
from UI. It will Cancel autoconnect by gatt_if first. It will cause the
fixed_chnl_idle_tout isn't set. On the condition, it will cause the
disconnect isn't finished.
* The fix is change the behavior. Directly remove all registrations for
connection when disconnect HA.

Bug: 122264537
Bug: 123214035
Test: make, BT off/on when connected HA,
Toggle disconnect/connect HA from Bluetooth UI,
Turn off/onn HA after Connected HA.

Change-Id: If011c1ab632e1fcb51a68b3c122743534b5f6c63

bta/hearing_aid/hearing_aid.cc

index d252f38..a23c0fc 100644 (file)
@@ -1251,8 +1251,8 @@ class HearingAidImpl : public HearingAid {
       BTA_GATTC_CancelOpen(gatt_if, address, true);
     }
 
-    // cancel autoconnect
-    BTA_GATTC_CancelOpen(gatt_if, address, false);
+    // Removes all registrations for connection.
+    BTA_GATTC_CancelOpen(0, address, false);
 
     // Inform the other side (if any) of this disconnection
     std::vector<uint8_t> inform_disconn_state(