Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8745112c authored by Sal Savage's avatar Sal Savage
Browse files

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
parent 4407ac75
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment