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

Commit 43cb7956 authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Automerger Merge Worker
Browse files

Merge "Floss: Provide default implementations for RPCProxy" am: 3ef3c3d7 am:...

Merge "Floss: Provide default implementations for RPCProxy" am: 3ef3c3d7 am: 12738a12 am: d2562e4b

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2185063



Change-Id: Id1548a80410cd71b23561cc7844d3d6006b7e901
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6bea2fd9 d2562e4b
Loading
Loading
Loading
Loading
+0 −48
Original line number Original line Diff line number Diff line
@@ -59,18 +59,10 @@ impl IBluetoothManagerCallback for BtManagerCallback {
}
}


impl RPCProxy for BtManagerCallback {
impl RPCProxy for BtManagerCallback {
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }

    fn get_object_id(&self) -> String {
    fn get_object_id(&self) -> String {
        self.objpath.clone()
        self.objpath.clone()
    }
    }


    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {
    fn export_for_rpc(self: Box<Self>) {
        let cr = self.dbus_crossroads.clone();
        let cr = self.dbus_crossroads.clone();
        let iface = export_bluetooth_manager_callback_dbus_intf(
        let iface = export_bluetooth_manager_callback_dbus_intf(
@@ -227,18 +219,10 @@ impl IBluetoothCallback for BtCallback {
}
}


impl RPCProxy for BtCallback {
impl RPCProxy for BtCallback {
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }

    fn get_object_id(&self) -> String {
    fn get_object_id(&self) -> String {
        self.objpath.clone()
        self.objpath.clone()
    }
    }


    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {
    fn export_for_rpc(self: Box<Self>) {
        let cr = self.dbus_crossroads.clone();
        let cr = self.dbus_crossroads.clone();
        let iface = export_bluetooth_callback_dbus_intf(
        let iface = export_bluetooth_callback_dbus_intf(
@@ -280,18 +264,10 @@ impl IBluetoothConnectionCallback for BtConnectionCallback {
}
}


impl RPCProxy for BtConnectionCallback {
impl RPCProxy for BtConnectionCallback {
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }

    fn get_object_id(&self) -> String {
    fn get_object_id(&self) -> String {
        self.objpath.clone()
        self.objpath.clone()
    }
    }


    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {
    fn export_for_rpc(self: Box<Self>) {
        let cr = self.dbus_crossroads.clone();
        let cr = self.dbus_crossroads.clone();
        let iface = export_bluetooth_connection_callback_dbus_intf(
        let iface = export_bluetooth_connection_callback_dbus_intf(
@@ -338,18 +314,10 @@ impl IScannerCallback for ScannerCallback {
}
}


impl RPCProxy for ScannerCallback {
impl RPCProxy for ScannerCallback {
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }

    fn get_object_id(&self) -> String {
    fn get_object_id(&self) -> String {
        self.objpath.clone()
        self.objpath.clone()
    }
    }


    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {
    fn export_for_rpc(self: Box<Self>) {
        let cr = self.dbus_crossroads.clone();
        let cr = self.dbus_crossroads.clone();
        let iface = export_scanner_callback_dbus_intf(
        let iface = export_scanner_callback_dbus_intf(
@@ -509,18 +477,10 @@ impl IBluetoothGattCallback for BtGattCallback {
}
}


impl RPCProxy for BtGattCallback {
impl RPCProxy for BtGattCallback {
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }

    fn get_object_id(&self) -> String {
    fn get_object_id(&self) -> String {
        self.objpath.clone()
        self.objpath.clone()
    }
    }


    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {
    fn export_for_rpc(self: Box<Self>) {
        let cr = self.dbus_crossroads.clone();
        let cr = self.dbus_crossroads.clone();
        let iface = export_bluetooth_gatt_callback_dbus_intf(
        let iface = export_bluetooth_gatt_callback_dbus_intf(
@@ -559,18 +519,10 @@ impl ISuspendCallback for SuspendCallback {
}
}


impl RPCProxy for SuspendCallback {
impl RPCProxy for SuspendCallback {
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }

    fn get_object_id(&self) -> String {
    fn get_object_id(&self) -> String {
        self.objpath.clone()
        self.objpath.clone()
    }
    }


    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {
    fn export_for_rpc(self: Box<Self>) {
        let cr = self.dbus_crossroads.clone();
        let cr = self.dbus_crossroads.clone();
        let iface = export_suspend_callback_dbus_intf(
        let iface = export_suspend_callback_dbus_intf(
+7 −105
Original line number Original line Diff line number Diff line
@@ -127,22 +127,7 @@ pub struct BluetoothDeviceDBus {


struct IBluetoothCallbackDBus {}
struct IBluetoothCallbackDBus {}


impl 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
    }

    fn get_object_id(&self) -> String {
        String::from("")
    }

    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {}
}


#[generate_dbus_exporter(
#[generate_dbus_exporter(
    export_bluetooth_callback_dbus_intf,
    export_bluetooth_callback_dbus_intf,
@@ -186,22 +171,7 @@ impl IBluetoothCallback for IBluetoothCallbackDBus {


struct IBluetoothConnectionCallbackDBus {}
struct IBluetoothConnectionCallbackDBus {}


impl 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
    }

    fn get_object_id(&self) -> String {
        String::from("")
    }

    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {}
}


#[generate_dbus_exporter(
#[generate_dbus_exporter(
    export_bluetooth_connection_callback_dbus_intf,
    export_bluetooth_connection_callback_dbus_intf,
@@ -217,18 +187,7 @@ impl IBluetoothConnectionCallback for IBluetoothConnectionCallbackDBus {


struct IScannerCallbackDBus {}
struct IScannerCallbackDBus {}


impl RPCProxy for IScannerCallbackDBus {
impl RPCProxy for IScannerCallbackDBus {}
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }
    fn get_object_id(&self) -> String {
        String::from("")
    }
    fn unregister(&mut self, _id: u32) -> bool {
        false
    }
    fn export_for_rpc(self: Box<Self>) {}
}


#[generate_dbus_exporter(
#[generate_dbus_exporter(
    export_scanner_callback_dbus_intf,
    export_scanner_callback_dbus_intf,
@@ -554,22 +513,7 @@ impl IBluetoothManager for BluetoothManagerDBus {


struct IBluetoothManagerCallbackDBus {}
struct IBluetoothManagerCallbackDBus {}


impl 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
    }

    fn get_object_id(&self) -> String {
        String::from("")
    }

    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {}
}


#[generate_dbus_exporter(
#[generate_dbus_exporter(
    export_bluetooth_manager_callback_dbus_intf,
    export_bluetooth_manager_callback_dbus_intf,
@@ -1023,22 +967,7 @@ impl IBluetoothGatt for BluetoothGattDBus {


struct IBluetoothGattCallbackDBus {}
struct IBluetoothGattCallbackDBus {}


impl 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
    }

    fn get_object_id(&self) -> String {
        String::from("")
    }

    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {}
}


#[generate_dbus_exporter(
#[generate_dbus_exporter(
    export_bluetooth_gatt_callback_dbus_intf,
    export_bluetooth_gatt_callback_dbus_intf,
@@ -1246,19 +1175,7 @@ impl IBluetoothSocketManager for BluetoothSocketManagerDBus {


struct IBluetoothSocketManagerCallbacksDBus {}
struct IBluetoothSocketManagerCallbacksDBus {}


impl RPCProxy for IBluetoothSocketManagerCallbacksDBus {
impl RPCProxy for IBluetoothSocketManagerCallbacksDBus {}
    // Placeholder implementations just to satisfy impl RPCProxy requirements.
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }
    fn get_object_id(&self) -> String {
        String::from("")
    }
    fn unregister(&mut self, _id: u32) -> bool {
        false
    }
    fn export_for_rpc(self: Box<Self>) {}
}


#[generate_dbus_exporter(export_socket_callback_dbus_intf, "org.chromium.bluetooth.SocketCallback")]
#[generate_dbus_exporter(export_socket_callback_dbus_intf, "org.chromium.bluetooth.SocketCallback")]
impl IBluetoothSocketManagerCallbacks for IBluetoothSocketManagerCallbacksDBus {
impl IBluetoothSocketManagerCallbacks for IBluetoothSocketManagerCallbacksDBus {
@@ -1334,22 +1251,7 @@ impl ISuspend for SuspendDBus {


struct ISuspendCallbackDBus {}
struct ISuspendCallbackDBus {}


impl 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
    }

    fn get_object_id(&self) -> String {
        String::from("")
    }

    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {}
}


#[generate_dbus_exporter(
#[generate_dbus_exporter(
    export_suspend_callback_dbus_intf,
    export_suspend_callback_dbus_intf,
+1 −9
Original line number Original line Diff line number Diff line
@@ -774,14 +774,7 @@ pub fn dbus_proxy_obj(attr: TokenStream, item: TokenStream) -> TokenStream {
    let gen = quote! {
    let gen = quote! {
        #ori_item
        #ori_item


        impl RPCProxy for #self_ty {
        impl RPCProxy for #self_ty {}
            fn register_disconnect(&mut self, _disconnect_callback: Box<dyn Fn(u32) + Send>) -> u32 { 0 }
            fn get_object_id(&self) -> String {
                String::from("")
            }
            fn unregister(&mut self, _id: u32) -> bool { false }
            fn export_for_rpc(self: Box<Self>) {}
        }


        struct #struct_ident {
        struct #struct_ident {
            conn: std::sync::Arc<dbus::nonblock::SyncConnection>,
            conn: std::sync::Arc<dbus::nonblock::SyncConnection>,
@@ -806,7 +799,6 @@ pub fn dbus_proxy_obj(attr: TokenStream, item: TokenStream) -> TokenStream {
            fn unregister(&mut self, id: u32) -> bool {
            fn unregister(&mut self, id: u32) -> bool {
                self.disconnect_watcher.lock().unwrap().remove(self.remote.clone(), id)
                self.disconnect_watcher.lock().unwrap().remove(self.remote.clone(), id)
            }
            }
            fn export_for_rpc(self: Box<Self>) {}
        }
        }


        impl DBusArg for Box<dyn #trait_ + Send> {
        impl DBusArg for Box<dyn #trait_ + Send> {
+1 −13
Original line number Original line Diff line number Diff line
@@ -55,19 +55,7 @@ impl ISuspend for SuspendDBus {
#[allow(dead_code)]
#[allow(dead_code)]
struct ISuspendCallbackDBus {}
struct ISuspendCallbackDBus {}


impl 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
    }
    fn get_object_id(&self) -> String {
        String::from("")
    }
    fn unregister(&mut self, _id: u32) -> bool {
        false
    }
    fn export_for_rpc(self: Box<Self>) {}
}


#[generate_dbus_exporter(
#[generate_dbus_exporter(
    export_suspend_callback_dbus_intf,
    export_suspend_callback_dbus_intf,
+0 −8
Original line number Original line Diff line number Diff line
@@ -144,18 +144,10 @@ impl ISuspendCallback for SuspendCallback {
}
}


impl RPCProxy for SuspendCallback {
impl RPCProxy for SuspendCallback {
    fn register_disconnect(&mut self, _f: Box<dyn Fn(u32) + Send>) -> u32 {
        0
    }

    fn get_object_id(&self) -> String {
    fn get_object_id(&self) -> String {
        self.objpath.clone()
        self.objpath.clone()
    }
    }


    fn unregister(&mut self, _id: u32) -> bool {
        false
    }

    fn export_for_rpc(self: Box<Self>) {
    fn export_for_rpc(self: Box<Self>) {
        let cr = self.dbus_crossroads.clone();
        let cr = self.dbus_crossroads.clone();
        let iface = export_suspend_callback_dbus_intf(
        let iface = export_suspend_callback_dbus_intf(
Loading