OSDN Git Service

Add btm Register_HACK_SetScoDisconnectCallback
authorChris Manton <cmanton@google.com>
Sat, 16 Jan 2021 03:51:07 +0000 (19:51 -0800)
committerChris Manton <cmanton@google.com>
Wed, 20 Jan 2021 07:12:58 +0000 (23:12 -0800)
Towards meaningful code

Bug: 177382279
Tag: #refactor
Test: gd/cert/run

Change-Id: Idd77f86c803825faf5233e768a68c72baee8cdff

main/shim/btm.cc
main/shim/btm.h

index ca910d5..389a793 100644 (file)
@@ -678,6 +678,11 @@ void Btm::StoreAddressType(const RawAddress& bd_addr, tBLE_ADDR_TYPE type) {
   store_le_address_type(bd_addr, type);
 }
 
+void Btm::Register_HACK_SetScoDisconnectCallback(
+    HACK_ScoDisconnectCallback callback) {
+  GetAclManager()->HACK_SetScoDisconnectCallback(callback);
+}
+
 }  // namespace shim
 
 }  // namespace bluetooth
index b009c93..ddeac1e 100644 (file)
@@ -77,6 +77,8 @@ using DiscoverabilityState = struct {
 };
 using ConnectabilityState = DiscoverabilityState;
 
+using HACK_ScoDisconnectCallback = std::function<void(uint16_t, uint8_t)>;
+
 namespace bluetooth {
 namespace shim {
 
@@ -205,6 +207,9 @@ class Btm {
 
   uint16_t GetAclHandle(const RawAddress& remote_bda, tBT_TRANSPORT transport);
 
+  void Register_HACK_SetScoDisconnectCallback(
+      HACK_ScoDisconnectCallback callback);
+
   static tBLE_ADDR_TYPE GetAddressType(const RawAddress& bd_addr);
 
   // Store the address type from advertising report or connection complete