Add unit tests for BluetoothAdapter

PiperOrigin-RevId: 455673471
This commit is contained in:
aaronyujiaze
2022-06-17 12:36:02 -07:00
committed by Copybara-Service
parent ecbf356fbd
commit 064a482e7d
3 changed files with 133 additions and 2 deletions
@@ -246,10 +246,10 @@ std::string BluetoothAdapter::GetName() const {
// https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#setName(java.lang.String)
bool BluetoothAdapter::SetName(absl::string_view name) {
if (name.size() > 70 * sizeof(char)) {
if (name.size() > 248 * sizeof(char)) {
NEARBY_LOGS(ERROR) << __func__
<< ": Failed to set name for bluetooth adapter because "
"the name exceeded the 70 bytes limit for Windows.";
"the name exceeded the 248 bytes limit for Windows.";
return false;
}