From 3959ce85d76c2201a7e8e2e8b5d870203ea85c71 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Tue, 2 Oct 2018 12:01:24 +0000 Subject: [PATCH] Revert "DO NOT MERGE Hearing Aid: Add JNI API for add/remove whitelist" This reverts commit d65f697c011cc6e5eaad767de3ec726cfd25b27f. Reason for revert: broken pi-dev-plus-aosp Change-Id: Iab11567fa326b6837a621c1edc93e0eceb04ec43 --- bta/hearing_aid/hearing_aid.cc | 12 ------------ bta/include/bta_hearing_aid_api.h | 2 -- btif/include/btif_storage.h | 3 --- btif/src/btif_hearing_aid.cc | 16 ---------------- btif/src/btif_storage.cc | 7 ------- include/hardware/bt_hearing_aid.h | 6 ------ 6 files changed, 46 deletions(-) diff --git a/bta/hearing_aid/hearing_aid.cc b/bta/hearing_aid/hearing_aid.cc index 68720f41a..63d3ac896 100644 --- a/bta/hearing_aid/hearing_aid.cc +++ b/bta/hearing_aid/hearing_aid.cc @@ -325,18 +325,6 @@ 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); - BTA_DmBleStartAutoConn(); - } - - void RemoveFromWhiteList(const RawAddress& address) override { - VLOG(2) << __func__ << " address: " << address; - BTA_GATTC_CancelOpen(gatt_if, address, false); - } - void AddFromStorage(const RawAddress& address, uint16_t psm, uint8_t capabilities, uint16_t codecs, uint16_t audio_control_point_handle, diff --git a/bta/include/bta_hearing_aid_api.h b/bta/include/bta_hearing_aid_api.h index b8a61acac..e0a3bf51f 100644 --- a/bta/include/bta_hearing_aid_api.h +++ b/bta/include/bta_hearing_aid_api.h @@ -55,8 +55,6 @@ 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 RemoveFromWhiteList(const RawAddress& address) = 0; virtual void SetVolume(int8_t volume) = 0; }; diff --git a/btif/include/btif_storage.h b/btif/include/btif_storage.h index 12af66131..30615cec2 100644 --- a/btif/include/btif_storage.h +++ b/btif/include/btif_storage.h @@ -227,9 +227,6 @@ 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); -/** Add the hearing aid device to white list */ -void btif_storage_add_hearing_aid_to_white_list(const RawAddress& address); - /** Remove the hearing aid device from white list */ void btif_storage_remove_hearing_aid_white_list(const RawAddress& address); diff --git a/btif/src/btif_hearing_aid.cc b/btif/src/btif_hearing_aid.cc index 36b70c399..ec742fb0a 100644 --- a/btif/src/btif_hearing_aid.cc +++ b/btif/src/btif_hearing_aid.cc @@ -95,22 +95,6 @@ class HearingAidInterfaceImpl FROM_HERE, Bind(&btif_storage_remove_hearing_aid_white_list, address)); } - void AddToWhiteList(const RawAddress& address) override { - DVLOG(2) << __func__ << " address: " << address; - do_in_bta_thread(FROM_HERE, Bind(&HearingAid::AddToWhiteList, - Unretained(HearingAid::Get()), address)); - do_in_jni_thread( - FROM_HERE, Bind(&btif_storage_add_hearing_aid_to_white_list, address)); - } - - void RemoveFromWhiteList(const RawAddress& address) override { - DVLOG(2) << __func__ << " address: " << address; - do_in_bta_thread(FROM_HERE, Bind(&HearingAid::RemoveFromWhiteList, - Unretained(HearingAid::Get()), address)); - do_in_jni_thread( - FROM_HERE, Bind(&btif_storage_remove_hearing_aid_white_list, address)); - } - void SetVolume(int8_t volume) override { DVLOG(2) << __func__ << " volume: " << +volume; do_in_main_thread(FROM_HERE, Bind(&HearingAid::SetVolume, diff --git a/btif/src/btif_storage.cc b/btif/src/btif_storage.cc index 494579480..5b9f7b102 100644 --- a/btif/src/btif_storage.cc +++ b/btif/src/btif_storage.cc @@ -1546,13 +1546,6 @@ void btif_storage_remove_hearing_aid(const RawAddress& address) { btif_config_save(); } -/** Add the hearing aid device to white list */ -void btif_storage_add_hearing_aid_to_white_list(const RawAddress& address) { - std::string addrstr = address.ToString(); - - btif_config_set_int(addrstr, HEARING_AID_IS_WHITE_LISTED, true); -} - /** Remove the hearing aid device from white list */ void btif_storage_remove_hearing_aid_white_list(const RawAddress& address) { std::string addrstr = address.ToString(); diff --git a/include/hardware/bt_hearing_aid.h b/include/hardware/bt_hearing_aid.h index 7ab0dc757..a54f82aea 100644 --- a/include/hardware/bt_hearing_aid.h +++ b/include/hardware/bt_hearing_aid.h @@ -59,12 +59,6 @@ class HearingAidInterface { /** Disconnect from Hearing Aid */ virtual void Disconnect(const RawAddress& address) = 0; - /** Add a hearing aid device to white list */ - virtual void AddToWhiteList(const RawAddress& address) = 0; - - /** Remove a hearing aid device from white list */ - virtual void RemoveFromWhiteList(const RawAddress& address) = 0; - /** Set the volume */ virtual void SetVolume(int8_t volume) = 0; -- 2.11.0