Merge "SettingsLib: Add API to get identity address" am: 128ebcdb54 am: f2650c7f4d am: 32435083bf

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952111

Change-Id: Ie31f44740b8ceac6eb751264ff74191dc4cd7307
This commit is contained in:
Jack He
2022-02-03 07:30:54 +00:00
committed by Automerger Merge Worker

View File

@@ -501,6 +501,17 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
return mDevice.getAddress(); return mDevice.getAddress();
} }
/**
* 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 * Get name from remote device
* @return {@link BluetoothDevice#getAlias()} if * @return {@link BluetoothDevice#getAlias()} if