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

Commit a53dbe22 authored by Martin Brabham's avatar Martin Brabham
Browse files

Floss: Add GATT interface to suspend module.

Bug: 233128294
Bug: 193686696
Bug: 193686094
Bug: 234029443
Test: mma -j $(nproc)
Test: ./build.py
Test: system/gd/cert/run --clean --topshim
Tag: #floss
Change-Id: I7dcab1defd150b4b9e461e162383548745c08579
parent 501ef411
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -30,11 +30,9 @@ class SuspendTest(TopshimBaseTest):
        await self.dut_adapter.clear_event_mask()
        await self.dut_adapter.clear_event_filter()
        await self.dut_adapter.clear_filter_accept_list()
        await self.dut_adapter.disconnect_all_acls()
        # In the real module it will iterate advertiser ids
        await self.dut_gatt.unregister_advertiser()
        # In the real module it will iterate scanner ids
        await self.dut_gatt.advertising_disable()
        await self.dut_gatt.stop_scan()
        await self.dut_adapter.disconnect_all_acls()
        return await self.dut_adapter.le_rand()

    async def __verify_no_wake_resume(self):
@@ -48,13 +46,12 @@ class SuspendTest(TopshimBaseTest):
        await self.dut_adapter.clear_event_mask()
        await self.dut_adapter.clear_event_filter()
        await self.dut_adapter.clear_filter_accept_list()
        await self.dut_adapter.disconnect_all_acls()
        # In the real module it will iterate advertiser ids
        await self.dut_gatt.unregister_advertiser()
        await self.dut_gatt.advertising_disable()
        await self.dut_gatt.stop_scan()
        if is_a2dp_connected:
            # await self.dut_adapter.disconnect_a2dp()
            # await self.media_server.disconnect_a2dp()
            pass
        await self.dut_adapter.disconnect_all_acls()
        await self.dut_adapter.allow_wake_by_hid()
        return await self.dut_adapter.le_rand()

@@ -67,8 +64,9 @@ class SuspendTest(TopshimBaseTest):
            # restore filter accept list?
            await self.dut_adapter.restore_filter_accept_list()
            # reconnect a2dp
            # await self.dut_adapter.reconnect_last_a2dp()
            # await self.dut_adapter.restart_all_advertising()
            # await self.media_server.reconnect_last_a2dp()
            # await self.gatt.restart_all_previous_advertising()
        await self.dut_gatt.advertising_enable()
        return await self.dut_adapter.le_rand()

    def test_no_wake_suspend(self):
+7 −1
Original line number Diff line number Diff line
@@ -98,7 +98,6 @@ fn main() -> Result<(), Box<dyn Error>> {
    let (tx, rx) = Stack::create_channel();

    let intf = Arc::new(Mutex::new(get_btinterface().unwrap()));
    let suspend = Arc::new(Mutex::new(Box::new(Suspend::new(intf.clone(), tx.clone()))));
    let bluetooth_gatt =
        Arc::new(Mutex::new(Box::new(BluetoothGatt::new(intf.clone(), tx.clone()))));
    let bluetooth_media =
@@ -108,6 +107,13 @@ fn main() -> Result<(), Box<dyn Error>> {
        intf.clone(),
        bluetooth_media.clone(),
    ))));
    let suspend = Arc::new(Mutex::new(Box::new(Suspend::new(
        bluetooth.clone(),
        intf.clone(),
        bluetooth_gatt.clone(),
        tx.clone(),
    ))));

    let bt_sock_mgr =
        Arc::new(Mutex::new(Box::new(BluetoothSocketManager::new(intf.clone(), tx.clone()))));