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

Commit a1b0a09d authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

Floss: Boilerplate HFP topshim am: a7b82e64 am: 68003717

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1783999

Change-Id: I3d571d1469515bd4a5ab311f2bc19b00e1df1cdc
parents ece2c24a 68003717
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