1 // Copyright (C) 2020 The Android Open Source Project 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #include "BusDeviceProvider.h" 18 #include "DevicesFactoryImpl.h" 19 20 // clang-format off 21 #include PATH(device/google/atv/audio_proxy/AUDIO_PROXY_FILE_VERSION/IAudioProxyDevicesManager.h) 22 // clang-format on 23 24 using ::android::sp; 25 using ::android::wp; 26 using ::android::hardware::hidl_string; 27 using ::android::hardware::Return; 28 using ::device::google::atv::audio_proxy::AUDIO_PROXY_CPP_VERSION:: 29 IAudioProxyDevicesManager; 30 31 namespace audio_proxy { 32 namespace service { 33 34 class AudioProxyDevicesManagerImpl : public IAudioProxyDevicesManager { 35 public: 36 AudioProxyDevicesManagerImpl(); 37 ~AudioProxyDevicesManagerImpl() override; 38 39 Return<bool> registerDevice( 40 const hidl_string& address, 41 const sp<::device::google::atv::audio_proxy::CPP_VERSION::IBusDevice>& 42 device) override; 43 44 private: 45 bool ensureDevicesFactory(); 46 47 BusDeviceProvider mBusDeviceProvider; 48 wp<DevicesFactoryImpl> mDevicesFactory; 49 }; 50 51 } // namespace service 52 } // namespace audio_proxy 53