1 /*
2  * Copyright (C) 2017 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 #pragma once
17 
18 #include "AudioPolicyInterface.h"
19 
20 namespace android {
21 
22 class AudioPolicyTestClient : public AudioPolicyClientInterface
23 {
24 public:
25     virtual ~AudioPolicyTestClient() = default;
26 
27     // AudioPolicyClientInterface Implementation
loadHwModule(const char *)28     audio_module_handle_t loadHwModule(const char* /*name*/) override {
29         return AUDIO_MODULE_HANDLE_NONE;
30     }
openOutput(audio_module_handle_t,audio_io_handle_t *,audio_config_t *,const sp<DeviceDescriptorBase> &,uint32_t *,audio_output_flags_t)31     status_t openOutput(audio_module_handle_t /*module*/,
32                         audio_io_handle_t* /*output*/,
33                         audio_config_t* /*config*/,
34                         const sp<DeviceDescriptorBase>& /*device*/,
35                         uint32_t* /*latencyMs*/,
36                         audio_output_flags_t /*flags*/) override { return NO_INIT; }
openDuplicateOutput(audio_io_handle_t,audio_io_handle_t)37     audio_io_handle_t openDuplicateOutput(audio_io_handle_t /*output1*/,
38                                           audio_io_handle_t /*output2*/) override {
39         return AUDIO_IO_HANDLE_NONE;
40     }
closeOutput(audio_io_handle_t)41     status_t closeOutput(audio_io_handle_t /*output*/) override { return NO_INIT; }
suspendOutput(audio_io_handle_t)42     status_t suspendOutput(audio_io_handle_t /*output*/) override { return NO_INIT; }
restoreOutput(audio_io_handle_t)43     status_t restoreOutput(audio_io_handle_t /*output*/) override { return NO_INIT; }
openInput(audio_module_handle_t,audio_io_handle_t *,audio_config_t *,audio_devices_t *,const String8 &,audio_source_t,audio_input_flags_t)44     status_t openInput(audio_module_handle_t /*module*/,
45                        audio_io_handle_t* /*input*/,
46                        audio_config_t* /*config*/,
47                        audio_devices_t* /*device*/,
48                        const String8& /*address*/,
49                        audio_source_t /*source*/,
50                        audio_input_flags_t /*flags*/) override { return NO_INIT; }
closeInput(audio_io_handle_t)51     status_t closeInput(audio_io_handle_t /*input*/) override { return NO_INIT; }
setStreamVolume(audio_stream_type_t,float,audio_io_handle_t,int)52     status_t setStreamVolume(audio_stream_type_t /*stream*/,
53                              float /*volume*/,
54                              audio_io_handle_t /*output*/,
55                              int /*delayMs*/) override { return NO_INIT; }
invalidateStream(audio_stream_type_t)56     status_t invalidateStream(audio_stream_type_t /*stream*/) override { return NO_INIT; }
setParameters(audio_io_handle_t,const String8 &,int)57     void setParameters(audio_io_handle_t /*ioHandle*/,
58                        const String8& /*keyValuePairs*/,
59                        int /*delayMs*/) override { }
getParameters(audio_io_handle_t,const String8 &)60     String8 getParameters(audio_io_handle_t /*ioHandle*/,
61                           const String8& /*keys*/) override { return String8(); }
setVoiceVolume(float,int)62     status_t setVoiceVolume(float /*volume*/, int /*delayMs*/) override { return NO_INIT; }
moveEffects(audio_session_t,audio_io_handle_t,audio_io_handle_t)63     status_t moveEffects(audio_session_t /*session*/,
64                          audio_io_handle_t /*srcOutput*/,
65                          audio_io_handle_t /*dstOutput*/) override { return NO_INIT; }
createAudioPatch(const struct audio_patch *,audio_patch_handle_t *,int)66     status_t createAudioPatch(const struct audio_patch* /*patch*/,
67                               audio_patch_handle_t* /*handle*/,
68                               int /*delayMs*/) override { return NO_INIT; }
releaseAudioPatch(audio_patch_handle_t,int)69     status_t releaseAudioPatch(audio_patch_handle_t /*handle*/,
70                                int /*delayMs*/) override { return NO_INIT; }
setAudioPortConfig(const struct audio_port_config *,int)71     status_t setAudioPortConfig(const struct audio_port_config* /*config*/,
72                                 int /*delayMs*/) override { return NO_INIT; }
onAudioPortListUpdate()73     void onAudioPortListUpdate() override { }
onAudioPatchListUpdate()74     void onAudioPatchListUpdate() override { }
onAudioVolumeGroupChanged(volume_group_t,int)75     void onAudioVolumeGroupChanged(volume_group_t /*group*/, int /*flags*/) override { }
newAudioUniqueId(audio_unique_id_use_t)76     audio_unique_id_t newAudioUniqueId(audio_unique_id_use_t /*use*/) override { return 0; }
onDynamicPolicyMixStateUpdate(String8,int32_t)77     void onDynamicPolicyMixStateUpdate(String8 /*regId*/, int32_t /*state*/) override { }
onRecordingConfigurationUpdate(int event __unused,const record_client_info_t * clientInfo __unused,const audio_config_base_t * clientConfig __unused,std::vector<effect_descriptor_t> clientEffects __unused,const audio_config_base_t * deviceConfig __unused,std::vector<effect_descriptor_t> effects __unused,audio_patch_handle_t patchHandle __unused,audio_source_t source __unused)78     void onRecordingConfigurationUpdate(int event __unused,
79                                         const record_client_info_t *clientInfo __unused,
80                                         const audio_config_base_t *clientConfig __unused,
81                                         std::vector<effect_descriptor_t> clientEffects __unused,
82                                         const audio_config_base_t *deviceConfig __unused,
83                                         std::vector<effect_descriptor_t> effects __unused,
84                                         audio_patch_handle_t patchHandle __unused,
85                                         audio_source_t source __unused) override { }
setEffectSuspended(int effectId __unused,audio_session_t sessionId __unused,bool suspended __unused)86     void setEffectSuspended(int effectId __unused,
87                             audio_session_t sessionId __unused,
88                             bool suspended __unused) {}
setSoundTriggerCaptureState(bool active __unused)89     void setSoundTriggerCaptureState(bool active __unused) override {};
90 };
91 
92 } // namespace android
93