• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include "core-impl/Bluetooth.h"
20 #include "core-impl/Module.h"
21 
22 namespace aidl::android::hardware::audio::core {
23 
24 class ModuleBluetooth final : public Module {
25   public:
ModuleBluetooth()26     ModuleBluetooth() : Module(Type::BLUETOOTH) {}
27 
28   private:
29     BtProfileHandles getBtProfileManagerHandles() override;
30 
31     ndk::ScopedAStatus getBluetoothA2dp(std::shared_ptr<IBluetoothA2dp>* _aidl_return) override;
32     ndk::ScopedAStatus getBluetoothLe(std::shared_ptr<IBluetoothLe>* _aidl_return) override;
33     ndk::ScopedAStatus getMicMute(bool* _aidl_return) override;
34     ndk::ScopedAStatus setMicMute(bool in_mute) override;
35 
36     ndk::ScopedAStatus createInputStream(
37             StreamContext&& context,
38             const ::aidl::android::hardware::audio::common::SinkMetadata& sinkMetadata,
39             const std::vector<::aidl::android::media::audio::common::MicrophoneInfo>& microphones,
40             std::shared_ptr<StreamIn>* result) override;
41     ndk::ScopedAStatus createOutputStream(
42             StreamContext&& context,
43             const ::aidl::android::hardware::audio::common::SourceMetadata& sourceMetadata,
44             const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
45                     offloadInfo,
46             std::shared_ptr<StreamOut>* result) override;
47     ndk::ScopedAStatus onMasterMuteChanged(bool mute) override;
48     ndk::ScopedAStatus onMasterVolumeChanged(float volume) override;
49 
50     ChildInterface<IBluetoothA2dp> mBluetoothA2dp;
51     ChildInterface<IBluetoothLe> mBluetoothLe;
52 };
53 
54 }  // namespace aidl::android::hardware::audio::core