OSDN Git Service

Remove aliase name while removing bonded device
authorliuchao <liuchao741@huawei.com>
Wed, 12 Apr 2017 02:23:00 +0000 (10:23 +0800)
committerliuchao <liuchao741@huawei.com>
Tue, 24 Oct 2017 08:33:35 +0000 (16:33 +0800)
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

btif/src/btif_storage.cc

index c6573bb..c9c7adc 100644 (file)
@@ -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;