diff options
author | Matthew Xie <mattx@google.com> | 2011-07-28 17:47:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-28 17:47:19 -0700 |
commit | bb33bdcef739c33e6bfa3ccb08c3199f073b05af (patch) | |
tree | f0e67678cc8f0788ed3e191ce5d9fbd1ce1ecc2b | |
parent | fd070b4b4ce16e5864c4416db82abbc72d098a4e (diff) | |
parent | 2036ebd8896bbabbbe04db34c9e7d8a1be6fe32a (diff) | |
download | packages_apps_settings-bb33bdcef739c33e6bfa3ccb08c3199f073b05af.zip packages_apps_settings-bb33bdcef739c33e6bfa3ccb08c3199f073b05af.tar.gz packages_apps_settings-bb33bdcef739c33e6bfa3ccb08c3199f073b05af.tar.bz2 |
Merge "Save changed name from CachedBluetoothDevice to native storage"
7 files changed, 10 insertions, 10 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java index de96d71..838e7b1 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java @@ -82,7 +82,7 @@ public final class BluetoothPairingRequest extends BroadcastReceiver { String name = intent.getStringExtra(BluetoothDevice.EXTRA_NAME); if (TextUtils.isEmpty(name)) { - name = device != null ? device.getName() : + name = device != null ? device.getAliasName() : context.getString(android.R.string.unknownName); } diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java index 1a0965c..4d96140 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java @@ -130,7 +130,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements } private String createConnectionDisplayText() { - String mRemoteName = mDevice != null ? mDevice.getName() : null; + String mRemoteName = mDevice != null ? mDevice.getAliasName() : null; if (mRemoteName == null) mRemoteName = getString(R.string.unknown); String mMessage1 = getString(R.string.bluetooth_connection_dialog_text, @@ -139,7 +139,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements } private String createPbapDisplayText() { - String mRemoteName = mDevice != null ? mDevice.getName() : null; + String mRemoteName = mDevice != null ? mDevice.getAliasName() : null; if (mRemoteName == null) mRemoteName = getString(R.string.unknown); String mMessage1 = getString(R.string.bluetooth_pb_acceptance_dialog_text, diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index c769ba6..51055af 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java @@ -83,7 +83,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { Notification notification = new Notification(android.R.drawable.stat_sys_data_bluetooth, context.getString(R.string.bluetooth_connection_permission_request), System.currentTimeMillis()); - String deviceName = device != null ? device.getName() : null; + String deviceName = device != null ? device.getAliasName() : null; notification.setLatestEventInfo(context, context.getString(R.string.bluetooth_connection_permission_request), context.getString(R.string.bluetooth_connection_notif_message, deviceName), diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java index 846c379..8082314 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java @@ -326,8 +326,8 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { mName = mDevice.getAddress(); } else { mName = name; + mDevice.setAlias(name); } - // TODO: save custom device name in preferences dispatchAttributesChanged(); } } @@ -338,7 +338,7 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { } private void fetchName() { - mName = mDevice.getName(); + mName = mDevice.getAliasName(); if (TextUtils.isEmpty(mName)) { mName = mDevice.getAddress(); @@ -422,7 +422,7 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> { mProfileManager.updateProfiles(uuids, localUuids, mProfiles, mRemovedProfiles); if (DEBUG) { - Log.e(TAG, "updating profiles for " + mDevice.getName()); + Log.e(TAG, "updating profiles for " + mDevice.getAliasName()); BluetoothClass bluetoothClass = mDevice.getBluetoothClass(); if (bluetoothClass != null) Log.v(TAG, "Class: " + bluetoothClass.toString()); diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java b/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java index ab71ece..f293f50 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java @@ -104,7 +104,7 @@ final class CachedBluetoothDeviceManager { return cachedDevice.getName(); } - String name = device.getName(); + String name = device.getAliasName(); if (name != null) { return name; } diff --git a/src/com/android/settings/bluetooth/DockEventReceiver.java b/src/com/android/settings/bluetooth/DockEventReceiver.java index 6ecbef6..d18348f 100644 --- a/src/com/android/settings/bluetooth/DockEventReceiver.java +++ b/src/com/android/settings/bluetooth/DockEventReceiver.java @@ -54,7 +54,7 @@ public final class DockEventReceiver extends BroadcastReceiver { if (DEBUG) { Log.d(TAG, "Action: " + intent.getAction() + " State:" + state + " Device: " - + (device == null ? "null" : device.getName())); + + (device == null ? "null" : device.getAliasName())); } if (Intent.ACTION_DOCK_EVENT.equals(intent.getAction()) diff --git a/src/com/android/settings/bluetooth/DockService.java b/src/com/android/settings/bluetooth/DockService.java index b457706..f0644c3 100644 --- a/src/com/android/settings/bluetooth/DockService.java +++ b/src/com/android/settings/bluetooth/DockService.java @@ -424,7 +424,7 @@ public final class DockService extends Service implements ServiceListener { if (DEBUG) { Log.d(TAG, "Action: " + intent.getAction() + " State:" + state - + " Device: " + (device == null ? "null" : device.getName())); + + " Device: " + (device == null ? "null" : device.getAliasName())); } if (device == null) { |