Implement BlueZ/NewBlue multiplex in dispatcher |
||
Issue descriptionBluetooth dispatcher should support multiplexing traffic to/from 2 Bluetooth services BlueZ and NewBlue.
,
Aug 10
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/76833eec4b9a7a41914cb57763e070de6311a882 commit 76833eec4b9a7a41914cb57763e070de6311a882 Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Fri Aug 10 08:44:34 2018 libchrome: dbus: Remove LOG(ERROR) in ObjectProxy It is a valid use case for a daemon to have multiple ObjectProxies of different services with the exact same object path and interface name. Currently, this may cause log pollution of "rejecting a message from a wrong sender" because one ObjectProxy receives signals intended for another ObjectProxy. Since it's actually a valid case and not a bug, it shouldn't be logged as error but it may still be logged with VLOG. Currently this is discovered in Bluetooth daemon (btdispatch) because it listens to both BlueZ's and Newblue's objects which have identical object paths and interfaces. This is a cherry-pick of https://crrev.com/c/1164474. BUG=chromium:866704 TEST=Build libchrome, test with btdispatch and check that there is no more log pollution Change-Id: Ib4224d3c639e87adb7897e02956215fee513a879 Reviewed-on: https://chromium-review.googlesource.com/1170190 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/76833eec4b9a7a41914cb57763e070de6311a882/chromeos-base/libchrome/libchrome-395517.ebuild [rename] https://crrev.com/76833eec4b9a7a41914cb57763e070de6311a882/chromeos-base/libchrome/libchrome-395517-r35.ebuild [add] https://crrev.com/76833eec4b9a7a41914cb57763e070de6311a882/chromeos-base/libchrome/files/libchrome-395517-dbus-Remove-LOG-ERROR-in-ObjectProxy.patch
,
Aug 15
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/3229c938abd5ad000df0291c2d143c800563cb44 commit 3229c938abd5ad000df0291c2d143c800563cb44 Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Wed Aug 15 19:54:53 2018 bluetooth: Add interface to remove exported property. We need a mechanism to unexport a property when the impersonated property is no longer valid (which means the property is removed by the original service). Additionally the interface CopyPropertyToExportedProperty is renamed to SyncPropertyToExportedProperty to reflect the new behavior, which does not only "copy" the value but also "sync" the valid/invalid state. Also added a public method ExportedInterface::is_exported(), to be used when detecting whether the same interface has been exported by another service. BUG=chromium:866704 TEST=Added unit test in ExportedObjectManagerWrapperTest.SyncProperty Change-Id: I7a8950a839827cc93254147eb8968c8d0cb4ff1b Reviewed-on: https://chromium-review.googlesource.com/1152115 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/3229c938abd5ad000df0291c2d143c800563cb44/bluetooth/common/exported_object_manager_wrapper_unittest.cc [modify] https://crrev.com/3229c938abd5ad000df0291c2d143c800563cb44/bluetooth/common/exported_object_manager_wrapper.cc [modify] https://crrev.com/3229c938abd5ad000df0291c2d143c800563cb44/bluetooth/common/exported_object_manager_wrapper.h [modify] https://crrev.com/3229c938abd5ad000df0291c2d143c800563cb44/bluetooth/dispatcher/impersonation_object_manager_interface.cc
,
Aug 15
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/ddad9d0b8f0f0ab80b03c37b06b33efb67a78bc8 commit ddad9d0b8f0f0ab80b03c37b06b33efb67a78bc8 Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Wed Aug 15 23:37:34 2018 bluetooth: Add multiplex logic to btdispatch This CL adds a basic multiplex logic to btdispatch which works this way: If there are more than one service exposing the same object at the same interface, only the first service is considered and the rest of the services ignored. The priority of the services is determined by the order at which they are registered via ObjectManagerInterfaceMultiplexer::RegisterToObjectManager(). This basic multiplex logic serves as a fallback for object/interface that is not defined specifically. There will be future works configuring specific multiplex logic for each object/interface/property, and if not specified the multiplex logic will fallback to this basic logic. BUG=chromium:866704 TEST=Added unit test to ImpersonationObjectManagerInterfaceTest CQ-DEPEND=CL:1152115 Change-Id: I1ef5fc99b6114893e33fd8161d566bf63bff65ee Reviewed-on: https://chromium-review.googlesource.com/1152528 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/ddad9d0b8f0f0ab80b03c37b06b33efb67a78bc8/bluetooth/dispatcher/impersonation_object_manager_interface.h [modify] https://crrev.com/ddad9d0b8f0f0ab80b03c37b06b33efb67a78bc8/bluetooth/dispatcher/object_manager_interface_multiplexer.cc [modify] https://crrev.com/ddad9d0b8f0f0ab80b03c37b06b33efb67a78bc8/bluetooth/dispatcher/impersonation_object_manager_interface_unittest.cc [modify] https://crrev.com/ddad9d0b8f0f0ab80b03c37b06b33efb67a78bc8/bluetooth/dispatcher/object_manager_interface_multiplexer.h [modify] https://crrev.com/ddad9d0b8f0f0ab80b03c37b06b33efb67a78bc8/bluetooth/dispatcher/impersonation_object_manager_interface.cc
,
Aug 16
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/59bc1c00682f45d54a05aadc2a2e0559f85e4499 commit 59bc1c00682f45d54a05aadc2a2e0559f85e4499 Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Thu Aug 16 05:09:20 2018 dbus: Make Bus::is_connected() mockable It's currently not possible to have a unit test that triggers Bus::is_connected() because it always returns false. This is currently needed by the Bluetooth dispatcher (btdispatch) in Chrome OS. Bug: 866704 Change-Id: I04f7e8a22792886d421479c1c7c621eeb27d3a2a Reviewed-on: https://chromium-review.googlesource.com/1175216 Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org> Commit-Queue: Sonny Sasaka <sonnysasaka@chromium.org> Cr-Commit-Position: refs/heads/master@{#583543} [modify] https://crrev.com/59bc1c00682f45d54a05aadc2a2e0559f85e4499/dbus/bus.cc [modify] https://crrev.com/59bc1c00682f45d54a05aadc2a2e0559f85e4499/dbus/bus.h [modify] https://crrev.com/59bc1c00682f45d54a05aadc2a2e0559f85e4499/dbus/bus_unittest.cc [modify] https://crrev.com/59bc1c00682f45d54a05aadc2a2e0559f85e4499/dbus/exported_object.cc [modify] https://crrev.com/59bc1c00682f45d54a05aadc2a2e0559f85e4499/dbus/mock_bus.h [modify] https://crrev.com/59bc1c00682f45d54a05aadc2a2e0559f85e4499/dbus/object_proxy.cc
,
Aug 22
The following revision refers to this bug: https://chromium.googlesource.com/aosp/platform/system/connectivity/shill/+/f8b55a4f4789e9e96ceaa484cb3902ed1fb78bfc commit f8b55a4f4789e9e96ceaa484cb3902ed1fb78bfc Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Wed Aug 22 02:27:39 2018 shill: Change Bus::is_connected to Bus::IsConnected dbus::Bus::is_connected is now a virtual method and therefore needs to be renamed to IsConnected as it's not a simple accessor anymore. BUG=chromium:866704 TEST=Build succeeds CQ-DEPEND=CL:1178682 Change-Id: Ie2f956f9d4ce92879e82f099391a38d6f5d1b7a5 Reviewed-on: https://chromium-review.googlesource.com/1180596 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/f8b55a4f4789e9e96ceaa484cb3902ed1fb78bfc/dbus/chromeos_dhcpcd_listener.cc
,
Aug 22
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/030f22076429df33d0f4c1aec73b499b2ecc72e1 commit 030f22076429df33d0f4c1aec73b499b2ecc72e1 Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Wed Aug 22 02:27:40 2018 libchrome: dbus: Make Bus::is_connected() mockable This is a cherry-pick of CL:1175216. BUG=chromium:866704 TEST=Build CQ-DEPEND=CL:1175233,CL:1178688,CL:1180596 Change-Id: Ia6a6cd182d59155fcf494f6776556d075b6c8a6d Reviewed-on: https://chromium-review.googlesource.com/1178682 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/030f22076429df33d0f4c1aec73b499b2ecc72e1/chromeos-base/libchrome/libchrome-395517.ebuild [add] https://crrev.com/030f22076429df33d0f4c1aec73b499b2ecc72e1/chromeos-base/libchrome/files/libchrome-395517-dbus-Make-Bus-is_connected-mockable.patch [rename] https://crrev.com/030f22076429df33d0f4c1aec73b499b2ecc72e1/chromeos-base/libchrome/libchrome-395517-r37.ebuild
,
Aug 22
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/ccf453d0eea9e9bfb1e63581851f92f38df59613 commit ccf453d0eea9e9bfb1e63581851f92f38df59613 Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Wed Aug 22 02:27:40 2018 bluetooth: Fix upward forwarding send response In the upward forwarding case, method calls are received via an ad-hoc client-specific Bus which is not always connected depending on the availability of client. So we should always check whether the bus is still connected before sending the response. BUG=chromium:866704 TEST=Adjusted unit test CatchAllForwarderTest CQ-DEPEND=CL:1178682 Change-Id: I54d305e225e3796f50898da4164c5104313ba81a Reviewed-on: https://chromium-review.googlesource.com/1175233 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/ccf453d0eea9e9bfb1e63581851f92f38df59613/bluetooth/dispatcher/catch_all_forwarder.cc [modify] https://crrev.com/ccf453d0eea9e9bfb1e63581851f92f38df59613/bluetooth/dispatcher/catch_all_forwarder_unittest.cc
,
Aug 22
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/0ac82fc204bb0bb6737a9ec76a95ede84223c64e commit 0ac82fc204bb0bb6737a9ec76a95ede84223c64e Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Wed Aug 22 02:27:39 2018 metrics: Change Bus::is_connected to Bus::IsConnected dbus::Bus::is_connected is now a virtual method and therefore needs to be renamed to IsConnected as it's not a simple accessor anymore. BUG=chromium:866704 TEST=Build succeeds CQ-DEPEND=CL:1178682 Change-Id: I714c8f900ec62b5468bc5ebd2ed6a439a0f814d1 Reviewed-on: https://chromium-review.googlesource.com/1178688 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/0ac82fc204bb0bb6737a9ec76a95ede84223c64e/metrics/metrics_daemon.cc
,
Aug 23
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/a4fa93c325f8e71257c16160b9c82b733432b3ad commit a4fa93c325f8e71257c16160b9c82b733432b3ad Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Thu Aug 23 14:37:02 2018 bluetooth: Fix org.freedesktop.DBus.Properties.Set handler The handler for org.freedesktop.DBus.Properties.Set should be universal for all objects, therefore it should be defined in the dispatcher rather than in individual interface. The dispatcher should then find the right interface to do message forwarding. Additional fix included in this patch is to remove the dummy handlers for PropertiesChanged, InterfacesAdded, and InterfacesRemoved. These are no longer needed after the fix in libchrome https://crrev.com/c/1028712. BUG=chromium:866704 TEST=unit test modified in ImpersonationObjectManagerInterfaceTest CQ-DEPEND=CL:1175233 Change-Id: I762fd41d265698512c0c1948c9da9b15e8bc3bcb Reviewed-on: https://chromium-review.googlesource.com/1170382 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/a4fa93c325f8e71257c16160b9c82b733432b3ad/bluetooth/dispatcher/impersonation_object_manager_interface.h [modify] https://crrev.com/a4fa93c325f8e71257c16160b9c82b733432b3ad/bluetooth/newblued/newblue_daemon_unittest.cc [modify] https://crrev.com/a4fa93c325f8e71257c16160b9c82b733432b3ad/bluetooth/dispatcher/dispatcher.h [modify] https://crrev.com/a4fa93c325f8e71257c16160b9c82b733432b3ad/bluetooth/dispatcher/dispatcher_unittest.cc [modify] https://crrev.com/a4fa93c325f8e71257c16160b9c82b733432b3ad/bluetooth/dispatcher/impersonation_object_manager_interface_unittest.cc [modify] https://crrev.com/a4fa93c325f8e71257c16160b9c82b733432b3ad/bluetooth/dispatcher/dispatcher.cc [modify] https://crrev.com/a4fa93c325f8e71257c16160b9c82b733432b3ad/bluetooth/common/exported_object_manager_wrapper.cc [modify] https://crrev.com/a4fa93c325f8e71257c16160b9c82b733432b3ad/bluetooth/common/exported_object_manager_wrapper.h [modify] https://crrev.com/a4fa93c325f8e71257c16160b9c82b733432b3ad/bluetooth/dispatcher/impersonation_object_manager_interface.cc
,
Aug 23
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/78db5d3d96506faf57caa55ebbb3489ade990b8a commit 78db5d3d96506faf57caa55ebbb3489ade990b8a Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Thu Aug 23 20:20:53 2018 bluetooth: Set default dispatcher mode based on LE splitter Now that the LE splitter is configurable via a config file, we can use the information to decide the default mode of the dispatcher: Use BlueZ/NewBlue multiplex if and only if the kernel splitter is enabled. This mode can still be overridden with the --passthrough flag. BUG=chromium:866704 TEST=Manual test, run btdispatch with /var/lib/bluetooth/newblue: 1. Does not exist 2. Exists with content = "1" 3. Exists with content = "0" 4. Exists with content = other strings. Change-Id: I4970d10be0405a2280b21f1344263aa69835ff15 Reviewed-on: https://chromium-review.googlesource.com/1147606 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/78db5d3d96506faf57caa55ebbb3489ade990b8a/bluetooth/init/upstart/btdispatch.conf [modify] https://crrev.com/78db5d3d96506faf57caa55ebbb3489ade990b8a/bluetooth/dispatcher/dispatcher_daemon.cc [modify] https://crrev.com/78db5d3d96506faf57caa55ebbb3489ade990b8a/bluetooth/dispatcher/main.cc
,
Aug 29
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/2de234d8403b2698040e24389d10445a62e76b3b commit 2de234d8403b2698040e24389d10445a62e76b3b Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Wed Aug 29 18:14:52 2018 bluetooth: Configure service names based on passthrough mode Configure dispatcher such that it will impersonate the following services based on passthrough mode: * MULTIPLEX: bluez and newblue * BLUEZ_ONLY: bluez * NEWBLUE_ONLY: newblue BUG=chromium:866704 TEST=modified unit test in DispatcherTest Change-Id: Ibbbdd58b8f7ff78cb0d91ccd19cbcd91cb6f28fd Reviewed-on: https://chromium-review.googlesource.com/1170398 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/2de234d8403b2698040e24389d10445a62e76b3b/bluetooth/dispatcher/dispatcher.cc [modify] https://crrev.com/2de234d8403b2698040e24389d10445a62e76b3b/bluetooth/dispatcher/dispatcher.h [modify] https://crrev.com/2de234d8403b2698040e24389d10445a62e76b3b/bluetooth/dispatcher/dispatcher_unittest.cc
,
Aug 29
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/b8818490946cd239bee37160a403cf5dfdaadefe commit b8818490946cd239bee37160a403cf5dfdaadefe Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Wed Aug 29 18:14:53 2018 bluetooth: Update upstart script for newblued Update upstart script for newblued to add access to /dev/hci_le (read/write). BUG=chromium:866704 TEST=Manually copy to upstart script, run "start newblued" and check that newblued is able to read/write /dev/hci_le Change-Id: I2ff486fdf50a20dd109159aea41c74ad65c866e1 Reviewed-on: https://chromium-review.googlesource.com/1188788 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/b8818490946cd239bee37160a403cf5dfdaadefe/bluetooth/init/upstart/newblued.conf
,
Sep 9
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/fc952cec8b5d4c85932ef28c0beababa3bd5f192 commit fc952cec8b5d4c85932ef28c0beababa3bd5f192 Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Sun Sep 09 04:31:26 2018 bluetooth: Rename GetMethodNames to GetMethodForwardings For future work, we need to configure method forwardings with some kind of rule, for example "forward to all", or "forward to newblue only". Therefore the name GetMethodForwardings suits better than GetMethodName as it configures which methods to be forwarded and how it should be forwarded. BUG=chromium:866704 TEST=Unit tests show that there is no behavior change Change-Id: Ic8c9fa900fa6baf4b15d0d58d6be51f8aa60d2d3 Reviewed-on: https://chromium-review.googlesource.com/1180611 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/fc952cec8b5d4c85932ef28c0beababa3bd5f192/bluetooth/dispatcher/impersonation_object_manager_interface.h [modify] https://crrev.com/fc952cec8b5d4c85932ef28c0beababa3bd5f192/bluetooth/dispatcher/bluez_interface_handler.cc [modify] https://crrev.com/fc952cec8b5d4c85932ef28c0beababa3bd5f192/bluetooth/dispatcher/impersonation_object_manager_interface_unittest.cc [modify] https://crrev.com/fc952cec8b5d4c85932ef28c0beababa3bd5f192/bluetooth/dispatcher/dispatcher.cc [modify] https://crrev.com/fc952cec8b5d4c85932ef28c0beababa3bd5f192/bluetooth/dispatcher/bluez_interface_handler.h [modify] https://crrev.com/fc952cec8b5d4c85932ef28c0beababa3bd5f192/bluetooth/dispatcher/impersonation_object_manager_interface.cc
,
Sep 9
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/b2272c9d528213e922307511a7f04eb6793d879c commit b2272c9d528213e922307511a7f04eb6793d879c Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Sun Sep 09 04:31:27 2018 bluetooth: Implement method forwarding to multiple services This adds one rule of method forwarding that the dispatcher needs: forward the method call to all services. The method call is forwarded serially to all the services (stop when one of those returns error), rather than in parallel. This is because in practice we want to minimize the the unexpected state where one service returns success but the other returns error. BUG=chromium:866704 TEST=Added unit test in ImpersionatonObjectManagerInterfaceTest, and manual test with both BlueZ and NewBlue as the forwarded services: bluetoothctl --service org.chromium.Bluetooth [bluetooth]# scan on [bluetooth]# scan off During the "scan on", we should see that both BlueZ and NewBlue do scanning (BREDR and LE, respectively) and we see scan results from both services. Change-Id: I80798d46bc99cd293788807403ac7d65a443d511 Reviewed-on: https://chromium-review.googlesource.com/1180612 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/b2272c9d528213e922307511a7f04eb6793d879c/bluetooth/dispatcher/impersonation_object_manager_interface.h [modify] https://crrev.com/b2272c9d528213e922307511a7f04eb6793d879c/bluetooth/dispatcher/impersonation_object_manager_interface_unittest.cc [modify] https://crrev.com/b2272c9d528213e922307511a7f04eb6793d879c/bluetooth/dispatcher/impersonation_object_manager_interface.cc [modify] https://crrev.com/b2272c9d528213e922307511a7f04eb6793d879c/bluetooth/dispatcher/bluez_interface_handler.h [modify] https://crrev.com/b2272c9d528213e922307511a7f04eb6793d879c/bluetooth/dispatcher/bluez_interface_handler.cc
,
Oct 9
|
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Aug 9