Shunkai Yao | 5120250 | 2022-12-12 06:11:46 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2022 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 | #define LOG_TAG "DeviceHalAidl" |
| 18 | |
| 19 | #include "DeviceHalAidl.h" |
| 20 | |
| 21 | status_t DeviceHalAidl::getSupportedDevices(uint32_t* devices) { |
| 22 | ALOGE("%s not implemented yet devices %p", __func__, devices); |
| 23 | return OK; |
| 24 | } |
| 25 | |
| 26 | status_t DeviceHalAidl::initCheck() { |
| 27 | ALOGE("%s not implemented yet", __func__); |
| 28 | return OK; |
| 29 | } |
| 30 | |
| 31 | status_t DeviceHalAidl::setVoiceVolume(float volume) { |
| 32 | mVoiceVolume = volume; |
| 33 | ALOGE("%s not implemented yet %f", __func__, volume); |
| 34 | return OK; |
| 35 | } |
| 36 | |
| 37 | status_t DeviceHalAidl::setMasterVolume(float volume) { |
| 38 | mMasterVolume = volume; |
| 39 | ALOGE("%s not implemented yet %f", __func__, volume); |
| 40 | return OK; |
| 41 | } |
| 42 | |
| 43 | status_t DeviceHalAidl::getMasterVolume(float *volume) { |
| 44 | *volume = mMasterVolume; |
| 45 | ALOGE("%s not implemented yet %f", __func__, *volume); |
| 46 | return OK; |
| 47 | } |
| 48 | |
| 49 | status_t DeviceHalAidl::setMode(audio_mode_t mode) { |
| 50 | ALOGE("%s not implemented yet %u", __func__, mode); |
| 51 | return OK; |
| 52 | } |
| 53 | |
| 54 | status_t DeviceHalAidl::setMicMute(bool state) { |
| 55 | mMicMute = state; |
| 56 | ALOGE("%s not implemented yet %d", __func__, state); |
| 57 | return OK; |
| 58 | } |
| 59 | status_t DeviceHalAidl::getMicMute(bool *state) { |
| 60 | *state = mMicMute; |
| 61 | ALOGE("%s not implemented yet %d", __func__, *state); |
| 62 | return OK; |
| 63 | } |
| 64 | status_t DeviceHalAidl::setMasterMute(bool state) { |
| 65 | mMasterMute = state; |
| 66 | ALOGE("%s not implemented yet %d", __func__, state); |
| 67 | return OK; |
| 68 | } |
| 69 | status_t DeviceHalAidl::getMasterMute(bool *state) { |
| 70 | *state = mMasterMute; |
| 71 | ALOGE("%s not implemented yet %d", __func__, *state); |
| 72 | return OK; |
| 73 | } |
| 74 | |
| 75 | status_t DeviceHalAidl::setParameters(const String8& kvPairs) { |
| 76 | ALOGE("%s not implemented yet %s", __func__, kvPairs.c_str()); |
| 77 | return OK; |
| 78 | } |
| 79 | |
| 80 | status_t DeviceHalAidl::getParameters(const String8& keys, String8 *values) { |
| 81 | ALOGE("%s not implemented yet %s %s", __func__, keys.c_str(), values->c_str()); |
| 82 | return OK; |
| 83 | } |
| 84 | |
| 85 | status_t DeviceHalAidl::getInputBufferSize(const struct audio_config* config, size_t* size) { |
| 86 | ALOGE("%s not implemented yet %p %zu", __func__, config, *size); |
| 87 | return OK; |
| 88 | } |
| 89 | |
| 90 | status_t DeviceHalAidl::openOutputStream(audio_io_handle_t handle, audio_devices_t devices, |
| 91 | audio_output_flags_t flags, struct audio_config* config, |
| 92 | const char* address, |
| 93 | sp<StreamOutHalInterface>* outStream) { |
| 94 | ALOGE("%s not implemented yet %d %u %u %p %s %p", __func__, handle, devices, flags, config, |
| 95 | address, outStream); |
| 96 | return OK; |
| 97 | } |
| 98 | |
| 99 | status_t DeviceHalAidl::openInputStream(audio_io_handle_t handle, audio_devices_t devices, |
| 100 | struct audio_config* config, audio_input_flags_t flags, |
| 101 | const char* address, audio_source_t source, |
| 102 | audio_devices_t outputDevice, |
| 103 | const char* outputDeviceAddress, |
| 104 | sp<StreamInHalInterface>* inStream) { |
| 105 | ALOGE("%s not implemented yet %d %u %u %u %p %s %s %p %d", __func__, handle, devices, |
| 106 | outputDevice, flags, config, address, outputDeviceAddress, inStream, source); |
| 107 | return OK; |
| 108 | } |
| 109 | |
| 110 | status_t DeviceHalAidl::supportsAudioPatches(bool* supportsPatches) { |
| 111 | *supportsPatches = true; |
| 112 | return OK; |
| 113 | } |
| 114 | |
| 115 | status_t DeviceHalAidl::createAudioPatch(unsigned int num_sources, |
| 116 | const struct audio_port_config* sources, |
| 117 | unsigned int num_sinks, |
| 118 | const struct audio_port_config* sinks, |
| 119 | audio_patch_handle_t* patch) { |
| 120 | ALOGE("%s not implemented yet %d %p %d %p %p", __func__, num_sources, sources, num_sinks, |
| 121 | sinks, patch); |
| 122 | return OK; |
| 123 | } |
| 124 | |
| 125 | status_t DeviceHalAidl::releaseAudioPatch(audio_patch_handle_t patch) { |
| 126 | ALOGE("%s not implemented yet patch %d", __func__, patch); |
| 127 | return OK; |
| 128 | } |
| 129 | |
| 130 | status_t DeviceHalAidl::setAudioPortConfig(const struct audio_port_config* config) { |
| 131 | ALOGE("%s not implemented yet config %p", __func__, config); |
| 132 | return OK; |
| 133 | } |
| 134 | |
| 135 | status_t DeviceHalAidl::getMicrophones( |
| 136 | std::vector<audio_microphone_characteristic_t>* microphones) { |
| 137 | ALOGE("%s not implemented yet microphones %p", __func__, microphones); |
| 138 | return OK; |
| 139 | } |
| 140 | |
| 141 | status_t DeviceHalAidl::addDeviceEffect(audio_port_handle_t device, sp<EffectHalInterface> effect) { |
| 142 | if (!effect) { |
| 143 | return BAD_VALUE; |
| 144 | } |
| 145 | ALOGE("%s not implemented yet device %d", __func__, device); |
| 146 | return OK; |
| 147 | } |
| 148 | status_t DeviceHalAidl::removeDeviceEffect(audio_port_handle_t device, |
| 149 | sp<EffectHalInterface> effect) { |
| 150 | if (!effect) { |
| 151 | return BAD_VALUE; |
| 152 | } |
| 153 | ALOGE("%s not implemented yet device %d", __func__, device); |
| 154 | return OK; |
| 155 | } |
| 156 | |
| 157 | status_t DeviceHalAidl::getMmapPolicyInfos( |
| 158 | media::audio::common::AudioMMapPolicyType policyType __unused, |
| 159 | std::vector<media::audio::common::AudioMMapPolicyInfo>* policyInfos __unused) { |
| 160 | ALOGE("%s not implemented yet", __func__); |
| 161 | return OK; |
| 162 | } |
| 163 | |
| 164 | int32_t DeviceHalAidl::getAAudioMixerBurstCount() { |
| 165 | ALOGE("%s not implemented yet", __func__); |
| 166 | return OK; |
| 167 | } |
| 168 | |
| 169 | int32_t DeviceHalAidl::getAAudioHardwareBurstMinUsec() { |
| 170 | ALOGE("%s not implemented yet", __func__); |
| 171 | return OK; |
| 172 | } |
| 173 | |
| 174 | error::Result<audio_hw_sync_t> DeviceHalAidl::getHwAvSync() { |
| 175 | ALOGE("%s not implemented yet", __func__); |
| 176 | return base::unexpected(INVALID_OPERATION); |
| 177 | } |
| 178 | |
| 179 | status_t DeviceHalAidl::dump(int __unused, const Vector<String16>& __unused) { |
| 180 | ALOGE("%s not implemented yet", __func__); |
| 181 | return OK; |
| 182 | }; |
| 183 | |
| 184 | int32_t DeviceHalAidl::supportsBluetoothVariableLatency(bool* supports __unused) override { |
| 185 | ALOGE("%s not implemented yet", __func__); |
| 186 | return INVALID_OPERATION; |
| 187 | } |