New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 883039 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 863608



Sign in to add a comment

Implement Agent API in NewBlue Daemon

Project Member Reported by sonnysasaka@chromium.org, Sep 11

Issue description

Having Agent API allows pairing which requires passkey/pin code.
 
Blocking: 863608
Project Member

Comment 2 by bugdroid1@chromium.org, Sep 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/6bc01877153f567cd6bdd7c03edcf8afd8beae7c

commit 6bc01877153f567cd6bdd7c03edcf8afd8beae7c
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Sun Sep 16 11:04:20 2018

bluetooth: Forward AgentManager1 calls to both BlueZ and NewBlue

BUG=chromium:883039
TEST=bluetoothctl --service org.chromium.Bluetooth, run "agent on",
check that both BlueZ and NewBlue receive RegisterAgent method call.

Change-Id: I4035563980ef93ef8e38dffeec0d1ca06aadb81c
Reviewed-on: https://chromium-review.googlesource.com/1219977
Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Qiyu Hu <qiyuh@google.com>

[modify] https://crrev.com/6bc01877153f567cd6bdd7c03edcf8afd8beae7c/bluetooth/dispatcher/bluez_interface_handler.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Sep 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/fead15d23148fe377be8a4785df738bb1552949d

commit fead15d23148fe377be8a4785df738bb1552949d
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Tue Sep 18 21:03:33 2018

bluetooth: Add pairing agent to Newblue class

Newblue can accept a pairing agent to handle user interactions during
pairing process. In future work, the agent will be a handler of
AgentManager1 D-Bus interface.

BUG=chromium:883039
TEST=Added unit test in NewblueTest

Change-Id: I67a523f6cb9b4013ec632bcf560b0631d6347fc8
Reviewed-on: https://chromium-review.googlesource.com/1226258
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Qiyu Hu <qiyuh@google.com>

[modify] https://crrev.com/fead15d23148fe377be8a4785df738bb1552949d/bluetooth/newblued/mock_libnewblue.h
[modify] https://crrev.com/fead15d23148fe377be8a4785df738bb1552949d/bluetooth/newblued/newblue.cc
[modify] https://crrev.com/fead15d23148fe377be8a4785df738bb1552949d/bluetooth/newblued/libnewblue.h
[modify] https://crrev.com/fead15d23148fe377be8a4785df738bb1552949d/bluetooth/newblued/newblue.h
[modify] https://crrev.com/fead15d23148fe377be8a4785df738bb1552949d/bluetooth/newblued/newblue_unittest.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Sep 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/6a352798fa7fe5ef113160b14e4db512c6841b8d

commit 6a352798fa7fe5ef113160b14e4db512c6841b8d
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Tue Sep 18 21:03:33 2018

bluetooth: Add handler for AgentManager1 interface.

AgentManager1 interface is needed to handle user interaction during
pairing process. This mimics BlueZ's behavior described in
doc/agent-api.txt. Currently, only DisplayPasskey is implemented for
Agent1 interface and the rest will be TODOs.

BUG=chromium:883039
TEST=Added unit test

Change-Id: Iec30171f21d5f66b3b04480724e5e5b9ac98559e
Reviewed-on: https://chromium-review.googlesource.com/1226259
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Qiyu Hu <qiyuh@google.com>

[add] https://crrev.com/6a352798fa7fe5ef113160b14e4db512c6841b8d/bluetooth/newblued/agent_manager_interface_handler.cc
[add] https://crrev.com/6a352798fa7fe5ef113160b14e4db512c6841b8d/bluetooth/newblued/agent_manager_interface_handler.h
[add] https://crrev.com/6a352798fa7fe5ef113160b14e4db512c6841b8d/bluetooth/newblued/agent_manager_interface_handler_test.cc
[modify] https://crrev.com/6a352798fa7fe5ef113160b14e4db512c6841b8d/bluetooth/newblued/newblue_daemon.h
[modify] https://crrev.com/6a352798fa7fe5ef113160b14e4db512c6841b8d/bluetooth/bluetooth.gyp
[modify] https://crrev.com/6a352798fa7fe5ef113160b14e4db512c6841b8d/bluetooth/newblued/newblue_daemon.cc
[modify] https://crrev.com/6a352798fa7fe5ef113160b14e4db512c6841b8d/bluetooth/newblued/newblue_daemon_unittest.cc

