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

Commit dd0a6a30 authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

floss: client: Remove generics from CommandHandler

The generic types are no longer needed since we only support D-Bus mode
and not embedded mode anymore.

Bug: 188718349
Tag: Floss
Test: Build floss on Linux

Change-Id: I74e800ab5608a2a4cc78332f6af3e60d627d6683
parent 22736c01
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,