Commit 0ff0ef77 authored by Julian Bouzas's avatar Julian Bouzas
Browse files

policy: reevaluate all linkables if one linkable was removed

Allows relinking client nodes to other devices if the current device has been
removed. This allows audio to keep playing in a different device if a bluetooth
device is disconnected.
parent 7bc59afd
......@@ -207,6 +207,12 @@ function unhandleSiLinkable (si)
end
end
function reevaluateSiLinkables ()
for si in silinkables_om:iterate() do
handleSiLinkable (si)
end
end
siendpoints_om = ObjectManager { Interest { type = "SiEndpoint" }}
silinkables_om = ObjectManager { Interest { type = "SiLinkable",
-- only handle si-audio-adapter and si-node
......@@ -225,6 +231,7 @@ end)
silinkables_om:connect("object-removed", function (om, si)
unhandleSiLinkable (si)
reevaluateSiLinkables ()
end)
siendpoints_om:activate()
......
......@@ -292,6 +292,7 @@ end)
silinkables_om:connect("object-removed", function (om, si)
unhandleSiLinkable (si)
reevaluateSiLinkables ()
end)
metadatas_om:activate()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment