Loading system/gd/rust/linux/client/src/command_handler.rs +4 −4 Original line number Diff line number Diff line Loading @@ -783,14 +783,14 @@ impl CommandHandler { .into()); } let success = self let status = self .lock_context() .adapter_dbus .as_mut() .unwrap() .create_bond(device.clone(), BtTransport::Auto); if success { if status == BtStatus::Success { self.lock_context().bonding_attempt = Some(device); } } Loading Loading @@ -832,14 +832,14 @@ impl CommandHandler { name: String::from("Classic Device"), }; let success = self let status = self .lock_context() .adapter_dbus .as_mut() .unwrap() .connect_all_enabled_profiles(device.clone()); if success { if status == BtStatus::Success { println!("Connecting to {}", &device.address); } else { println!("Can't connect to {}", &device.address); Loading system/gd/rust/linux/client/src/dbus_iface.rs +2 −2 Original line number Diff line number Diff line Loading @@ -846,7 +846,7 @@ impl IBluetooth for BluetoothDBus { } #[dbus_method("CreateBond")] fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> bool { fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus { dbus_generated!() } Loading Loading @@ -981,7 +981,7 @@ impl IBluetooth for BluetoothDBus { } #[dbus_method("ConnectAllEnabledProfiles")] fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool { fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus { dbus_generated!() } Loading system/gd/rust/linux/mgmt/Cargo.toml +1 −1 Original line number Diff line number Diff line [package] name = "manager_service" version = "0.3.0" version = "0.4.0" edition = "2018" build = "build.rs" Loading system/gd/rust/linux/service/src/iface_bluetooth.rs +2 −2 Original line number Diff line number Diff line Loading @@ -557,7 +557,7 @@ impl IBluetooth for IBluetoothDBus { } #[dbus_method("CreateBond")] fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> bool { fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus { dbus_generated!() } Loading Loading @@ -692,7 +692,7 @@ impl IBluetooth for IBluetoothDBus { } #[dbus_method("ConnectAllEnabledProfiles")] fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool { fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus { dbus_generated!() } Loading system/gd/rust/linux/stack/src/bluetooth.rs +12 −12 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ pub trait IBluetooth { fn get_discovery_end_millis(&self) -> u64; /// Initiates pairing to a remote device. Triggers connection if not already started. fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> bool; fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus; /// Cancels any pending bond attempt on given device. fn cancel_bond_process(&mut self, device: BluetoothDevice) -> bool; Loading Loading @@ -237,7 +237,7 @@ pub trait IBluetooth { fn remove_sdp_record(&self, handle: i32) -> bool; /// Connect all profiles supported by device and enabled on adapter. fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool; fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus; /// Disconnect all profiles supported by device and enabled on adapter. /// Note that it includes all custom profiles enabled by the users e.g. through SocketManager or Loading Loading @@ -2279,7 +2279,7 @@ impl IBluetooth for Bluetooth { } } fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> bool { fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus { let addr = RawAddress::from_string(device.address.clone()); if addr.is_none() { Loading @@ -2292,7 +2292,7 @@ impl IBluetooth for Bluetooth { 0, ); warn!("Can't create bond. Address {} is not valid", device.address); return false; return BtStatus::InvalidParam; } let address = addr.unwrap(); Loading @@ -2308,7 +2308,7 @@ impl IBluetooth for Bluetooth { DisplayAddress(&address), DisplayAddress(&active_address) ); return false; return BtStatus::Busy; } // There could be a race between bond complete and bond cancel, which makes Loading @@ -2335,7 +2335,7 @@ impl IBluetooth for Bluetooth { BtBondState::NotBonded, 0, ); return false; return BtStatus::from(status as u32); } // Creating bond automatically create ACL connection as well, therefore also log metrics Loading @@ -2347,7 +2347,7 @@ impl IBluetooth for Bluetooth { metrics::acl_connect_attempt(address, BtAclState::Connected); } return true; return BtStatus::Success; } fn cancel_bond_process(&mut self, device: BluetoothDevice) -> bool { Loading Loading @@ -2691,17 +2691,17 @@ impl IBluetooth for Bluetooth { self.sdp.as_ref().unwrap().remove_sdp_record(handle) == BtStatus::Success } fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool { fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus { // Profile init must be complete before this api is callable if !self.profiles_ready { return false; return BtStatus::NotReady; } let mut addr = match RawAddress::from_string(device.address.clone()) { Some(v) => v, None => { warn!("Can't connect profiles on invalid address [{}]", &device.address); return false; return BtStatus::InvalidParam; } }; Loading Loading @@ -2773,7 +2773,7 @@ impl IBluetooth for Bluetooth { let transport = match self.get_remote_device_if_found(&device.address) { Some(context) => context.acl_reported_transport, None => return false, None => return BtStatus::RemoteDeviceDown, }; let device_to_send = device.clone(); let transport = match self.get_remote_type(device.clone()) { Loading Loading @@ -2821,7 +2821,7 @@ impl IBluetooth for Bluetooth { self.resume_discovery(); } return true; return BtStatus::Success; } fn disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool { Loading Loading
system/gd/rust/linux/client/src/command_handler.rs +4 −4 Original line number Diff line number Diff line Loading @@ -783,14 +783,14 @@ impl CommandHandler { .into()); } let success = self let status = self .lock_context() .adapter_dbus .as_mut() .unwrap() .create_bond(device.clone(), BtTransport::Auto); if success { if status == BtStatus::Success { self.lock_context().bonding_attempt = Some(device); } } Loading Loading @@ -832,14 +832,14 @@ impl CommandHandler { name: String::from("Classic Device"), }; let success = self let status = self .lock_context() .adapter_dbus .as_mut() .unwrap() .connect_all_enabled_profiles(device.clone()); if success { if status == BtStatus::Success { println!("Connecting to {}", &device.address); } else { println!("Can't connect to {}", &device.address); Loading
system/gd/rust/linux/client/src/dbus_iface.rs +2 −2 Original line number Diff line number Diff line Loading @@ -846,7 +846,7 @@ impl IBluetooth for BluetoothDBus { } #[dbus_method("CreateBond")] fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> bool { fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus { dbus_generated!() } Loading Loading @@ -981,7 +981,7 @@ impl IBluetooth for BluetoothDBus { } #[dbus_method("ConnectAllEnabledProfiles")] fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool { fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus { dbus_generated!() } Loading
system/gd/rust/linux/mgmt/Cargo.toml +1 −1 Original line number Diff line number Diff line [package] name = "manager_service" version = "0.3.0" version = "0.4.0" edition = "2018" build = "build.rs" Loading
system/gd/rust/linux/service/src/iface_bluetooth.rs +2 −2 Original line number Diff line number Diff line Loading @@ -557,7 +557,7 @@ impl IBluetooth for IBluetoothDBus { } #[dbus_method("CreateBond")] fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> bool { fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus { dbus_generated!() } Loading Loading @@ -692,7 +692,7 @@ impl IBluetooth for IBluetoothDBus { } #[dbus_method("ConnectAllEnabledProfiles")] fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool { fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus { dbus_generated!() } Loading
system/gd/rust/linux/stack/src/bluetooth.rs +12 −12 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ pub trait IBluetooth { fn get_discovery_end_millis(&self) -> u64; /// Initiates pairing to a remote device. Triggers connection if not already started. fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> bool; fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus; /// Cancels any pending bond attempt on given device. fn cancel_bond_process(&mut self, device: BluetoothDevice) -> bool; Loading Loading @@ -237,7 +237,7 @@ pub trait IBluetooth { fn remove_sdp_record(&self, handle: i32) -> bool; /// Connect all profiles supported by device and enabled on adapter. fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool; fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus; /// Disconnect all profiles supported by device and enabled on adapter. /// Note that it includes all custom profiles enabled by the users e.g. through SocketManager or Loading Loading @@ -2279,7 +2279,7 @@ impl IBluetooth for Bluetooth { } } fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> bool { fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus { let addr = RawAddress::from_string(device.address.clone()); if addr.is_none() { Loading @@ -2292,7 +2292,7 @@ impl IBluetooth for Bluetooth { 0, ); warn!("Can't create bond. Address {} is not valid", device.address); return false; return BtStatus::InvalidParam; } let address = addr.unwrap(); Loading @@ -2308,7 +2308,7 @@ impl IBluetooth for Bluetooth { DisplayAddress(&address), DisplayAddress(&active_address) ); return false; return BtStatus::Busy; } // There could be a race between bond complete and bond cancel, which makes Loading @@ -2335,7 +2335,7 @@ impl IBluetooth for Bluetooth { BtBondState::NotBonded, 0, ); return false; return BtStatus::from(status as u32); } // Creating bond automatically create ACL connection as well, therefore also log metrics Loading @@ -2347,7 +2347,7 @@ impl IBluetooth for Bluetooth { metrics::acl_connect_attempt(address, BtAclState::Connected); } return true; return BtStatus::Success; } fn cancel_bond_process(&mut self, device: BluetoothDevice) -> bool { Loading Loading @@ -2691,17 +2691,17 @@ impl IBluetooth for Bluetooth { self.sdp.as_ref().unwrap().remove_sdp_record(handle) == BtStatus::Success } fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool { fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus { // Profile init must be complete before this api is callable if !self.profiles_ready { return false; return BtStatus::NotReady; } let mut addr = match RawAddress::from_string(device.address.clone()) { Some(v) => v, None => { warn!("Can't connect profiles on invalid address [{}]", &device.address); return false; return BtStatus::InvalidParam; } }; Loading Loading @@ -2773,7 +2773,7 @@ impl IBluetooth for Bluetooth { let transport = match self.get_remote_device_if_found(&device.address) { Some(context) => context.acl_reported_transport, None => return false, None => return BtStatus::RemoteDeviceDown, }; let device_to_send = device.clone(); let transport = match self.get_remote_type(device.clone()) { Loading Loading @@ -2821,7 +2821,7 @@ impl IBluetooth for Bluetooth { self.resume_discovery(); } return true; return BtStatus::Success; } fn disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool { Loading