Lines Matching refs:addr
45 void Add(const RawAddress& addr) { devices_.insert(addr); } in Add() argument
46 void Remove(const RawAddress& addr) { devices_.erase(addr); } in Remove() argument
47 bool Contains(const RawAddress& addr) const { in Contains()
48 return (devices_.count(addr) != 0); in Contains()
52 for (auto const& addr : devices_) { in ForEachDevice() local
53 cb(addr); in ForEachDevice()
83 int GetGroupId(const RawAddress& addr, Uuid uuid) const override { in GetGroupId() argument
85 if ((g.Contains(addr)) && (uuid == g.GetUuid())) return id; in GetGroupId()
90 void add_to_group(const RawAddress& addr, DeviceGroup* group) { in add_to_group() argument
91 group->Add(addr); in add_to_group()
97 c->OnGroupAdded(addr, group->GetUuid(), group->GetGroupId()); in add_to_group()
99 c->OnGroupMemberAdded(addr, group->GetGroupId()); in add_to_group()
104 int AddDevice(const RawAddress& addr, Uuid uuid, int group_id) override { in AddDevice() argument
108 auto gid = GetGroupId(addr, uuid); in AddDevice()
120 if (group->Contains(addr)) { in AddDevice()
121 LOG(ERROR) << __func__ << " device " << ADDRESS_TO_LOGGABLE_STR(addr) in AddDevice()
126 add_to_group(addr, group); in AddDevice()
128 btif_storage_add_groups(addr); in AddDevice()
132 void RemoveDevice(const RawAddress& addr, int group_id) override { in RemoveDevice() argument
138 if (!g.Contains(addr)) { in RemoveDevice()
152 g.Remove(addr); in RemoveDevice()
154 c->OnGroupMemberRemoved(addr, id); in RemoveDevice()
167 btif_storage_remove_groups(addr); in RemoveDevice()
169 btif_storage_add_groups(addr); in RemoveDevice()
173 bool SerializeGroups(const RawAddress& addr, in SerializeGroups() argument
176 groups_.begin(), groups_.end(), [&addr](auto& id_group_pair) { in SerializeGroups()
177 return id_group_pair.second.Contains(addr); in SerializeGroups()
191 if (g.Contains(addr)) { in SerializeGroups()
203 void DeserializeGroups(const RawAddress& addr, in DeserializeGroups() argument
232 if (group) add_to_group(addr, group); in DeserializeGroups()
235 c->OnGroupAddFromStorage(addr, Uuid::From128BitLE(uuid128), id); in DeserializeGroups()
342 void DeviceGroups::AddFromStorage(const RawAddress& addr, in AddFromStorage() argument
349 instance->DeserializeGroups(addr, in); in AddFromStorage()
352 bool DeviceGroups::GetForStorage(const RawAddress& addr, in GetForStorage() argument
359 return instance->SerializeGroups(addr, out); in GetForStorage()
377 for (auto const& addr : group.devices_) { in operator <<() local
378 out << " " << ADDRESS_TO_LOGGABLE_STR(addr) << std::endl; in operator <<()