commit | fd7f71ca5e3b2e44a1c8c945ed57baad30a332c1 | [log] [tgz] |
---|---|---|
author | Chienyuan <chienyuanhuang@google.com> | Thu Jan 27 10:44:18 2022 +0800 |
committer | Jack He <siyuanh@google.com> | Wed Feb 02 09:24:48 2022 -0800 |
tree | 1ff48a2a8ed54299c722021684f9eedf81dc479d | |
parent | 853b6f6ede920dffcdbd7f09c603e643ac254a13 [diff] |
SettingsLib: Add API to get identity address Bug: 197044261 Test: build pass Change-Id: Idd03d7777c8257986b03dd1ba19aac5514f4f18d Merged-In: Idd03d7777c8257986b03dd1ba19aac5514f4f18d (cherry picked from commit a393bf9d25a5480a5b11d04a5ca7cca2ffab939f)
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index ddee433..233e798 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 @@ } /** + * 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