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

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

Floss: Restore the state of the for the filter accept list Topshim API

Bug: 230097432
Test: mma -j $(nproc)
Test: ./build.py
Tag: #floss
Change-Id: I84c92eb33cb2662e3d1295e5e0b301ac770b0020
parent 4f7ee226
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 RestoreFilterAcceptList(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 restore_filter_accept_list(self):
        await self.adapter_stub.RestoreFilterAcceptList(empty_proto.Empty())

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

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

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

    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 {
+4 −0
Original line number Diff line number Diff line
@@ -1036,6 +1036,10 @@ impl BluetoothInterface {
        ccall!(self, le_rand)
    }

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

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