SettingsLib: Add API to get identity address

Bug: 197044261
Test: build pass
Change-Id: Idd03d7777c8257986b03dd1ba19aac5514f4f18d
This commit is contained in:
Chienyuan
2022-01-27 10:44:18 +08:00
parent 49f9c3744b
commit a393bf9d25

View File

@@ -503,6 +503,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