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

Commit a7b82e64 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Floss: Boilerplate HFP topshim

Tag: #floss
Bug: 195344796
Test: cert/run
Change-Id: If4861e87864128d40cbe95a9ddcde4a215df41be
parent bfdadcb3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ cc_library_static {
        "btav_sink/btav_sink_shim.cc",
        "btif/btif_shim.cc",
        "gatt/gatt_shim.cc",
        "hfp/hfp_shim.cc",
    ],
    generated_headers: ["libbt_topshim_bridge_header", "cxx-bridge-header"],
    generated_sources: ["libbt_topshim_bridge_code"],
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "hfp/hfp_shim.h"

#include "btif/include/btif_hf.h"

namespace bluetooth {
namespace topshim {
namespace rust {

int HfpIntf::init() {
  intf_->Init(nullptr, 1, false);
  return 0;
}

void HfpIntf::cleanup() {}

}  // namespace rust
}  // namespace topshim
}  // namespace bluetooth
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include "btif/include/btif_hf.h"

namespace bluetooth {
namespace topshim {
namespace rust {

class HfpIntf {
 public:
  // interface for Settings
  int init();
  void cleanup();

 private:
  bluetooth::headset::Interface* intf_ = nullptr;
};

std::unique_ptr<HfpIntf> GetHfpProfile();

}  // namespace rust
}  // namespace topshim
}  // namespace bluetooth