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

Commit 469fef69 authored by Eric Caruso's avatar Eric Caruso Committed by Qiyu Hu
Browse files

RemoteDevices: Use String(val) to set a remote device alias

DeviceProperties::mAlias is of type String. Always construct a new
String from the byte array and use that.

Bug: 29363875
Test: Manual test with android LE scanning app.
Confirmed that FRIENDLY_NAME update would not throw exceptions.

Change-Id: I6648e4ca8f0907ea338cd2932bda72b630692427
parent 5894ee95
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -514,11 +514,8 @@ final class RemoteDevices {
                            debugLog("Remote Device name is: " + device.mName);
                            break;
                        case AbstractionLayer.BT_PROPERTY_REMOTE_FRIENDLY_NAME:
                            if (device.mAlias != null) {
                                System.arraycopy(val, 0, device.mAlias, 0, val.length);
                            } else {
                            device.mAlias = new String(val);
                            }
                            debugLog("Remote device alias is: " + device.mAlias);
                            break;
                        case AbstractionLayer.BT_PROPERTY_BDADDR:
                            device.mAddress = val;