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

Commit ffb2cac3 authored by Hsin-chen Chuang's avatar Hsin-chen Chuang Committed by Gerrit Code Review
Browse files

Merge "floss: Add unittest for get_hci_index_from_pid_path and fix warnings" into main

parents 5cd53ead 3a68e348
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2185,14 +2185,17 @@ mod tests {
            get_hci_index_from_pid_path("/var/run/bluetooth/bluetooth0.pid"),
            Some(VirtualHciIndex(0))
        );
        assert_eq!(get_hci_index_from_pid_path("bluetooth0.pid"), Some(VirtualHciIndex(0)));
        assert_eq!(
            get_hci_index_from_pid_path("/var/run/bluetooth/bluetooth1.pid"),
            Some(VirtualHciIndex(1))
        );
        assert_eq!(get_hci_index_from_pid_path("bluetooth1.pid"), Some(VirtualHciIndex(1)));
        assert_eq!(
            get_hci_index_from_pid_path("/var/run/bluetooth/bluetooth10.pid"),
            Some(VirtualHciIndex(10))
        );
        assert_eq!(get_hci_index_from_pid_path("bluetooth10.pid"), Some(VirtualHciIndex(10)));
        assert_eq!(get_hci_index_from_pid_path("/var/run/bluetooth/garbage"), None);
        assert_eq!(get_hci_index_from_pid_path("garbage"), None);
    }
+1 −1
Original line number Diff line number Diff line
@@ -1367,7 +1367,7 @@ impl Bluetooth {
    /// Disconnect the device if no HID or media profiles are enabled.
    pub fn disconnect_if_no_media_or_hid_profiles_connected(&mut self, device_address: RawAddress) {
        let context = match self.remote_devices.get(&device_address) {
            Some(context) => context.clone(),
            Some(context) => context,
            None => return,
        };
        let device = context.info.clone();
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ fn main() {
        .opaque_type("std::.*")
        // Whitelist std::string though because we use it a lot
        .allowlist_type("std::string")
        .rustfmt_bindings(true)
        .formatter(bindgen::Formatter::Rustfmt)
        .derive_debug(true)
        .derive_partialeq(true)
        .derive_eq(true)