Cc: shijinabraham@chromium.org
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/787ea91765850846d83583b84144437885f46d70

commit 787ea91765850846d83583b84144437885f46d70
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Wed Nov 28 03:13:41 2018

bluetooth: Add rules for object export.

When impersonating multiple services, the dispatcher can choose whether
to export the impersonated object when:
* Any of the service exports it
  Example use case: If any of BlueZ or NewBlue exports a device object,
  the dispatcher should export it, too.
* All of the services export it
  Example use case: Only if all of BlueZ and NewBlue exports an agent
  manager object, the dispatcher should export it.

This CL adds configurability to an interface which behavior to adopt.

BUG=chromium:883039
TEST=Added unit test to ImpersonationObjectManagerInterfaceTest

Change-Id: Ibd6180c2ac76995e26c0a6374c62c8dfcf5f4dfc
Reviewed-on: https://chromium-review.googlesource.com/1325313
Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Qiyu Hu <qiyuh@google.com>

[modify] https://crrev.com/787ea91765850846d83583b84144437885f46d70/bluetooth/dispatcher/impersonation_object_manager_interface.h
[modify] https://crrev.com/787ea91765850846d83583b84144437885f46d70/bluetooth/dispatcher/bluez_interface_handler.cc
[modify] https://crrev.com/787ea91765850846d83583b84144437885f46d70/bluetooth/dispatcher/impersonation_object_manager_interface_unittest.cc
[modify] https://crrev.com/787ea91765850846d83583b84144437885f46d70/bluetooth/common/exported_object_manager_wrapper.cc
[modify] https://crrev.com/787ea91765850846d83583b84144437885f46d70/bluetooth/dispatcher/bluez_interface_handler.h
[modify] https://crrev.com/787ea91765850846d83583b84144437885f46d70/bluetooth/dispatcher/impersonation_object_manager_interface.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 4

Labels: merge-merged-chromeos-5.44
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/bluez/+/2a2c3423354275724562eae14b55a00ade532433

commit 2a2c3423354275724562eae14b55a00ade532433
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Tue Dec 04 08:11:40 2018

CHROMIUM: Treat as success RegisterAgent for existing client

Due to dispatcher multiplexing both BlueZ and NewBlue, end clients (e.g.
Chrome) can't keep track of the agent state of BlueZ and NewBlue
individually. Therefore it's cleaner if clients don't get errors for
operations that do not actually mean error, i.e. RegisterAgent for
existing client and UnregisterAgent for non-existing client.

BUG=chromium:883039
TEST=Use bluetoothctl to call RegisterAgent multiple times.

Change-Id: I89d0de638c2eb5068d27701d9dea5fa0aa1bf033
Reviewed-on: https://chromium-review.googlesource.com/1325490
Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Qiyu Hu <qiyuh@google.com>

[modify] https://crrev.com/2a2c3423354275724562eae14b55a00ade532433/src/agent.c

Project Member

Comment 8 by bugdroid1@chromium.org, Dec 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e463407a97a54e19242deddf7d24197ed3f5946b

commit e463407a97a54e19242deddf7d24197ed3f5946b
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Wed Dec 12 20:29:33 2018

dbus: Support UnexportMethod from an exported object.

Currently there is no way to override a method handler that is already
registered to an ExportedObject. A support to do so is required to
correctly implement Chrome OS Bluetooth dispatcher which needs to
add/remove an interface to an exported object dynamically. Therefore
this CL adds methods to allow method handlers to be unexported so
another handler can be exported afterwards.

