buffet: Add command_def filtering by command visibility

When updating cloud or local client with the device's CDD make sure
to send only the command definitions that are available to particular
client (local vs cloud).

Also made it possible to subscribe to command definition change notifications
for more than one listener (using base::CallbackList) so that both the local
and cloud adapters can notify the respective clients about command visibility
changes (the actual API to change the command visibility is coming in a
follow-up CL).

BUG=brillo:797
TEST=`FEATURES=test emerge-link buffet`

Change-Id: I6bec36633ababcb534012abad2c37a3502d8faf4
Reviewed-on: https://chromium-review.googlesource.com/266209
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
9 files changed
tree: e93e4d0216f66b32bbb6711f735f37fd48a8d626
  1. buffet/