mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Check device name before calling update callback
PiperOrigin-RevId: 517851883
This commit is contained in:
committed by
Copybara-Service
parent
44e6ff7bb1
commit
12156937ee
@@ -592,6 +592,12 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated(
|
||||
std::string new_device_name = InspectableReader::ReadString(
|
||||
properties.Lookup(L"System.ItemNameDisplay"));
|
||||
|
||||
if (it->second->GetName() == new_device_name) {
|
||||
NEARBY_LOGS(INFO)
|
||||
<< "Device name is same as old name, ignore the update.";
|
||||
return {};
|
||||
}
|
||||
|
||||
it->second->SetName(new_device_name);
|
||||
|
||||
NEARBY_LOGS(INFO)
|
||||
|
||||
Reference in New Issue
Block a user