am 7b354367: am a383452a: Merge change 25125 into eclair

Merge commit '7b354367af8407dd6ee89fe4875047b1134eda9a'

* commit '7b354367af8407dd6ee89fe4875047b1134eda9a':
  Show name for incoming pairing requests.
This commit is contained in:
Jaikumar Ganesh
2009-09-17 06:41:40 -07:00
committed by Android Git Automerger
2 changed files with 10 additions and 2 deletions

View File

@@ -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) {

View File

@@ -256,7 +256,10 @@ public class LocalBluetoothManager {
CachedBluetoothDevice cachedDevice = mCachedDeviceManager.findDevice(device);
String name = null;
if (cachedDevice == null) {
name = mContext.getString(R.string.bluetooth_remote_device);
name = device.getName();
if (name == null) {
name = mContext.getString(R.string.bluetooth_remote_device);
}
} else {
name = cachedDevice.getName();
}