diff options
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index ddee433d3997..233e798c8578 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -500,6 +500,17 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } /** + * Get identity address from remote device + * @return {@link BluetoothDevice#getIdentityAddress()} if + * {@link BluetoothDevice#getIdentityAddress()} is not null otherwise return + * {@link BluetoothDevice#getAddress()} + */ + public String getIdentityAddress() { + final String identityAddress = mDevice.getIdentityAddress(); + return TextUtils.isEmpty(identityAddress) ? getAddress() : identityAddress; + } + + /** * Get name from remote device * @return {@link BluetoothDevice#getAlias()} if * {@link BluetoothDevice#getAlias()} is not null otherwise return |