AudioPolicyTestClient.h 4.9 KB

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