diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2009-09-15 14:07:22 -0700 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2009-09-15 14:07:22 -0700 |
commit | 3eb43fe7a4a508e8cd476525fd68ec8d900f06b8 (patch) | |
tree | bc2efe58cf0f8cd0a2e1a5f2099c1741370a2703 /src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java | |
parent | a3aaf19e09806f7e56c59621fc6c17e4429b2e6d (diff) | |
download | packages_apps_Settings-3eb43fe7a4a508e8cd476525fd68ec8d900f06b8.zip packages_apps_Settings-3eb43fe7a4a508e8cd476525fd68ec8d900f06b8.tar.gz packages_apps_Settings-3eb43fe7a4a508e8cd476525fd68ec8d900f06b8.tar.bz2 |
Show name for incoming pairing requests.
Settings apps invalidates its cache whenever a new scan is started.
When there is a new incoming pairing request, we will not get a DeviceFound
signal, because its not due to a inquiry scan. Thus when the pairing request
is displayed, the settings app doesn't have it in cache and hence will
just display the address. Make it query the framework when it doesn't have the name.
Diffstat (limited to 'src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java')
-rw-r--r-- | src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java b/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java index 7052bfb..046cd76 100644 --- a/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java +++ b/src/com/android/settings/bluetooth/CachedBluetoothDeviceManager.java @@ -140,7 +140,12 @@ public class CachedBluetoothDeviceManager { */ public String getName(BluetoothDevice device) { CachedBluetoothDevice cachedDevice = findDevice(device); - return cachedDevice != null ? cachedDevice.getName() : device.getAddress(); + if (cachedDevice != null) return cachedDevice.getName(); + + String name = device.getName(); + if (name != null) return name; + + return device.getAddress(); } private void dispatchDeviceAdded(CachedBluetoothDevice cachedDevice) { |