1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 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 16 #ifndef OHOS_MOCK_AUDIO_DATA_CHANNEL_H 17 #define OHOS_MOCK_AUDIO_DATA_CHANNEL_H 18 19 #include <memory> 20 #include <string> 21 22 #include "iaudio_channel_listener.h" 23 #include "iaudio_channel.h" 24 25 namespace OHOS { 26 namespace DistributedHardware { 27 class MockAudioDataChannel : public IAudioChannel { 28 public: MockAudioDataChannel(std::string peerDevId)29 explicit MockAudioDataChannel(std::string peerDevId) : peerDevId_(peerDevId) {} ~MockAudioDataChannel()30 ~MockAudioDataChannel() {} 31 CreateSession(const std::shared_ptr<IAudioChannelListener> & listener,const std::string & sessionName)32 int32_t CreateSession(const std::shared_ptr<IAudioChannelListener> &listener, 33 const std::string &sessionName) override 34 { 35 return DH_SUCCESS; 36 } 37 ReleaseSession()38 int32_t ReleaseSession() override 39 { 40 return DH_SUCCESS; 41 } 42 OpenSession()43 int32_t OpenSession() override 44 { 45 return DH_SUCCESS; 46 } 47 CloseSession()48 int32_t CloseSession() override 49 { 50 return DH_SUCCESS; 51 } 52 SendData(const std::shared_ptr<AudioData> & audioData)53 int32_t SendData(const std::shared_ptr<AudioData> &audioData) override 54 { 55 return DH_SUCCESS; 56 } 57 SendEvent(const AudioEvent & audioEvent)58 int32_t SendEvent(const AudioEvent &audioEvent) override 59 { 60 return DH_SUCCESS; 61 } 62 63 private: 64 const std::string peerDevId_; 65 }; 66 } // namespace DistributedHardware 67 } // namespace OHOS 68 #endif // OHOS_MOCK_AUDIO_DATA_CHANNEL_H 69