From: liuchao Date: Wed, 12 Apr 2017 02:23:00 +0000 (+0800) Subject: Remove aliase name while removing bonded device X-Git-Tag: android-x86-9.0-r1~185^2~1^2^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ce7c3c045f;p=android-x86%2Fsystem-bt.git Remove aliase name while removing bonded device when remove a bonded device, the date in bt_config.conf is deleted but only removed linkey in the global cache. The user set alise name is left there When comes to next time search ,the linkey is set to config and write to bt_config.conf, before OFF/ON BT operation, the cached alse name is reported unexceptedly After remove,the remote device is expected to be brand new to the phone in the 2nd time they see each other. Test: mm -j8 Change-Id: I005a6487c546e2639e3180e8a6e181c4d3c1d4ac --- diff --git a/btif/src/btif_storage.cc b/btif/src/btif_storage.cc index c6573bbd2..c9c7adcbb 100644 --- a/btif/src/btif_storage.cc +++ b/btif/src/btif_storage.cc @@ -782,6 +782,9 @@ bt_status_t btif_storage_remove_bonded_device( ret &= btif_config_remove(bdstr, "PinLength"); if (btif_config_exist(bdstr, "LinkKey")) ret &= btif_config_remove(bdstr, "LinkKey"); + if (btif_config_exist(bdstr, BTIF_STORAGE_PATH_REMOTE_ALIASE)) { + ret &= btif_config_remove(bdstr, BTIF_STORAGE_PATH_REMOTE_ALIASE); + } /* write bonded info immediately */ btif_config_flush(); return ret ? BT_STATUS_SUCCESS : BT_STATUS_FAIL;