| Eric Laurent | c2f1f07 | 2009-07-17 12:17:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 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 | #ifndef ANDROID_IAUDIOPOLICYSERVICE_H |
| 18 | #define ANDROID_IAUDIOPOLICYSERVICE_H |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | #include <sys/types.h> |
| 22 | #include <unistd.h> |
| Eric Laurent | c2f1f07 | 2009-07-17 12:17:14 -0700 | [diff] [blame] | 23 | #include <utils/RefBase.h> |
| 24 | #include <utils/Errors.h> |
| 25 | #include <binder/IInterface.h> |
| jiabin | 05b5edd | 2019-11-04 14:10:42 -0800 | [diff] [blame] | 26 | #include <media/AudioDeviceTypeAddr.h> |
| Eric Laurent | c2f1f07 | 2009-07-17 12:17:14 -0700 | [diff] [blame] | 27 | #include <media/AudioSystem.h> |
| Eric Laurent | baac183 | 2014-12-01 17:52:59 -0800 | [diff] [blame] | 28 | #include <media/AudioPolicy.h> |
| Eric Laurent | b52c152 | 2014-05-20 11:27:36 -0700 | [diff] [blame] | 29 | #include <media/IAudioPolicyServiceClient.h> |
| Dima Zavin | 7394a4f | 2011-06-13 18:16:26 -0700 | [diff] [blame] | 30 | #include <system/audio_policy.h> |
| Eric Laurent | b78763e | 2018-10-17 10:08:02 -0700 | [diff] [blame] | 31 | #include <vector> |
| Eric Laurent | c2f1f07 | 2009-07-17 12:17:14 -0700 | [diff] [blame] | 32 | |
| 33 | namespace android { |
| Ytai Ben-Tsvi | 85093d5 | 2020-03-26 09:41:15 -0700 | [diff] [blame] | 34 | namespace media { |
| 35 | // Must be pre-declared, or else there isn't a good way to generate a header |
| 36 | // library. |
| 37 | class ICaptureStateListener; |
| 38 | } |
| Eric Laurent | c2f1f07 | 2009-07-17 12:17:14 -0700 | [diff] [blame] | 39 | |
| 40 | // ---------------------------------------------------------------------------- |
| 41 | |
| 42 | class IAudioPolicyService : public IInterface |
| 43 | { |
| 44 | public: |
| 45 | DECLARE_META_INTERFACE(AudioPolicyService); |
| 46 | |
| 47 | // |
| 48 | // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) |
| 49 | // |
| Mikhail Naganov | 88b30d2 | 2020-03-09 19:43:13 +0000 | [diff] [blame] | 50 | virtual void onNewAudioModulesAvailable() = 0; |
| Dima Zavin | fce7a47 | 2011-04-19 22:30:36 -0700 | [diff] [blame] | 51 | virtual status_t setDeviceConnectionState(audio_devices_t device, |
| 52 | audio_policy_dev_state_t state, |
| Paul McLean | e743a47 | 2015-01-28 11:07:31 -0800 | [diff] [blame] | 53 | const char *device_address, |
| Aniket Kumar Lata | 4e46470 | 2019-01-10 23:38:46 -0800 | [diff] [blame] | 54 | const char *device_name, |
| 55 | audio_format_t encodedFormat) = 0; |
| Dima Zavin | fce7a47 | 2011-04-19 22:30:36 -0700 | [diff] [blame] | 56 | virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, |
| Glenn Kasten | 85ab62c | 2012-11-01 11:11:38 -0700 | [diff] [blame] | 57 | const char *device_address) = 0; |
| Pavlin Radoslavov | f862bc6 | 2016-12-26 18:57:22 -0800 | [diff] [blame] | 58 | virtual status_t handleDeviceConfigChange(audio_devices_t device, |
| 59 | const char *device_address, |
| Aniket Kumar Lata | 4e46470 | 2019-01-10 23:38:46 -0800 | [diff] [blame] | 60 | const char *device_name, |
| 61 | audio_format_t encodedFormat) = 0; |
| Eric Laurent | 00dba06 | 2020-02-11 15:52:09 -0800 | [diff] [blame] | 62 | virtual status_t setPhoneState(audio_mode_t state, uid_t uid) = 0; |
| Glenn Kasten | 85ab62c | 2012-11-01 11:11:38 -0700 | [diff] [blame] | 63 | virtual status_t setForceUse(audio_policy_force_use_t usage, |
| 64 | audio_policy_forced_cfg_t config) = 0; |
| Dima Zavin | fce7a47 | 2011-04-19 22:30:36 -0700 | [diff] [blame] | 65 | virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) = 0; |
| Eric Laurent | f4e6345 | 2017-11-06 19:31:46 +0000 | [diff] [blame] | 66 | virtual audio_io_handle_t getOutput(audio_stream_type_t stream) = 0; |
| Eric Laurent | 4298441 | 2019-05-09 17:57:03 -0700 | [diff] [blame] | 67 | virtual status_t getOutputForAttr(audio_attributes_t *attr, |
| Glenn Kasten | d848eb4 | 2016-03-08 13:42:11 -0800 | [diff] [blame] | 68 | audio_io_handle_t *output, |
| 69 | audio_session_t session, |
| 70 | audio_stream_type_t *stream, |
| Nadav Bar | 766fb02 | 2018-01-07 12:18:03 +0200 | [diff] [blame] | 71 | pid_t pid, |
| Glenn Kasten | d848eb4 | 2016-03-08 13:42:11 -0800 | [diff] [blame] | 72 | uid_t uid, |
| Eric Laurent | 20b9ef0 | 2016-12-05 11:03:16 -0800 | [diff] [blame] | 73 | const audio_config_t *config, |
| 74 | audio_output_flags_t flags, |
| Eric Laurent | 9ae8c59 | 2017-06-22 17:17:09 -0700 | [diff] [blame] | 75 | audio_port_handle_t *selectedDeviceId, |
| Kevin Rocard | 153f92d | 2018-12-18 18:33:28 -0800 | [diff] [blame] | 76 | audio_port_handle_t *portId, |
| 77 | std::vector<audio_io_handle_t> *secondaryOutputs) = 0; |
| Eric Laurent | d7fe086 | 2018-07-14 16:48:01 -0700 | [diff] [blame] | 78 | virtual status_t startOutput(audio_port_handle_t portId) = 0; |
| 79 | virtual status_t stopOutput(audio_port_handle_t portId) = 0; |
| 80 | virtual void releaseOutput(audio_port_handle_t portId) = 0; |
| Eric Laurent | caf7f48 | 2014-11-25 17:50:47 -0800 | [diff] [blame] | 81 | virtual status_t getInputForAttr(const audio_attributes_t *attr, |
| Paul McLean | 466dc8e | 2015-04-17 13:15:36 -0600 | [diff] [blame] | 82 | audio_io_handle_t *input, |
| Mikhail Naganov | 2996f67 | 2019-04-18 12:29:59 -0700 | [diff] [blame] | 83 | audio_unique_id_t riid, |
| Paul McLean | 466dc8e | 2015-04-17 13:15:36 -0600 | [diff] [blame] | 84 | audio_session_t session, |
| Eric Laurent | b2379ba | 2016-05-23 17:42:12 -0700 | [diff] [blame] | 85 | pid_t pid, |
| Eric Laurent | 8c7e6da | 2015-04-21 17:37:00 -0700 | [diff] [blame] | 86 | uid_t uid, |
| Eric Laurent | fee1976 | 2018-01-29 18:44:13 -0800 | [diff] [blame] | 87 | const String16& opPackageName, |
| Eric Laurent | 20b9ef0 | 2016-12-05 11:03:16 -0800 | [diff] [blame] | 88 | const audio_config_base_t *config, |
| Paul McLean | 466dc8e | 2015-04-17 13:15:36 -0600 | [diff] [blame] | 89 | audio_input_flags_t flags, |
| Eric Laurent | 9ae8c59 | 2017-06-22 17:17:09 -0700 | [diff] [blame] | 90 | audio_port_handle_t *selectedDeviceId, |
| Eric Laurent | 20b9ef0 | 2016-12-05 11:03:16 -0800 | [diff] [blame] | 91 | audio_port_handle_t *portId) = 0; |
| Eric Laurent | 4eb58f1 | 2018-12-07 16:41:02 -0800 | [diff] [blame] | 92 | virtual status_t startInput(audio_port_handle_t portId) = 0; |
| Eric Laurent | fee1976 | 2018-01-29 18:44:13 -0800 | [diff] [blame] | 93 | virtual status_t stopInput(audio_port_handle_t portId) = 0; |
| 94 | virtual void releaseInput(audio_port_handle_t portId) = 0; |
| Dima Zavin | fce7a47 | 2011-04-19 22:30:36 -0700 | [diff] [blame] | 95 | virtual status_t initStreamVolume(audio_stream_type_t stream, |
| Eric Laurent | c2f1f07 | 2009-07-17 12:17:14 -0700 | [diff] [blame] | 96 | int indexMin, |
| 97 | int indexMax) = 0; |
| Eric Laurent | 83844cc | 2011-11-18 16:43:31 -0800 | [diff] [blame] | 98 | virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, |
| 99 | int index, |
| 100 | audio_devices_t device) = 0; |
| 101 | virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, |
| 102 | int *index, |
| 103 | audio_devices_t device) = 0; |
| François Gaffie | cfe1732 | 2018-11-07 13:41:29 +0100 | [diff] [blame] | 104 | |
| 105 | virtual status_t setVolumeIndexForAttributes(const audio_attributes_t &attr, |
| 106 | int index, |
| 107 | audio_devices_t device) = 0; |
| 108 | virtual status_t getVolumeIndexForAttributes(const audio_attributes_t &attr, |
| 109 | int &index, |
| 110 | audio_devices_t device) = 0; |
| 111 | virtual status_t getMaxVolumeIndexForAttributes(const audio_attributes_t &attr, int &index) = 0; |
| 112 | |
| 113 | virtual status_t getMinVolumeIndexForAttributes(const audio_attributes_t &attr, int &index) = 0; |
| 114 | |
| Dima Zavin | fce7a47 | 2011-04-19 22:30:36 -0700 | [diff] [blame] | 115 | virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0; |
| Eric Laurent | 6374252 | 2012-03-08 13:42:42 -0800 | [diff] [blame] | 116 | virtual audio_devices_t getDevicesForStream(audio_stream_type_t stream) = 0; |
| Jean-Michel Trivi | f41599b | 2020-01-07 14:22:08 -0800 | [diff] [blame] | 117 | virtual status_t getDevicesForAttributes(const AudioAttributes &aa, |
| 118 | AudioDeviceTypeAddrVector *devices) const = 0; |
| Glenn Kasten | 58e5aa3 | 2012-06-20 14:08:14 -0700 | [diff] [blame] | 119 | virtual audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc) = 0; |
| 120 | virtual status_t registerEffect(const effect_descriptor_t *desc, |
| Eric Laurent | 7c7f10b | 2011-06-17 21:29:58 -0700 | [diff] [blame] | 121 | audio_io_handle_t io, |
| Eric Laurent | de07013 | 2010-07-13 04:45:46 -0700 | [diff] [blame] | 122 | uint32_t strategy, |
| Glenn Kasten | d848eb4 | 2016-03-08 13:42:11 -0800 | [diff] [blame] | 123 | audio_session_t session, |
| Eric Laurent | de07013 | 2010-07-13 04:45:46 -0700 | [diff] [blame] | 124 | int id) = 0; |
| 125 | virtual status_t unregisterEffect(int id) = 0; |
| Eric Laurent | db7c079 | 2011-08-10 10:37:50 -0700 | [diff] [blame] | 126 | virtual status_t setEffectEnabled(int id, bool enabled) = 0; |
| Eric Laurent | 6c79632 | 2019-04-09 14:13:17 -0700 | [diff] [blame] | 127 | virtual status_t moveEffectsToIo(const std::vector<int>& ids, audio_io_handle_t io) = 0; |
| Glenn Kasten | fff6d71 | 2012-01-12 16:38:12 -0800 | [diff] [blame] | 128 | virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const = 0; |
| Jean-Michel Trivi | 272ab54 | 2013-02-04 16:26:02 -0800 | [diff] [blame] | 129 | virtual bool isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs = 0) |
| 130 | const = 0; |
| Jean-Michel Trivi | d708603 | 2012-10-10 12:11:16 -0700 | [diff] [blame] | 131 | virtual bool isSourceActive(audio_source_t source) const = 0; |
| Glenn Kasten | d848eb4 | 2016-03-08 13:42:11 -0800 | [diff] [blame] | 132 | virtual status_t queryDefaultPreProcessing(audio_session_t audioSession, |
| Eric Laurent | 57dae99 | 2011-07-24 13:36:09 -0700 | [diff] [blame] | 133 | effect_descriptor_t *descriptors, |
| 134 | uint32_t *count) = 0; |
| Ari Hausman-Cohen | 2462831 | 2018-08-13 15:01:09 -0700 | [diff] [blame] | 135 | virtual status_t addSourceDefaultEffect(const effect_uuid_t *type, |
| 136 | const String16& opPackageName, |
| 137 | const effect_uuid_t *uuid, |
| 138 | int32_t priority, |
| 139 | audio_source_t source, |
| 140 | audio_unique_id_t* id) = 0; |
| Ari Hausman-Cohen | 433722e | 2018-04-24 14:25:22 -0700 | [diff] [blame] | 141 | virtual status_t addStreamDefaultEffect(const effect_uuid_t *type, |
| 142 | const String16& opPackageName, |
| 143 | const effect_uuid_t *uuid, |
| 144 | int32_t priority, |
| 145 | audio_usage_t usage, |
| 146 | audio_unique_id_t* id) = 0; |
| Ari Hausman-Cohen | 2462831 | 2018-08-13 15:01:09 -0700 | [diff] [blame] | 147 | virtual status_t removeSourceDefaultEffect(audio_unique_id_t id) = 0; |
| Ari Hausman-Cohen | 433722e | 2018-04-24 14:25:22 -0700 | [diff] [blame] | 148 | virtual status_t removeStreamDefaultEffect(audio_unique_id_t id) = 0; |
| Hayden Gomes | 524159d | 2019-12-23 14:41:47 -0800 | [diff] [blame] | 149 | virtual status_t setSupportedSystemUsages(const std::vector<audio_usage_t>& systemUsages) = 0; |
| Kevin Rocard | b99cc75 | 2019-03-21 20:52:24 -0700 | [diff] [blame] | 150 | virtual status_t setAllowedCapturePolicy(uid_t uid, audio_flags_mask_t flags) = 0; |
| Richard Fitzgerald | ad3af33 | 2013-03-25 16:54:37 +0000 | [diff] [blame] | 151 | // Check if offload is possible for given format, stream type, sample rate, |
| 152 | // bit rate, duration, video and streaming or offload property is enabled |
| 153 | virtual bool isOffloadSupported(const audio_offload_info_t& info) = 0; |
| Eric Laurent | 203b1a1 | 2014-04-01 10:34:16 -0700 | [diff] [blame] | 154 | |
| Michael Chan | a94fbb2 | 2018-04-24 14:31:19 +1000 | [diff] [blame] | 155 | // Check if direct playback is possible for given format, sample rate, channel mask and flags. |
| 156 | virtual bool isDirectOutputSupported(const audio_config_base_t& config, |
| 157 | const audio_attributes_t& attributes) = 0; |
| 158 | |
| Eric Laurent | 203b1a1 | 2014-04-01 10:34:16 -0700 | [diff] [blame] | 159 | /* List available audio ports and their attributes */ |
| 160 | virtual status_t listAudioPorts(audio_port_role_t role, |
| 161 | audio_port_type_t type, |
| 162 | unsigned int *num_ports, |
| 163 | struct audio_port *ports, |
| 164 | unsigned int *generation) = 0; |
| 165 | |
| 166 | /* Get attributes for a given audio port */ |
| 167 | virtual status_t getAudioPort(struct audio_port *port) = 0; |
| 168 | |
| 169 | /* Create an audio patch between several source and sink ports */ |
| 170 | virtual status_t createAudioPatch(const struct audio_patch *patch, |
| 171 | audio_patch_handle_t *handle) = 0; |
| 172 | |
| 173 | /* Release an audio patch */ |
| 174 | virtual status_t releaseAudioPatch(audio_patch_handle_t handle) = 0; |
| 175 | |
| 176 | /* List existing audio patches */ |
| 177 | virtual status_t listAudioPatches(unsigned int *num_patches, |
| 178 | struct audio_patch *patches, |
| 179 | unsigned int *generation) = 0; |
| 180 | /* Set audio port configuration */ |
| 181 | virtual status_t setAudioPortConfig(const struct audio_port_config *config) = 0; |
| 182 | |
| Eric Laurent | b52c152 | 2014-05-20 11:27:36 -0700 | [diff] [blame] | 183 | virtual void registerClient(const sp<IAudioPolicyServiceClient>& client) = 0; |
| Eric Laurent | df3dc7e | 2014-07-27 18:39:40 -0700 | [diff] [blame] | 184 | |
| Eric Laurent | e8726fe | 2015-06-26 09:39:24 -0700 | [diff] [blame] | 185 | virtual void setAudioPortCallbacksEnabled(bool enabled) = 0; |
| 186 | |
| François Gaffie | cfe1732 | 2018-11-07 13:41:29 +0100 | [diff] [blame] | 187 | virtual void setAudioVolumeGroupCallbacksEnabled(bool enabled) = 0; |
| 188 | |
| Eric Laurent | df3dc7e | 2014-07-27 18:39:40 -0700 | [diff] [blame] | 189 | virtual status_t acquireSoundTriggerSession(audio_session_t *session, |
| 190 | audio_io_handle_t *ioHandle, |
| 191 | audio_devices_t *device) = 0; |
| 192 | |
| 193 | virtual status_t releaseSoundTriggerSession(audio_session_t session) = 0; |
| Eric Laurent | bb6c9a0 | 2014-09-25 14:11:47 -0700 | [diff] [blame] | 194 | |
| 195 | virtual audio_mode_t getPhoneState() = 0; |
| Eric Laurent | baac183 | 2014-12-01 17:52:59 -0800 | [diff] [blame] | 196 | |
| Chih-Hung Hsieh | e964d4e | 2016-08-09 14:31:32 -0700 | [diff] [blame] | 197 | virtual status_t registerPolicyMixes(const Vector<AudioMix>& mixes, bool registration) = 0; |
| Eric Laurent | 554a277 | 2015-04-10 11:29:24 -0700 | [diff] [blame] | 198 | |
| Jean-Michel Trivi | bda70da | 2018-12-19 07:30:15 -0800 | [diff] [blame] | 199 | virtual status_t setUidDeviceAffinities(uid_t uid, const Vector<AudioDeviceTypeAddr>& devices) |
| 200 | = 0; |
| 201 | |
| 202 | virtual status_t removeUidDeviceAffinities(uid_t uid) = 0; |
| 203 | |
| Oscar Azucena | 90e7763 | 2019-11-27 17:12:28 -0800 | [diff] [blame] | 204 | virtual status_t setUserIdDeviceAffinities(int userId, |
| 205 | const Vector<AudioDeviceTypeAddr>& devices) = 0; |
| 206 | |
| 207 | virtual status_t removeUserIdDeviceAffinities(int userId) = 0; |
| 208 | |
| Eric Laurent | 554a277 | 2015-04-10 11:29:24 -0700 | [diff] [blame] | 209 | virtual status_t startAudioSource(const struct audio_port_config *source, |
| 210 | const audio_attributes_t *attributes, |
| Eric Laurent | 3e6c7e1 | 2018-07-27 17:09:23 -0700 | [diff] [blame] | 211 | audio_port_handle_t *portId) = 0; |
| 212 | virtual status_t stopAudioSource(audio_port_handle_t portId) = 0; |
| Andy Hung | 2ddee19 | 2015-12-18 17:34:44 -0800 | [diff] [blame] | 213 | |
| 214 | virtual status_t setMasterMono(bool mono) = 0; |
| 215 | virtual status_t getMasterMono(bool *mono) = 0; |
| Eric Laurent | ac9cef5 | 2017-06-09 15:46:26 -0700 | [diff] [blame] | 216 | virtual float getStreamVolumeDB( |
| 217 | audio_stream_type_t stream, int index, audio_devices_t device) = 0; |
| jiabin | 8177290 | 2018-04-02 17:52:27 -0700 | [diff] [blame] | 218 | |
| 219 | virtual status_t getSurroundFormats(unsigned int *numSurroundFormats, |
| 220 | audio_format_t *surroundFormats, |
| 221 | bool *surroundFormatsEnabled, |
| 222 | bool reported) = 0; |
| Arun Mirpuri | 11029ad | 2018-12-19 20:45:19 -0800 | [diff] [blame] | 223 | virtual status_t getHwOffloadEncodingFormatsSupportedForA2DP( |
| 224 | std::vector<audio_format_t> *formats) = 0; |
| jiabin | 8177290 | 2018-04-02 17:52:27 -0700 | [diff] [blame] | 225 | virtual status_t setSurroundFormatEnabled(audio_format_t audioFormat, bool enabled) = 0; |
| Eric Laurent | b78763e | 2018-10-17 10:08:02 -0700 | [diff] [blame] | 226 | |
| 227 | virtual status_t setAssistantUid(uid_t uid) = 0; |
| 228 | virtual status_t setA11yServicesUids(const std::vector<uid_t>& uids) = 0; |
| Kohsuke Yatoh | a623a13 | 2020-03-24 20:10:26 -0700 | [diff] [blame] | 229 | virtual status_t setCurrentImeUid(uid_t uid) = 0; |
| jiabin | 6012f91 | 2018-11-02 17:06:30 -0700 | [diff] [blame] | 230 | |
| 231 | virtual bool isHapticPlaybackSupported() = 0; |
| François Gaffie | d0ba9ed | 2018-11-05 11:50:42 +0100 | [diff] [blame] | 232 | virtual status_t listAudioProductStrategies(AudioProductStrategyVector &strategies) = 0; |
| François Gaffie | 4b2018b | 2018-11-07 11:18:59 +0100 | [diff] [blame] | 233 | virtual status_t getProductStrategyFromAudioAttributes(const AudioAttributes &aa, |
| 234 | product_strategy_t &productStrategy) = 0; |
| 235 | |
| 236 | virtual status_t listAudioVolumeGroups(AudioVolumeGroupVector &groups) = 0; |
| 237 | virtual status_t getVolumeGroupFromAudioAttributes(const AudioAttributes &aa, |
| 238 | volume_group_t &volumeGroup) = 0; |
| Eric Laurent | 6ede98f | 2019-06-11 14:50:30 -0700 | [diff] [blame] | 239 | |
| 240 | virtual status_t setRttEnabled(bool enabled) = 0; |
| Eric Laurent | 8340e67 | 2019-11-06 11:01:08 -0800 | [diff] [blame] | 241 | |
| 242 | virtual bool isCallScreenModeSupported() = 0; |
| Jean-Michel Trivi | 3085715 | 2019-11-01 11:04:15 -0700 | [diff] [blame] | 243 | |
| 244 | virtual status_t setPreferredDeviceForStrategy(product_strategy_t strategy, |
| 245 | const AudioDeviceTypeAddr &device) = 0; |
| 246 | |
| 247 | virtual status_t removePreferredDeviceForStrategy(product_strategy_t strategy) = 0; |
| 248 | |
| 249 | virtual status_t getPreferredDeviceForStrategy(product_strategy_t strategy, |
| 250 | AudioDeviceTypeAddr &device) = 0; |
| Ytai Ben-Tsvi | 85093d5 | 2020-03-26 09:41:15 -0700 | [diff] [blame] | 251 | |
| 252 | // The return code here is only intended to represent transport errors. The |
| 253 | // actual server implementation should always return NO_ERROR. |
| 254 | virtual status_t registerSoundTriggerCaptureStateListener( |
| 255 | const sp<media::ICaptureStateListener>& listener, |
| 256 | bool* result) = 0; |
| Eric Laurent | c2f1f07 | 2009-07-17 12:17:14 -0700 | [diff] [blame] | 257 | }; |
| 258 | |
| 259 | |
| 260 | // ---------------------------------------------------------------------------- |
| 261 | |
| 262 | class BnAudioPolicyService : public BnInterface<IAudioPolicyService> |
| 263 | { |
| 264 | public: |
| 265 | virtual status_t onTransact( uint32_t code, |
| 266 | const Parcel& data, |
| 267 | Parcel* reply, |
| 268 | uint32_t flags = 0); |
| Kevin Rocard | 39fdbd0 | 2017-11-13 11:15:27 -0800 | [diff] [blame] | 269 | private: |
| 270 | void sanetizeAudioAttributes(audio_attributes_t* attr); |
| Andy Hung | b027209 | 2018-04-12 11:06:56 -0700 | [diff] [blame] | 271 | status_t sanitizeEffectDescriptor(effect_descriptor_t* desc); |
| 272 | status_t sanitizeAudioPortConfig(struct audio_port_config* config); |
| Eric Laurent | c2f1f07 | 2009-07-17 12:17:14 -0700 | [diff] [blame] | 273 | }; |
| 274 | |
| 275 | // ---------------------------------------------------------------------------- |
| 276 | |
| 277 | }; // namespace android |
| 278 | |
| 279 | #endif // ANDROID_IAUDIOPOLICYSERVICE_H |