Loading system/gd/rust/linux/service/src/interface_manager.rs +10 −10 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ impl InterfaceManager { pub async fn dispatch( mut rx: Receiver<APIMessage>, adapter_index: i32, virt_index: i32, conn: Arc<SyncConnection>, disconnect_watcher: Arc<Mutex<DisconnectWatcher>>, bluetooth: Arc<Mutex<Box<Bluetooth>>>, Loading Loading @@ -169,32 +169,32 @@ impl InterfaceManager { APIMessage::IsReady(api) => match api { BluetoothAPI::Adapter => { cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "adapter"), Self::make_object_name(virt_index, "adapter"), &[adapter_iface, qa_legacy_iface, socket_mgr_iface, suspend_iface], mixin.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "admin"), Self::make_object_name(virt_index, "admin"), &[admin_iface], bluetooth_admin.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "logging"), Self::make_object_name(virt_index, "logging"), &[logging_iface], logging.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "qa"), Self::make_object_name(virt_index, "qa"), &[qa_iface], bluetooth_qa.clone(), ); } BluetoothAPI::Gatt => { cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "gatt"), Self::make_object_name(virt_index, "gatt"), &[gatt_iface], bluetooth_gatt.clone(), ); Loading @@ -208,26 +208,26 @@ impl InterfaceManager { } BluetoothAPI::Media => { cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "media"), Self::make_object_name(virt_index, "media"), &[media_iface], bluetooth_media.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "telephony"), Self::make_object_name(virt_index, "telephony"), &[telephony_iface], bluetooth_media.clone(), ); } BluetoothAPI::Battery => { cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "battery_provider_manager"), Self::make_object_name(virt_index, "battery_provider_manager"), &[battery_provider_manager_iface], battery_provider_manager.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "battery_manager"), Self::make_object_name(virt_index, "battery_manager"), &[battery_manager_iface], battery_manager.clone(), ); Loading system/gd/rust/linux/service/src/main.rs +3 −3 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ fn main() -> Result<(), Box<dyn Error>> { let is_verbose_debug = matches.is_present("verbose-debug"); let log_output = matches.value_of("log-output").unwrap_or("syslog"); let adapter_index = matches.value_of("index").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0)); let virt_index = matches.value_of("index").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0)); let hci_index = matches.value_of("hci").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0)); // The remaining flags are passed down to Fluoride as is. Loading Loading @@ -175,7 +175,7 @@ fn main() -> Result<(), Box<dyn Error>> { tx.clone(), )))); let bluetooth = Arc::new(Mutex::new(Box::new(Bluetooth::new( adapter_index, virt_index, hci_index, tx.clone(), api_tx.clone(), Loading Loading @@ -237,7 +237,7 @@ fn main() -> Result<(), Box<dyn Error>> { tokio::spawn(interface_manager::InterfaceManager::dispatch( api_rx, adapter_index, virt_index, conn.clone(), disconnect_watcher.clone(), bluetooth.clone(), Loading system/gd/rust/linux/stack/src/bluetooth.rs +5 −5 Original line number Diff line number Diff line Loading @@ -487,7 +487,7 @@ pub trait IBluetoothConnectionCallback: RPCProxy { pub struct Bluetooth { intf: Arc<Mutex<BluetoothInterface>>, adapter_index: i32, virt_index: i32, hci_index: i32, bonded_devices: HashMap<String, BluetoothDeviceContext>, ble_scanner_id: Option<u8>, Loading Loading @@ -528,7 +528,7 @@ pub struct Bluetooth { impl Bluetooth { /// Constructs the IBluetooth implementation. pub fn new( adapter_index: i32, virt_index: i32, hci_index: i32, tx: Sender<Message>, api_tx: Sender<APIMessage>, Loading @@ -539,7 +539,7 @@ impl Bluetooth { bluetooth_media: Arc<Mutex<Box<BluetoothMedia>>>, ) -> Bluetooth { Bluetooth { adapter_index, virt_index, hci_index, bonded_devices: HashMap::new(), callbacks: Callbacks::new(tx.clone(), Message::AdapterCallbackDisconnected), Loading Loading @@ -1047,7 +1047,7 @@ impl Bluetooth { /// Creates a file to notify btmanagerd the adapter is enabled. fn create_pid_file(&self) -> std::io::Result<()> { let file_name = format!("{}/bluetooth{}.pid", PID_DIR, self.adapter_index); let file_name = format!("{}/bluetooth{}.pid", PID_DIR, self.virt_index); let mut f = File::create(&file_name)?; f.write_all(process::id().to_string().as_bytes())?; Ok(()) Loading @@ -1055,7 +1055,7 @@ impl Bluetooth { /// Removes the file to notify btmanagerd the adapter is disabled. fn remove_pid_file(&self) -> std::io::Result<()> { let file_name = format!("{}/bluetooth{}.pid", PID_DIR, self.adapter_index); let file_name = format!("{}/bluetooth{}.pid", PID_DIR, self.virt_index); std::fs::remove_file(&file_name)?; Ok(()) } Loading Loading
system/gd/rust/linux/service/src/interface_manager.rs +10 −10 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ impl InterfaceManager { pub async fn dispatch( mut rx: Receiver<APIMessage>, adapter_index: i32, virt_index: i32, conn: Arc<SyncConnection>, disconnect_watcher: Arc<Mutex<DisconnectWatcher>>, bluetooth: Arc<Mutex<Box<Bluetooth>>>, Loading Loading @@ -169,32 +169,32 @@ impl InterfaceManager { APIMessage::IsReady(api) => match api { BluetoothAPI::Adapter => { cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "adapter"), Self::make_object_name(virt_index, "adapter"), &[adapter_iface, qa_legacy_iface, socket_mgr_iface, suspend_iface], mixin.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "admin"), Self::make_object_name(virt_index, "admin"), &[admin_iface], bluetooth_admin.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "logging"), Self::make_object_name(virt_index, "logging"), &[logging_iface], logging.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "qa"), Self::make_object_name(virt_index, "qa"), &[qa_iface], bluetooth_qa.clone(), ); } BluetoothAPI::Gatt => { cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "gatt"), Self::make_object_name(virt_index, "gatt"), &[gatt_iface], bluetooth_gatt.clone(), ); Loading @@ -208,26 +208,26 @@ impl InterfaceManager { } BluetoothAPI::Media => { cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "media"), Self::make_object_name(virt_index, "media"), &[media_iface], bluetooth_media.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "telephony"), Self::make_object_name(virt_index, "telephony"), &[telephony_iface], bluetooth_media.clone(), ); } BluetoothAPI::Battery => { cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "battery_provider_manager"), Self::make_object_name(virt_index, "battery_provider_manager"), &[battery_provider_manager_iface], battery_provider_manager.clone(), ); cr.lock().unwrap().insert( Self::make_object_name(adapter_index, "battery_manager"), Self::make_object_name(virt_index, "battery_manager"), &[battery_manager_iface], battery_manager.clone(), ); Loading
system/gd/rust/linux/service/src/main.rs +3 −3 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ fn main() -> Result<(), Box<dyn Error>> { let is_verbose_debug = matches.is_present("verbose-debug"); let log_output = matches.value_of("log-output").unwrap_or("syslog"); let adapter_index = matches.value_of("index").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0)); let virt_index = matches.value_of("index").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0)); let hci_index = matches.value_of("hci").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0)); // The remaining flags are passed down to Fluoride as is. Loading Loading @@ -175,7 +175,7 @@ fn main() -> Result<(), Box<dyn Error>> { tx.clone(), )))); let bluetooth = Arc::new(Mutex::new(Box::new(Bluetooth::new( adapter_index, virt_index, hci_index, tx.clone(), api_tx.clone(), Loading Loading @@ -237,7 +237,7 @@ fn main() -> Result<(), Box<dyn Error>> { tokio::spawn(interface_manager::InterfaceManager::dispatch( api_rx, adapter_index, virt_index, conn.clone(), disconnect_watcher.clone(), bluetooth.clone(), Loading
system/gd/rust/linux/stack/src/bluetooth.rs +5 −5 Original line number Diff line number Diff line Loading @@ -487,7 +487,7 @@ pub trait IBluetoothConnectionCallback: RPCProxy { pub struct Bluetooth { intf: Arc<Mutex<BluetoothInterface>>, adapter_index: i32, virt_index: i32, hci_index: i32, bonded_devices: HashMap<String, BluetoothDeviceContext>, ble_scanner_id: Option<u8>, Loading Loading @@ -528,7 +528,7 @@ pub struct Bluetooth { impl Bluetooth { /// Constructs the IBluetooth implementation. pub fn new( adapter_index: i32, virt_index: i32, hci_index: i32, tx: Sender<Message>, api_tx: Sender<APIMessage>, Loading @@ -539,7 +539,7 @@ impl Bluetooth { bluetooth_media: Arc<Mutex<Box<BluetoothMedia>>>, ) -> Bluetooth { Bluetooth { adapter_index, virt_index, hci_index, bonded_devices: HashMap::new(), callbacks: Callbacks::new(tx.clone(), Message::AdapterCallbackDisconnected), Loading Loading @@ -1047,7 +1047,7 @@ impl Bluetooth { /// Creates a file to notify btmanagerd the adapter is enabled. fn create_pid_file(&self) -> std::io::Result<()> { let file_name = format!("{}/bluetooth{}.pid", PID_DIR, self.adapter_index); let file_name = format!("{}/bluetooth{}.pid", PID_DIR, self.virt_index); let mut f = File::create(&file_name)?; f.write_all(process::id().to_string().as_bytes())?; Ok(()) Loading @@ -1055,7 +1055,7 @@ impl Bluetooth { /// Removes the file to notify btmanagerd the adapter is disabled. fn remove_pid_file(&self) -> std::io::Result<()> { let file_name = format!("{}/bluetooth{}.pid", PID_DIR, self.adapter_index); let file_name = format!("{}/bluetooth{}.pid", PID_DIR, self.virt_index); std::fs::remove_file(&file_name)?; Ok(()) } Loading