system/bt
Revision | cda119df1f6bd0e743962666feff215daad28f09 (tree) |
---|---|
Time | 2019-11-14 13:21:27 |
Author | Jeevaka Prabu Badrappan <jeevaka.badrappan@inte...> |
Commiter | Chih-Wei Huang |
Fix for Bluetooth device name reset 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. It is only called on the BT Enable Event.
Fix: Saving the BT Device name to persistent data using
btif_config_flush once it is set.
Tracked-On: OAM-67917
Signed-off-by: Gaganpreet kaur <gaganpreetx.kaur@intel.com>
Signed-off-by: Aiswarya Cyriac <aiswarya.cyriac@intel.com>
@@ -208,10 +208,12 @@ static int prop2cfg(const RawAddress* remote_bd_addr, bt_property_t* prop) { | ||
208 | 208 | : prop->len; |
209 | 209 | strncpy(value, (char*)prop->val, name_length); |
210 | 210 | value[name_length] = '\0'; |
211 | - if (remote_bd_addr) | |
211 | + if (remote_bd_addr) { | |
212 | 212 | btif_config_set_str(bdstr, BTIF_STORAGE_PATH_REMOTE_NAME, value); |
213 | - else | |
213 | + } else { | |
214 | 214 | btif_config_set_str("Adapter", BTIF_STORAGE_KEY_ADAPTER_NAME, value); |
215 | + btif_config_flush(); | |
216 | + } | |
215 | 217 | break; |
216 | 218 | } |
217 | 219 | case BT_PROPERTY_REMOTE_FRIENDLY_NAME: |