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

Commit 810f5f81 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

GD Security Facade: Add CreateBondLe

Bug: 155399771
Test: cert/run --host  --test_filter=LeSecurityTest
Change-Id: Ie08f6013d9fa21ef513e2248f3226de6df031693
parent 03d12cf9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -43,6 +43,15 @@ class SecurityModuleFacadeService : public SecurityModuleFacade::Service, public
    return ::grpc::Status::OK;
  }

  ::grpc::Status CreateBondLe(::grpc::ServerContext* context, const facade::BluetoothAddressWithType* request,
                              ::google::protobuf::Empty* response) override {
    hci::Address peer;
    ASSERT(hci::Address::FromString(request->address().address(), peer));
    hci::AddressType peer_type = static_cast<hci::AddressType>(request->type());
    security_module_->GetSecurityManager()->CreateBondLe(hci::AddressWithType(peer, peer_type));
    return ::grpc::Status::OK;
  }

  ::grpc::Status CancelBond(::grpc::ServerContext* context, const facade::BluetoothAddressWithType* request,
                            ::google::protobuf::Empty* response) override {
    hci::Address peer;
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ import "facade/common.proto";

service SecurityModuleFacade {
  rpc CreateBond(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
  rpc CreateBondLe(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
  rpc CancelBond(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
  rpc RemoveBond(facade.BluetoothAddressWithType) returns (google.protobuf.Empty) {}
  rpc SetIoCapability(IoCapabilityMessage) returns (google.protobuf.Empty) {}