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

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

Merge changes I505d2fbc,I0a419221

* changes:
  floss: Convert some hard failures to soft failures
  floss: Ignore wakelock_acquire error in alarm
parents 81a3abba c8eb2930
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
use log::{error, info};
use log::{error, info, warn};

use manager_service::iface_bluetooth_manager::{
    AdapterWithEnabled, IBluetoothManager, IBluetoothManagerCallback,
@@ -123,10 +123,9 @@ impl IBluetoothManager for BluetoothManager {
        let prev = self.manager_context.floss_enabled.swap(enabled, Ordering::Relaxed);
        config_util::write_floss_enabled(enabled);
        if prev != enabled && enabled {
            Command::new("initctl")
                .args(&["stop", BLUEZ_INIT_TARGET])
                .output()
                .expect("failed to stop bluetoothd");
            if let Err(e) = Command::new("initctl").args(&["stop", BLUEZ_INIT_TARGET]).output() {
                warn!("Failed to stop bluetoothd: {}", e);
            }
            // TODO: Implement multi-hci case
            let default_device = config_util::list_hci_devices()[0];
            if config_util::is_hci_n_enabled(default_device) {
@@ -136,10 +135,9 @@ impl IBluetoothManager for BluetoothManager {
            // TODO: Implement multi-hci case
            let default_device = config_util::list_hci_devices()[0];
            self.manager_context.proxy.stop_bluetooth(default_device);
            Command::new("initctl")
                .args(&["start", BLUEZ_INIT_TARGET])
                .output()
                .expect("failed to start bluetoothd");
            if let Err(e) = Command::new("initctl").args(&["start", BLUEZ_INIT_TARGET]).output() {
                warn!("Failed to start bluetoothd: {}", e);
            }
        }
    }

+8 −4
Original line number Diff line number Diff line
@@ -495,17 +495,21 @@ impl UpstartInvoker {

impl ProcessManager for UpstartInvoker {
    fn start(&mut self, hci_interface: String) {
        Command::new("initctl")
        if let Err(e) = Command::new("initctl")
            .args(&["start", "btadapterd", format!("HCI={}", hci_interface).as_str()])
            .output()
            .expect("failed to start bluetooth");
        {
            error!("Failed to start btadapterd: {}", e);
        }
    }

    fn stop(&mut self, hci_interface: String) {
        Command::new("initctl")
        if let Err(e) = Command::new("initctl")
            .args(&["stop", "btadapterd", format!("HCI={}", hci_interface).as_str()])
            .output()
            .expect("failed to stop bluetooth");
        {
            error!("Failed to stop btadapterd: {}", e);
        }
    }
}

+0 −1
Original line number Diff line number Diff line
@@ -474,7 +474,6 @@ static void reschedule_root_alarm(void) {
    if (!timer_set) {
      if (!wakelock_acquire()) {
        LOG_ERROR("%s unable to acquire wake lock", __func__);
        goto done;
      }
    }