diff options
| author | 2022-01-27 07:38:17 +0000 | |
|---|---|---|
| committer | 2022-01-27 07:38:17 +0000 | |
| commit | 81d0ad94b799a44469ec67d0b204842023607495 (patch) | |
| tree | 97ca8252ee92c45cb9770e66a403bc6c525d3ad3 | |
| parent | 93b2e23328811bfaf7a266b1927e1ef297bbdab6 (diff) | |
| parent | a393bf9d25a5480a5b11d04a5ca7cca2ffab939f (diff) | |
Merge "SettingsLib: Add API to get identity address"
| -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 290055ce91a7..1c9d9cf376f1 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -504,6 +504,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 |