diff options
author | Aiswarya Cyriac <aiswarya.cyriac@intel.com> | 2018-07-23 15:17:48 +0530 |
---|---|---|
committer | Hansong Zhang <hsz@google.com> | 2018-07-31 21:26:26 +0000 |
commit | b8b3655f68a9c0a64bf8cfd9d44dc8aaebb9eb39 (patch) | |
tree | a541c33cb551cab584f538fb62d2a215125be4c2 | |
parent | cc5b28bf251dc46e31d5fd0ce0d61df873a4d9cb (diff) |
Fix for Bluetooth device name is resetting to default name after reboot
Reason: When the BT device name is updated is getting saved to the
config data pointer but not to the persistent data (i.e. bt_config.conf).
So, when the reboot is happening it is not able to get the updated device
name from the persistent data (i.e. bt_config.conf) as during reboot
bt_config_flush is not called.
Fix: Saving the BT Device name to persistent data using btif_config_flush
once it is set.
Test: Manual Reboot test
Bug: 110301897
Change-Id: Ie329b475eaaf208ed667f27e271a00e230e4b95c
Signed-off-by: Aiswarya Cyriac <aiswarya.cyriac@intel.com>
Signed-off-by: Gaganpreet kaur <gaganpreetx.kaur@intel.com>
-rw-r--r-- | system/btif/src/btif_storage.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/system/btif/src/btif_storage.cc b/system/btif/src/btif_storage.cc index 3b10eeea20..826244af3d 100644 --- a/system/btif/src/btif_storage.cc +++ b/system/btif/src/btif_storage.cc @@ -209,10 +209,12 @@ static int prop2cfg(const RawAddress* remote_bd_addr, bt_property_t* prop) { : prop->len; strncpy(value, (char*)prop->val, name_length); value[name_length] = '\0'; - if (remote_bd_addr) + if (remote_bd_addr) { btif_config_set_str(bdstr, BTIF_STORAGE_PATH_REMOTE_NAME, value); - else + } else { btif_config_set_str("Adapter", BTIF_STORAGE_KEY_ADAPTER_NAME, value); + btif_config_flush(); + } break; } case BT_PROPERTY_REMOTE_FRIENDLY_NAME: |