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

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

Merge "floss: client: Remove generics from CommandHandler"

parents 26076b50 dd0a6a30
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ use std::sync::{Arc, Mutex};

use crate::console_yellow;
use crate::print_info;
use crate::{BluetoothDBus, BluetoothManagerDBus};

struct BtCallback {
    objpath: String,
@@ -60,26 +61,24 @@ impl RPCProxy for BtCallback {
}

/// Handles string command entered from command line.
pub struct CommandHandler<TBluetoothManager: IBluetoothManager, TBluetooth: IBluetooth> {
    bluetooth_manager: Arc<Mutex<Box<TBluetoothManager>>>,
    bluetooth: Arc<Mutex<Box<TBluetooth>>>,
pub(crate) struct CommandHandler {
    bluetooth_manager: Arc<Mutex<Box<BluetoothManagerDBus>>>,
    bluetooth: Arc<Mutex<Box<BluetoothDBus>>>,

    is_bluetooth_callback_registered: bool,

    commands: Vec<String>,
}

impl<TBluetoothManager: IBluetoothManager, TBluetooth: IBluetooth>
    CommandHandler<TBluetoothManager, TBluetooth>
{
impl CommandHandler {
    /// Creates a new CommandHandler.
    ///
    /// * `commands` - List of commands for `help`.
    pub fn new(
        bluetooth_manager: Arc<Mutex<Box<TBluetoothManager>>>,
        bluetooth: Arc<Mutex<Box<TBluetooth>>>,
        bluetooth_manager: Arc<Mutex<Box<BluetoothManagerDBus>>>,
        bluetooth: Arc<Mutex<Box<BluetoothDBus>>>,
        commands: Vec<String>,
    ) -> CommandHandler<TBluetoothManager, TBluetooth> {
    ) -> CommandHandler {
        CommandHandler {
            bluetooth_manager,
            bluetooth,