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

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

Floss: Set the default event mask for Classic and LE Topshim API

Bug: 230099013
Test: mma -j $(nproc)
Test: ./build.py
Tag: #floss
Change-Id: I2c33699ed60b1c0a64892081a7689228d9724e17
parent 7a800591
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ service AdapterService {
  rpc ClearFilterAcceptList(google.protobuf.Empty) returns (google.protobuf.Empty) {}
  rpc DisconnectAllAcls(google.protobuf.Empty) returns (google.protobuf.Empty) {}
  rpc LeRand(google.protobuf.Empty) returns (google.protobuf.Empty) {}
  rpc SetDefaultEventMask(google.protobuf.Empty) returns (google.protobuf.Empty) {}
  rpc SetEventFilterInquiryResultAllDevices(google.protobuf.Empty) returns (google.protobuf.Empty) {}
}

+3 −0
Original line number Diff line number Diff line
@@ -80,6 +80,9 @@ class AdapterAutomationHelper():
    async def le_rand(self):
        await self.adapter_stub.LeRand(empty_proto.Empty())

    async def set_default_event_mask(self):
        await self.adapter_stub.SetDefaultEventMask(empty_proto.Empty())

    async def set_event_filter_inquiry_result_all_devices(self):
        await self.adapter_stub.SetEventFilterInquiryResultAllDevices(empty_proto.Empty())

+7 −0
Original line number Diff line number Diff line
@@ -166,6 +166,13 @@ impl AdapterService for AdapterServiceImpl {
        })
    }

    fn set_default_event_mask(&mut self, ctx: RpcContext<'_>, _req: Empty, sink: UnarySink<Empty>) {
        self.btif_intf.lock().unwrap().set_default_event_mask();
        ctx.spawn(async move {
            sink.success(Empty::default()).await.unwrap();
        })
    }

    fn set_event_filter_inquiry_result_all_devices(
        &mut self,
        ctx: RpcContext<'_>,
+4 −0
Original line number Diff line number Diff line
@@ -1036,6 +1036,10 @@ impl BluetoothInterface {
        ccall!(self, le_rand)
    }

    pub fn set_default_event_mask(&self) -> i32 {
        ccall!(self, set_default_event_mask)
    }

    pub fn set_event_filter_inquiry_result_all_devices(&self) -> i32 {
        ccall!(self, set_event_filter_inquiry_result_all_devices)
    }