Merge "SettingsLib: Add API to get identity address"

This commit is contained in:
Jack He 2022-02-03 06:17:03 +00:00 committed by Gerrit Code Review
commit 128ebcdb54

View File

@ -499,6 +499,17 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
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
* @return {@link BluetoothDevice#getAlias()} if