1 /* 2 * Copyright (C) 2024 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 #include <aidl/android/hardware/audio/core/BnStreamIn.h> 18 19 using namespace aidl::android::hardware::audio::common; 20 using namespace aidl::android::hardware::audio::core; 21 using namespace aidl::android::media::audio::common; 22 23 namespace aidl::android::hardware::audio::core { 24 25 class StreamInMock : public BnStreamIn { 26 ndk::ScopedAStatus getStreamCommon(std::shared_ptr<IStreamCommon>* _aidl_return) override; 27 ndk::ScopedAStatus getMicrophoneDirection( 28 IStreamIn::MicrophoneDirection* _aidl_return) override; 29 ndk::ScopedAStatus setMicrophoneDirection(IStreamIn::MicrophoneDirection in_direction) override; 30 ndk::ScopedAStatus getMicrophoneFieldDimension(float* _aidl_return) override; 31 ndk::ScopedAStatus setMicrophoneFieldDimension(float in_zoom) override; 32 ndk::ScopedAStatus getHwGain(std::vector<float>* _aidl_return) override; 33 ndk::ScopedAStatus setHwGain(const std::vector<float>& in_channelGains) override; 34 getActiveMicrophones(std::vector<MicrophoneDynamicInfo> *)35 ndk::ScopedAStatus getActiveMicrophones(std::vector<MicrophoneDynamicInfo>*) override { 36 return ndk::ScopedAStatus::ok(); 37 } updateMetadata(const SinkMetadata &)38 ndk::ScopedAStatus updateMetadata(const SinkMetadata&) override { 39 return ndk::ScopedAStatus::ok(); 40 } 41 42 private: 43 IStreamIn::MicrophoneDirection mMicrophoneDirection; 44 float mMicrophoneFieldDimension; 45 std::vector<float> mHwGains; 46 std::shared_ptr<IStreamCommon> mStreamCommon; 47 }; 48 49 } // namespace aidl::android::hardware::audio::core 50