profile_object_path: Ensure the object name is valid.

This commit is contained in:
Vibhav Pant
2023-08-29 14:02:44 +05:30
parent 57f88d09e1
commit 64f1da3801
@@ -14,7 +14,8 @@ std::string device_object_path(const sdbus::ObjectPath &adapter_object_path,
}
sdbus::ObjectPath profile_object_path(absl::string_view service_uuid) {
return absl::Substitute("/com/google/nearby/profiles/$0", service_uuid);
return absl::Substitute("/com/google/nearby/profiles/$0",
absl::StrReplaceAll(service_uuid, {{"-", "_"}}));
}
sdbus::ObjectPath adapter_object_path(absl::string_view name) {