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