Properly update config when the MAC Address changes
The existing code has two issues: - We pass a 0 size value for the buffer we intend to contain the value we're getting. This causes btif_config_get_str to always return positively but never write a value because its usage of srtlcpy doesn't think it has space to write. - We check to see if the address in the config is the same as the one received from the controller using (strcmp(...) == 0). However, strcmp returns 0 if they are the same. It will be a non-zero value if they are different. Following this change, the bt_config.conf file should have the correct value for the MAC Address in the case the controller interface starts reporting something new. Bug: 169686820 Test: setprop persist.vendor.service.bdroid.bdaddr <something new>; cat /data/misc/bluedroid/bt_config.conf | grep Address; Change-Id: I6cdb70776fef689426baf58be0ccaf4abe9c9023
Loading
Please register or sign in to comment