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

Commit c05ed84c authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Gerrit Code Review
Browse files

Merge "floss: Ignore Start and Stop if the state is already the same"

parents 408238ea 059643b5
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -71,6 +71,12 @@ impl IBluetoothManager for BluetoothManager {
        if !config_util::modify_hci_n_enabled(hci_interface, true) {
            error!("Config is not successfully modified");
        }

        // Ignore the request if adapter is already enabled.
        if self.cached_devices.get(&hci_interface).unwrap_or(false) {
            return;
        }

        self.manager_context.proxy.start_bluetooth(hci_interface);
    }

@@ -79,6 +85,12 @@ impl IBluetoothManager for BluetoothManager {
        if !config_util::modify_hci_n_enabled(hci_interface, false) {
            error!("Config is not successfully modified");
        }

        // Ignore the request if adapter is already disabled.
        if !self.cached_devices.get(&hci_interface).unwrap_or(false) {
            return;
        }

        self.manager_context.proxy.stop_bluetooth(hci_interface);
    }