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

Commit e0b360d2 authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Automerger Merge Worker
Browse files

Merge changes Ia99e7400,I50dce8fc am: 6c9b0563

parents a2b0229d 6c9b0563
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39,4 +39,5 @@ protoc-rust = "2.0"

[[bin]]
name = "btmanagerd"
path = "src/main.rs"
build = "build.rs"
+13 −10
Original line number Diff line number Diff line
@@ -113,6 +113,19 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let disconnect_watcher = Arc::new(Mutex::new(DisconnectWatcher::new()));
    disconnect_watcher.lock().unwrap().setup_watch(conn.clone()).await;

    // We add the Crossroads instance to the connection so that incoming method calls will be
    // handled.
    // This must be done before exporting interfaces so that clients that rely on InterfacesAdded
    // signal can rely on us being ready to handle methods on those exported interfaces.
    let cr_clone = cr.clone();
    conn.start_receive(
        MatchRule::new_method_call(),
        Box::new(move |msg, conn| {
            cr_clone.lock().unwrap().handle_message(msg, conn).unwrap();
            true
        }),
    );

    // Let's add the "/org/chromium/bluetooth/Manager" path, which implements
    // the org.chromium.bluetooth.Manager interface, to the crossroads instance.
    let iface = bluetooth_manager_dbus::export_bluetooth_manager_dbus_intf(
@@ -137,16 +150,6 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {

    cr.lock().unwrap().insert("/org/chromium/bluetooth/Manager", &[iface, iface_exp], mixin);

    // We add the Crossroads instance to the connection so that incoming method calls will be handled.
    let cr_clone = cr.clone();
    conn.start_receive(
        MatchRule::new_method_call(),
        Box::new(move |msg, conn| {
            cr_clone.lock().unwrap().handle_message(msg, conn).unwrap();
            true
        }),
    );

    let mut powerd_suspend_manager = PowerdSuspendManager::new(conn.clone(), cr);

    tokio::spawn(async move {