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 getAudioPolicyConfig(media::AudioPolicyConfig *)28 status_t getAudioPolicyConfig(media::AudioPolicyConfig* /*config*/) override { 29 return INVALID_OPERATION; 30 } loadHwModule(const char *)31 audio_module_handle_t loadHwModule(const char* /*name*/) override { 32 return AUDIO_MODULE_HANDLE_NONE; 33 } openOutput(audio_module_handle_t,audio_io_handle_t *,audio_config_t *,audio_config_base_t *,const sp<DeviceDescriptorBase> &,uint32_t *,audio_output_flags_t)34 status_t openOutput(audio_module_handle_t /*module*/, 35 audio_io_handle_t* /*output*/, 36 audio_config_t* /*halConfig*/, 37 audio_config_base_t* /*mixerConfig*/, 38 const sp<DeviceDescriptorBase>& /*device*/, 39 uint32_t* /*latencyMs*/, 40 audio_output_flags_t /*flags*/) override { return NO_INIT; } openDuplicateOutput(audio_io_handle_t,audio_io_handle_t)41 audio_io_handle_t openDuplicateOutput(audio_io_handle_t /*output1*/, 42 audio_io_handle_t /*output2*/) override { 43 return AUDIO_IO_HANDLE_NONE; 44 } closeOutput(audio_io_handle_t)45 status_t closeOutput(audio_io_handle_t /*output*/) override { return NO_INIT; } suspendOutput(audio_io_handle_t)46 status_t suspendOutput(audio_io_handle_t /*output*/) override { return NO_INIT; } restoreOutput(audio_io_handle_t)47 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)48 status_t openInput(audio_module_handle_t /*module*/, 49 audio_io_handle_t* /*input*/, 50 audio_config_t* /*config*/, 51 audio_devices_t* /*device*/, 52 const String8& /*address*/, 53 audio_source_t /*source*/, 54 audio_input_flags_t /*flags*/) override { return NO_INIT; } closeInput(audio_io_handle_t)55 status_t closeInput(audio_io_handle_t /*input*/) override { return NO_INIT; } setStreamVolume(audio_stream_type_t,float,audio_io_handle_t,int)56 status_t setStreamVolume(audio_stream_type_t /*stream*/, 57 float /*volume*/, 58 audio_io_handle_t /*output*/, 59 int /*delayMs*/) override { return NO_INIT; } setParameters(audio_io_handle_t,const String8 &,int)60 void setParameters(audio_io_handle_t /*ioHandle*/, 61 const String8& /*keyValuePairs*/, 62 int /*delayMs*/) override { } getParameters(audio_io_handle_t,const String8 &)63 String8 getParameters(audio_io_handle_t /*ioHandle*/, 64 const String8& /*keys*/) override { return String8(); } setVoiceVolume(float,int)65 status_t setVoiceVolume(float /*volume*/, int /*delayMs*/) override { return NO_INIT; } moveEffects(audio_session_t,audio_io_handle_t,audio_io_handle_t)66 status_t moveEffects(audio_session_t /*session*/, 67 audio_io_handle_t /*srcOutput*/, 68 audio_io_handle_t /*dstOutput*/) override { return NO_INIT; } createAudioPatch(const struct audio_patch *,audio_patch_handle_t *,int)69 status_t createAudioPatch(const struct audio_patch* /*patch*/, 70 audio_patch_handle_t* /*handle*/, 71 int /*delayMs*/) override { return NO_INIT; } releaseAudioPatch(audio_patch_handle_t,int)72 status_t releaseAudioPatch(audio_patch_handle_t /*handle*/, 73 int /*delayMs*/) override { return NO_INIT; } setAudioPortConfig(const struct audio_port_config *,int)74 status_t setAudioPortConfig(const struct audio_port_config* /*config*/, 75 int /*delayMs*/) override { return NO_INIT; } onAudioPortListUpdate()76 void onAudioPortListUpdate() override { } onAudioPatchListUpdate()77 void onAudioPatchListUpdate() override { } onAudioVolumeGroupChanged(volume_group_t,int)78 void onAudioVolumeGroupChanged(volume_group_t /*group*/, int /*flags*/) override { } newAudioUniqueId(audio_unique_id_use_t)79 audio_unique_id_t newAudioUniqueId(audio_unique_id_use_t /*use*/) override { return 0; } onDynamicPolicyMixStateUpdate(String8,int32_t)80 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)81 void onRecordingConfigurationUpdate(int event __unused, 82 const record_client_info_t *clientInfo __unused, 83 const audio_config_base_t *clientConfig __unused, 84 std::vector<effect_descriptor_t> clientEffects __unused, 85 const audio_config_base_t *deviceConfig __unused, 86 std::vector<effect_descriptor_t> effects __unused, 87 audio_patch_handle_t patchHandle __unused, 88 audio_source_t source __unused) override { } onRoutingUpdated()89 void onRoutingUpdated() override { } onVolumeRangeInitRequest()90 void onVolumeRangeInitRequest() override { } setEffectSuspended(int effectId __unused,audio_session_t sessionId __unused,bool suspended __unused)91 void setEffectSuspended(int effectId __unused, 92 audio_session_t sessionId __unused, 93 bool suspended __unused) {} setSoundTriggerCaptureState(bool active __unused)94 void setSoundTriggerCaptureState(bool active __unused) override {}; getAudioPort(struct audio_port_v7 * port __unused)95 status_t getAudioPort(struct audio_port_v7 *port __unused) override { 96 return INVALID_OPERATION; 97 }; updateSecondaryOutputs(const TrackSecondaryOutputsMap & trackSecondaryOutputs __unused)98 status_t updateSecondaryOutputs( 99 const TrackSecondaryOutputsMap& trackSecondaryOutputs __unused) override { 100 return NO_INIT; 101 } setDeviceConnectedState(const struct audio_port_v7 * port __unused,media::DeviceConnectedState state __unused)102 status_t setDeviceConnectedState(const struct audio_port_v7 *port __unused, 103 media::DeviceConnectedState state __unused) override { 104 return NO_INIT; 105 } invalidateTracks(const std::vector<audio_port_handle_t> &)106 status_t invalidateTracks(const std::vector<audio_port_handle_t>& /*portIds*/) override { 107 return NO_INIT; 108 } getAudioMixPort(const struct audio_port_v7 * devicePort __unused,struct audio_port_v7 * mixPort __unused)109 status_t getAudioMixPort(const struct audio_port_v7 *devicePort __unused, 110 struct audio_port_v7 *mixPort __unused) override { 111 return INVALID_OPERATION; 112 } 113 setTracksInternalMute(const std::vector<media::TrackInternalMuteInfo> &)114 status_t setTracksInternalMute( 115 const std::vector<media::TrackInternalMuteInfo>& /*tracksInternalMute*/) override { 116 return INVALID_OPERATION; 117 } 118 }; 119 120 } // namespace android 121