Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c95015fc authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi Committed by Abhishek Pandit-Subedi
Browse files

Enable object manager for btmanagerd

Clients will use object manager's InterfaceAdded/InterfaceRemoved
notifications to keep track of when Bluetooth becomes available.

Also update dbus-crossroads dependency to 0.4, which adds a bugfix for
creating object manager on "/".

Bug: 190606778
Tag: #floss
Test: Verified on ChromeOS
Change-Id: Ib339ea9bf598301efc0f572b35a3ce638039a170
parent 70e43040
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ bt_topshim = { path = "../../topshim" }
btstack = { path = "../stack" }

dbus = "0.9.2"
dbus-crossroads = "0.3.0"
dbus-crossroads = "0.4.0"
dbus-tokio = "0.7.3"

dbus_projection = { path = "../dbus_projection" }
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ bt_common = { path = "../../common" }
# external deps
dbus = "0.9.2"
dbus-tokio = "0.7.3"
dbus-crossroads = "0.3.0"
dbus-crossroads = "0.4.0"
inotify = "*"
log = "0.4.14"
nix = "*"
+8 −2
Original line number Diff line number Diff line
@@ -100,6 +100,12 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
        }),
    )));

    // Object manager is necessary for clients (to inform them when Bluetooth is
    // available). Create it at root (/) so subsequent additions generate
    // InterfaceAdded and InterfaceRemoved signals.
    cr.set_object_manager_support(Some(conn.clone()));
    cr.insert("/", &[cr.object_manager()], {});

    let iface_token = cr.register("org.chromium.bluetooth.Manager", |b| {
        b.method_with_cr_async(
            "Start",
@@ -271,8 +277,8 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
        );
    });

    // Let's add the "/org/chromium/bluetooth/Manager" path, which implements the org.chromium.bluetooth.Manager interface,
    // to the crossroads instance.
    // Let's add the "/org/chromium/bluetooth/Manager" path, which implements
    // the org.chromium.bluetooth.Manager interface, to the crossroads instance.
    cr.insert("/org/chromium/bluetooth/Manager", &[iface_token], manager_context);

    // We add the Crossroads instance to the connection so that incoming method calls will be handled.
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ dbus_projection = { path = "../dbus_projection" }
dbus_macros = { path = "../dbus_projection/dbus_macros" }

dbus = "0.9.2"
dbus-crossroads = "0.3.0"
dbus-crossroads = "0.4.0"
dbus-tokio = "0.7.3"
futures = "0.3.13"
num-traits = "*"