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

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

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

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1844708

Change-Id: Ia61d56a8eaf7e264496e6f0702215590cdd88425
parents 02567aa2 cf5af9d7
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);
    }