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

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

Floss: Refactor btmanagerd's RPCProxy

Use btstack's RPCProxy instead of duplicating it.

Bug: 200732080
Tag: #floss
Test: Manual - build Floss with build.py

Change-Id: Id8e1691d4d5907832ba16be9f0cd5a154c71d48c
parent 5c0f70fa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ impl IBluetoothManagerCallback for BtManagerCallback {
    }
}

impl manager_service::RPCProxy for BtManagerCallback {
impl RPCProxy for BtManagerCallback {
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }
+6 −5
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ use btstack::bluetooth_gatt::{
    GattWriteRequestStatus, GattWriteType, IBluetoothGatt, IBluetoothGattCallback,
    IScannerCallback, LePhy, ScanFilter, ScanSettings,
};
use btstack::RPCProxy;

use btstack::suspend::{ISuspend, ISuspendCallback, SuspendType};

@@ -152,7 +153,7 @@ impl ClientDBusProxy {
#[allow(dead_code)]
struct IBluetoothCallbackDBus {}

impl btstack::RPCProxy for IBluetoothCallbackDBus {
impl RPCProxy for IBluetoothCallbackDBus {
    // Dummy implementations just to satisfy impl RPCProxy requirements.
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
@@ -206,7 +207,7 @@ impl IBluetoothCallback for IBluetoothCallbackDBus {
#[allow(dead_code)]
struct IBluetoothConnectionCallbackDBus {}

impl btstack::RPCProxy for IBluetoothConnectionCallbackDBus {
impl RPCProxy for IBluetoothConnectionCallbackDBus {
    // Dummy implementations just to satisfy impl RPCProxy requirements.
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
@@ -524,7 +525,7 @@ impl IBluetoothManager for BluetoothManagerDBus {
#[allow(dead_code)]
struct IBluetoothManagerCallbackDBus {}

impl manager_service::RPCProxy for IBluetoothManagerCallbackDBus {
impl RPCProxy for IBluetoothManagerCallbackDBus {
    // Placeholder implementations just to satisfy impl RPCProxy requirements.
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
@@ -742,7 +743,7 @@ impl IBluetoothGatt for BluetoothGattDBus {
#[allow(dead_code)]
struct IBluetoothGattCallbackDBus {}

impl btstack::RPCProxy for IBluetoothGattCallbackDBus {
impl RPCProxy for IBluetoothGattCallbackDBus {
    // Placeholder implementations just to satisfy impl RPCProxy requirements.
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
@@ -865,7 +866,7 @@ impl ISuspend for SuspendDBus {
#[allow(dead_code)]
struct ISuspendCallbackDBus {}

impl btstack::RPCProxy for ISuspendCallbackDBus {
impl RPCProxy for ISuspendCallbackDBus {
    // Placeholder implementations just to satisfy impl RPCProxy requirements.
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
btstack = { path = "../stack" }

# bt deps
bt_common = { path = "../../common" }
+1 −1
Original line number Diff line number Diff line
@@ -3,10 +3,10 @@ use dbus::strings::Path;
use dbus_macros::{dbus_method, dbus_propmap, dbus_proxy_obj, generate_dbus_exporter};
use dbus_projection::{dbus_generated, DisconnectWatcher};

use btstack::RPCProxy;
use manager_service::iface_bluetooth_manager::{
    AdapterWithEnabled, IBluetoothManager, IBluetoothManagerCallback,
};
use manager_service::RPCProxy;

use crate::dbus_arg::{DBusArg, DBusArgError, RefArgToRust};

+1 −1
Original line number Diff line number Diff line
use crate::RPCProxy;
use btstack::RPCProxy;

#[derive(Debug, Default)]
pub struct AdapterWithEnabled {
Loading