Loading system/bta/hearing_aid/hearing_aid.cc +3 −1 Original line number Diff line number Diff line Loading @@ -951,6 +951,7 @@ class HearingAidImpl : public HearingAid { VLOG(2) << __func__ << ": " << address; bool connected = hearingDevice->accepting_audio; hearingDevice->accepting_audio = false; if (hearingDevice->connecting_actively) { Loading @@ -972,6 +973,7 @@ class HearingAidImpl : public HearingAid { hearingDevices.Remove(address); if (connected) callbacks->OnConnectionState(ConnectionState::DISCONNECTED, address); } Loading system/bta/include/bta_hearing_aid_api.h +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ #include <base/callback_forward.h> #include <hardware/bt_hearing_aid.h> using bluetooth::Uuid; /** Implementations of HearingAid will also implement this interface */ class HearingAidAudioReceiver { Loading system/btif/src/btif_dm.cc +4 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include <bluetooth/uuid.h> #include <hardware/bluetooth.h> #include <hardware/bt_hearing_aid.h> #include "advertise_data_parser.h" #include "bt_common.h" Loading Loading @@ -244,6 +245,8 @@ extern bt_status_t btif_hf_client_execute_service(bool b_enable); extern bt_status_t btif_sdp_execute_service(bool b_enable); extern int btif_hh_connect(const RawAddress* bd_addr); extern bt_status_t btif_hd_execute_service(bool b_enable); extern bluetooth::hearing_aid::HearingAidInterface* btif_hearing_aid_get_interface(); /****************************************************************************** * Functions Loading Loading @@ -1648,6 +1651,7 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) { #if (defined(BTA_HD_INCLUDED) && (BTA_HD_INCLUDED == TRUE)) btif_hd_remove_device(bd_addr); #endif btif_hearing_aid_get_interface()->RemoveDevice(bd_addr); btif_storage_remove_bonded_device(&bd_addr); bond_state_changed(BT_STATUS_SUCCESS, bd_addr, BT_BOND_STATE_NONE); break; Loading system/btif/src/btif_hearing_aid.cc +8 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,14 @@ class HearingAidInterfaceImpl Unretained(HearingAid::Get()), volume)); } void RemoveDevice(const RawAddress& address) override { DVLOG(2) << __func__ << " address: " << address; do_in_bta_thread(FROM_HERE, Bind(&HearingAid::Disconnect, Unretained(HearingAid::Get()), address)); do_in_jni_thread(FROM_HERE, Bind(&btif_storage_remove_hearing_aid, address)); } void Cleanup(void) { DVLOG(2) << __func__; do_in_bta_thread(FROM_HERE, Bind(&HearingAid::CleanUp)); Loading system/include/hardware/bt_hearing_aid.h +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ class HearingAidInterface { /** Closes the interface. */ virtual void Cleanup(void) = 0; /* Called when Hearing Aid is unbonded. */ virtual void RemoveDevice(const RawAddress& address) = 0; }; } // namespace hearing_aid Loading Loading
system/bta/hearing_aid/hearing_aid.cc +3 −1 Original line number Diff line number Diff line Loading @@ -951,6 +951,7 @@ class HearingAidImpl : public HearingAid { VLOG(2) << __func__ << ": " << address; bool connected = hearingDevice->accepting_audio; hearingDevice->accepting_audio = false; if (hearingDevice->connecting_actively) { Loading @@ -972,6 +973,7 @@ class HearingAidImpl : public HearingAid { hearingDevices.Remove(address); if (connected) callbacks->OnConnectionState(ConnectionState::DISCONNECTED, address); } Loading
system/bta/include/bta_hearing_aid_api.h +0 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ #include <base/callback_forward.h> #include <hardware/bt_hearing_aid.h> using bluetooth::Uuid; /** Implementations of HearingAid will also implement this interface */ class HearingAidAudioReceiver { Loading
system/btif/src/btif_dm.cc +4 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include <bluetooth/uuid.h> #include <hardware/bluetooth.h> #include <hardware/bt_hearing_aid.h> #include "advertise_data_parser.h" #include "bt_common.h" Loading Loading @@ -244,6 +245,8 @@ extern bt_status_t btif_hf_client_execute_service(bool b_enable); extern bt_status_t btif_sdp_execute_service(bool b_enable); extern int btif_hh_connect(const RawAddress* bd_addr); extern bt_status_t btif_hd_execute_service(bool b_enable); extern bluetooth::hearing_aid::HearingAidInterface* btif_hearing_aid_get_interface(); /****************************************************************************** * Functions Loading Loading @@ -1648,6 +1651,7 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) { #if (defined(BTA_HD_INCLUDED) && (BTA_HD_INCLUDED == TRUE)) btif_hd_remove_device(bd_addr); #endif btif_hearing_aid_get_interface()->RemoveDevice(bd_addr); btif_storage_remove_bonded_device(&bd_addr); bond_state_changed(BT_STATUS_SUCCESS, bd_addr, BT_BOND_STATE_NONE); break; Loading
system/btif/src/btif_hearing_aid.cc +8 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,14 @@ class HearingAidInterfaceImpl Unretained(HearingAid::Get()), volume)); } void RemoveDevice(const RawAddress& address) override { DVLOG(2) << __func__ << " address: " << address; do_in_bta_thread(FROM_HERE, Bind(&HearingAid::Disconnect, Unretained(HearingAid::Get()), address)); do_in_jni_thread(FROM_HERE, Bind(&btif_storage_remove_hearing_aid, address)); } void Cleanup(void) { DVLOG(2) << __func__; do_in_bta_thread(FROM_HERE, Bind(&HearingAid::CleanUp)); Loading
system/include/hardware/bt_hearing_aid.h +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ class HearingAidInterface { /** Closes the interface. */ virtual void Cleanup(void) = 0; /* Called when Hearing Aid is unbonded. */ virtual void RemoveDevice(const RawAddress& address) = 0; }; } // namespace hearing_aid Loading