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

Commit 12340c0a authored by Zhengping Jiang's avatar Zhengping Jiang Committed by Gerrit Code Review
Browse files

Merge "Floss: Increase timeout for handle_sigterm"

parents 5dfd0a68 fe730424
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -41,6 +41,9 @@ mod iface_bluetooth_media;


const DBUS_SERVICE_NAME: &str = "org.chromium.bluetooth";
const DBUS_SERVICE_NAME: &str = "org.chromium.bluetooth";
const ADMIN_SETTINGS_FILE_PATH: &str = "/var/lib/bluetooth/admin_policy.json";
const ADMIN_SETTINGS_FILE_PATH: &str = "/var/lib/bluetooth/admin_policy.json";
// The maximum ACL disconnect timeout is 3.5s defined by BTA_DM_DISABLE_TIMER_MS
// and BTA_DM_DISABLE_TIMER_RETRIAL_MS
const STACK_TURN_OFF_TIMEOUT_MS: Duration = Duration::from_millis(4000);


fn make_object_name(idx: i32, name: &str) -> String {
fn make_object_name(idx: i32, name: &str) -> String {
    String::from(format!("/org/chromium/bluetooth/hci{}/{}", idx, name))
    String::from(format!("/org/chromium/bluetooth/hci{}/{}", idx, name))
@@ -372,8 +375,8 @@ extern "C" fn handle_sigterm(_signum: i32) {


        let guard = notifier.0.lock().unwrap();
        let guard = notifier.0.lock().unwrap();
        if *guard {
        if *guard {
            log::debug!("Waiting for stack to turn off for 2s");
            log::debug!("Waiting for stack to turn off for {:?}", STACK_TURN_OFF_TIMEOUT_MS);
            let _ = notifier.1.wait_timeout(guard, std::time::Duration::from_millis(2000));
            let _ = notifier.1.wait_timeout(guard, STACK_TURN_OFF_TIMEOUT_MS);
        }
        }
    }
    }