Merge "bt: Set alias for all devices in a set"
This commit is contained in:
@@ -576,9 +576,14 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
|
|||||||
*/
|
*/
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
// Prevent getName() to be set to null if setName(null) is called
|
// Prevent getName() to be set to null if setName(null) is called
|
||||||
if (name != null && !TextUtils.equals(name, getName())) {
|
if (name == null || TextUtils.equals(name, getName())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mDevice.setAlias(name);
|
mDevice.setAlias(name);
|
||||||
dispatchAttributesChanged();
|
dispatchAttributesChanged();
|
||||||
|
|
||||||
|
for (CachedBluetoothDevice cbd : mMemberDevices) {
|
||||||
|
cbd.setName(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user