Bug: 883039
Change-Id: Id26dbdb8b2ee3425c21ec0797e1c08183f3e04ab
Reviewed-on: https://chromium-review.googlesource.com/c/1370573
Commit-Queue: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616020}
[modify] https://crrev.com/e463407a97a54e19242deddf7d24197ed3f5946b/dbus/exported_object.cc
[modify] https://crrev.com/e463407a97a54e19242deddf7d24197ed3f5946b/dbus/exported_object.h
[modify] https://crrev.com/e463407a97a54e19242deddf7d24197ed3f5946b/dbus/mock_exported_object.h

Project Member

Comment 9 by bugdroid1@chromium.org, Dec 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/48583ba93f7da40c86c1b93d2c4d10bcc603c5fb

commit 48583ba93f7da40c86c1b93d2c4d10bcc603c5fb
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Fri Dec 14 03:28:20 2018

libchrome: dbus: Support UnexportMethod from an exported object.

Currently there is no way to override a method handler that is already
registered to an ExportedObject. A support to do so is required to
correctly implement Chrome OS Bluetooth dispatcher which needs to
add/remove an interface to an exported object dynamically. Therefore
this CL adds methods to allow method handlers to be unexported so
another handler can be exported afterwards.

This is a cherry-pick from Chrome's CL:1370573.

BUG=chromium:883039
TEST=libchrome builds, manual integration test with platform2/bluetooth.

Change-Id: Ib3d6b53326d9062a4aedcff8c01d9c56f88bb1f0
Reviewed-on: https://chromium-review.googlesource.com/1374549
Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>

[rename] https://crrev.com/48583ba93f7da40c86c1b93d2c4d10bcc603c5fb/chromeos-base/libchrome/libchrome-456626-r5.ebuild
[modify] https://crrev.com/48583ba93f7da40c86c1b93d2c4d10bcc603c5fb/chromeos-base/libchrome/libchrome-456626.ebuild
[add] https://crrev.com/48583ba93f7da40c86c1b93d2c4d10bcc603c5fb/chromeos-base/libchrome/files/libchrome-456626-dbus-Support-UnexportMethod-from-an-exported-object.patch

Project Member

Comment 10 by bugdroid1@chromium.org, Dec 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/94fe37c68cdeb1464feb0b8e557bc21d3d031bc1

commit 94fe37c68cdeb1464feb0b8e557bc21d3d031bc1
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Tue Dec 18 08:42:54 2018

libbrillo: dbus: Provide DBusObject::UnexportInterfaceAsync()

In some cases, one may want to export an interface even after it's
removed. In that case, they should call
DBusObject::UnexportInterfaceAsync before removing the
interface to make sure it will start with a clean state of method
handlers.

This is currently needed by platform2/bluetooth for exporting and
unexporting the same interface of the same object dynamically for BlueZ
compatibility.

BUG=chromium:812468,chromium:883039
TEST=Added unit test and did manual integration test with
platform2/bluetooth
CQ-DEPEND=CL:1374549

Change-Id: Id5333acc5d5b79a6708accfb51c45c6d52cf9ae3
Reviewed-on: https://chromium-review.googlesource.com/1370854
Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>

[modify] https://crrev.com/94fe37c68cdeb1464feb0b8e557bc21d3d031bc1/libbrillo/brillo/dbus/dbus_object.h
[modify] https://crrev.com/94fe37c68cdeb1464feb0b8e557bc21d3d031bc1/libbrillo/brillo/dbus/dbus_object_test.cc
[modify] https://crrev.com/94fe37c68cdeb1464feb0b8e557bc21d3d031bc1/libbrillo/brillo/dbus/dbus_object.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Dec 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/221f9562c824a06755bceb4367d5632882792614

commit 221f9562c824a06755bceb4367d5632882792614
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Fri Dec 21 21:00:08 2018

