Loading system/bta/hearing_aid/hearing_aid.cc +6 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,12 @@ class HearingAidImpl : public HearingAid { BTA_GATTC_Open(gatt_if, address, true, GATT_TRANSPORT_LE, false); } void AddToWhiteList(const RawAddress& address) override { VLOG(2) << __func__ << " address: " << address; hearingDevices.Add(HearingDevice(address, true)); BTA_GATTC_Open(gatt_if, address, false, GATT_TRANSPORT_LE, false); } void AddFromStorage(const HearingDevice& dev_info, uint16_t is_white_listed) { DVLOG(2) << __func__ << " " << dev_info.address << ", hiSyncId=" << loghex(dev_info.hi_sync_id) Loading system/bta/include/bta_hearing_aid_api.h +1 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ class HearingAid { virtual void Connect(const RawAddress& address) = 0; virtual void Disconnect(const RawAddress& address) = 0; virtual void AddToWhiteList(const RawAddress& address) = 0; virtual void SetVolume(int8_t volume) = 0; }; Loading system/btif/include/btif_storage.h +3 −2 Original line number Diff line number Diff line Loading @@ -227,8 +227,9 @@ void btif_storage_load_bonded_hearing_aids(); /** Deletes the bonded hearing aid device info from NVRAM */ void btif_storage_remove_hearing_aid(const RawAddress& address); /** Remove the hearing aid device from white list */ void btif_storage_remove_hearing_aid_white_list(const RawAddress& address); /** Set/Unset the hearing aid device HEARING_AID_IS_WHITE_LISTED flag. */ void btif_storage_set_hearing_aid_white_list(const RawAddress& address, bool add_to_whitelist); /******************************************************************************* * Loading system/btif/src/btif_hearing_aid.cc +10 −2 Original line number Diff line number Diff line Loading @@ -92,8 +92,16 @@ class HearingAidInterfaceImpl DVLOG(2) << __func__ << " address: " << address; do_in_main_thread(FROM_HERE, Bind(&HearingAid::Disconnect, Unretained(HearingAid::Get()), address)); do_in_jni_thread( FROM_HERE, Bind(&btif_storage_remove_hearing_aid_white_list, address)); do_in_jni_thread(FROM_HERE, Bind(&btif_storage_set_hearing_aid_white_list, address, false)); } void AddToWhiteList(const RawAddress& address) override { VLOG(2) << __func__ << " address: " << address; do_in_main_thread(FROM_HERE, Bind(&HearingAid::AddToWhiteList, Unretained(HearingAid::Get()), address)); do_in_jni_thread(FROM_HERE, Bind(&btif_storage_set_hearing_aid_white_list, address, true)); } void SetVolume(int8_t volume) override { Loading system/btif/src/btif_storage.cc +5 −3 Original line number Diff line number Diff line Loading @@ -1594,11 +1594,13 @@ void btif_storage_remove_hearing_aid(const RawAddress& address) { btif_config_save(); } /** Remove the hearing aid device from white list */ void btif_storage_remove_hearing_aid_white_list(const RawAddress& address) { /** Set/Unset the hearing aid device HEARING_AID_IS_WHITE_LISTED flag. */ void btif_storage_set_hearing_aid_white_list(const RawAddress& address, bool add_to_whitelist) { std::string addrstr = address.ToString(); btif_config_set_int(addrstr, HEARING_AID_IS_WHITE_LISTED, false); btif_config_set_int(addrstr, HEARING_AID_IS_WHITE_LISTED, add_to_whitelist); btif_config_save(); } /******************************************************************************* Loading Loading
system/bta/hearing_aid/hearing_aid.cc +6 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,12 @@ class HearingAidImpl : public HearingAid { BTA_GATTC_Open(gatt_if, address, true, GATT_TRANSPORT_LE, false); } void AddToWhiteList(const RawAddress& address) override { VLOG(2) << __func__ << " address: " << address; hearingDevices.Add(HearingDevice(address, true)); BTA_GATTC_Open(gatt_if, address, false, GATT_TRANSPORT_LE, false); } void AddFromStorage(const HearingDevice& dev_info, uint16_t is_white_listed) { DVLOG(2) << __func__ << " " << dev_info.address << ", hiSyncId=" << loghex(dev_info.hi_sync_id) Loading
system/bta/include/bta_hearing_aid_api.h +1 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ class HearingAid { virtual void Connect(const RawAddress& address) = 0; virtual void Disconnect(const RawAddress& address) = 0; virtual void AddToWhiteList(const RawAddress& address) = 0; virtual void SetVolume(int8_t volume) = 0; }; Loading
system/btif/include/btif_storage.h +3 −2 Original line number Diff line number Diff line Loading @@ -227,8 +227,9 @@ void btif_storage_load_bonded_hearing_aids(); /** Deletes the bonded hearing aid device info from NVRAM */ void btif_storage_remove_hearing_aid(const RawAddress& address); /** Remove the hearing aid device from white list */ void btif_storage_remove_hearing_aid_white_list(const RawAddress& address); /** Set/Unset the hearing aid device HEARING_AID_IS_WHITE_LISTED flag. */ void btif_storage_set_hearing_aid_white_list(const RawAddress& address, bool add_to_whitelist); /******************************************************************************* * Loading
system/btif/src/btif_hearing_aid.cc +10 −2 Original line number Diff line number Diff line Loading @@ -92,8 +92,16 @@ class HearingAidInterfaceImpl DVLOG(2) << __func__ << " address: " << address; do_in_main_thread(FROM_HERE, Bind(&HearingAid::Disconnect, Unretained(HearingAid::Get()), address)); do_in_jni_thread( FROM_HERE, Bind(&btif_storage_remove_hearing_aid_white_list, address)); do_in_jni_thread(FROM_HERE, Bind(&btif_storage_set_hearing_aid_white_list, address, false)); } void AddToWhiteList(const RawAddress& address) override { VLOG(2) << __func__ << " address: " << address; do_in_main_thread(FROM_HERE, Bind(&HearingAid::AddToWhiteList, Unretained(HearingAid::Get()), address)); do_in_jni_thread(FROM_HERE, Bind(&btif_storage_set_hearing_aid_white_list, address, true)); } void SetVolume(int8_t volume) override { Loading
system/btif/src/btif_storage.cc +5 −3 Original line number Diff line number Diff line Loading @@ -1594,11 +1594,13 @@ void btif_storage_remove_hearing_aid(const RawAddress& address) { btif_config_save(); } /** Remove the hearing aid device from white list */ void btif_storage_remove_hearing_aid_white_list(const RawAddress& address) { /** Set/Unset the hearing aid device HEARING_AID_IS_WHITE_LISTED flag. */ void btif_storage_set_hearing_aid_white_list(const RawAddress& address, bool add_to_whitelist) { std::string addrstr = address.ToString(); btif_config_set_int(addrstr, HEARING_AID_IS_WHITE_LISTED, false); btif_config_set_int(addrstr, HEARING_AID_IS_WHITE_LISTED, add_to_whitelist); btif_config_save(); } /******************************************************************************* Loading