summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index e884cf834722..bf95ab9a4c50 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -581,9 +581,14 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
*/
public void setName(String name) {
// Prevent getName() to be set to null if setName(null) is called
- if (name != null && !TextUtils.equals(name, getName())) {
- mDevice.setAlias(name);
- dispatchAttributesChanged();
+ if (name == null || TextUtils.equals(name, getName())) {
+ return;
+ }
+ mDevice.setAlias(name);
+ dispatchAttributesChanged();
+
+ for (CachedBluetoothDevice cbd : mMemberDevices) {
+ cbd.setName(name);
}
}