bluetooth: Chrome to observe agent manager interface.

Currently Chrome calls org.bluez.AgentManager1.RegisterAgent without
making sure that the AgentManager1 interface is provided by BlueZ, but
instead relying on the existence of org.bluez.Adapter1 interface.This
assumption will no longer be true with the arrival of NewBlue, so the
right way is to directly observe the existence of AgentManager1
interface before making any calls to it, and also to re-RegisterAgent
when the interface reappears.

Bug: 883039
Change-Id: If6f02c98309c3fe1c9a2f12d073e3d3d2227ab4a
Reviewed-on: https://chromium-review.googlesource.com/c/1361671
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Commit-Queue: Sonny Sasaka <sonnysasaka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618595}
[modify] https://crrev.com/221f9562c824a06755bceb4367d5632882792614/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
[modify] https://crrev.com/221f9562c824a06755bceb4367d5632882792614/device/bluetooth/bluez/bluetooth_adapter_bluez.h
[modify] https://crrev.com/221f9562c824a06755bceb4367d5632882792614/device/bluetooth/dbus/bluetooth_agent_manager_client.cc
[modify] https://crrev.com/221f9562c824a06755bceb4367d5632882792614/device/bluetooth/dbus/bluetooth_agent_manager_client.h
[modify] https://crrev.com/221f9562c824a06755bceb4367d5632882792614/device/bluetooth/dbus/fake_bluetooth_agent_manager_client.cc
[modify] https://crrev.com/221f9562c824a06755bceb4367d5632882792614/device/bluetooth/dbus/fake_bluetooth_agent_manager_client.h

Project Member

Comment 12 by bugdroid1@chromium.org, Jan 8

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/a6917a161a04506b6778ae265ac6f4af8fc1b00b

commit a6917a161a04506b6778ae265ac6f4af8fc1b00b
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Tue Jan 08 09:59:06 2019

bluetooth: Unexport interface before remove interface

Calling UnexportInterfaceAsync ensures that the method handlers
registered with it are unregistered, so when this interface is
re-registered in the future it won't cause errors.

BUG=chromium:812468,chromium:883039
TEST=Manual test to trigger AgentManager interface removal:
  with bluetoothctl:
  power off
  power on
This triggers AgentManager object /org/bluez removal and re-export, this
operation shouldn't cause error/crash.

Change-Id: I10eba7d8841a89c2dc347f93905dc03b5aa4fd94
Reviewed-on: https://chromium-review.googlesource.com/1374534
Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Qiyu Hu <qiyuh@google.com>

[modify] https://crrev.com/a6917a161a04506b6778ae265ac6f4af8fc1b00b/bluetooth/common/exported_object_manager_wrapper_unittest.cc
[modify] https://crrev.com/a6917a161a04506b6778ae265ac6f4af8fc1b00b/bluetooth/common/exported_object_manager_wrapper.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Jan 8

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/875b781d644b67a22553810e4b7d197ad1639c84

commit 875b781d644b67a22553810e4b7d197ad1639c84
Author: Sonny Sasaka <sonnysasaka@chromium.org>
Date: Tue Jan 08 09:59:05 2019

bluetooth: Refactor ExportedInterface::Unexport and improve unit test

This refactoring helps in the next bug fix CL.

BUG=chromium:812468,chromium:883039
TEST=Unit tests don't regress, there should be no behavior change.

Change-Id: I4610b61c285070c741b3339c0a0eed072b88ce69
Reviewed-on: https://chromium-review.googlesource.com/1384643
Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Qiyu Hu <qiyuh@google.com>

[modify] https://crrev.com/875b781d644b67a22553810e4b7d197ad1639c84/bluetooth/common/exported_object_manager_wrapper_unittest.cc
[modify] https://crrev.com/875b781d644b67a22553810e4b7d197ad1639c84/bluetooth/common/exported_object_manager_wrapper.cc

Sign in to add a comment