Eric Laurent | b52c152 | 2014-05-20 11:27:36 -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_IAUDIOPOLICYSERVICECLIENT_H |
| 18 | #define ANDROID_IAUDIOPOLICYSERVICECLIENT_H |
| 19 | |
Eric Laurent | a9f8665 | 2018-11-28 17:23:11 -0800 | [diff] [blame] | 20 | #include <vector> |
Eric Laurent | b52c152 | 2014-05-20 11:27:36 -0700 | [diff] [blame] | 21 | |
| 22 | #include <utils/RefBase.h> |
| 23 | #include <binder/IInterface.h> |
| 24 | #include <system/audio.h> |
Eric Laurent | a9f8665 | 2018-11-28 17:23:11 -0800 | [diff] [blame] | 25 | #include <system/audio_effect.h> |
Eric Laurent | b52c152 | 2014-05-20 11:27:36 -0700 | [diff] [blame] | 26 | |
| 27 | namespace android { |
| 28 | |
| 29 | // ---------------------------------------------------------------------------- |
| 30 | |
Jean-Michel Trivi | ac4e429 | 2016-12-22 11:39:31 -0800 | [diff] [blame] | 31 | struct record_client_info { |
| 32 | uid_t uid; |
| 33 | audio_session_t session; |
| 34 | audio_source_t source; |
Eric Laurent | a9f8665 | 2018-11-28 17:23:11 -0800 | [diff] [blame] | 35 | audio_port_handle_t port_id; |
| 36 | bool silenced; |
Jean-Michel Trivi | ac4e429 | 2016-12-22 11:39:31 -0800 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | typedef struct record_client_info record_client_info_t; |
| 40 | |
| 41 | // ---------------------------------------------------------------------------- |
| 42 | |
Eric Laurent | b52c152 | 2014-05-20 11:27:36 -0700 | [diff] [blame] | 43 | class IAudioPolicyServiceClient : public IInterface |
| 44 | { |
| 45 | public: |
| 46 | DECLARE_META_INTERFACE(AudioPolicyServiceClient); |
| 47 | |
| 48 | // Notifies a change of audio port configuration. |
| 49 | virtual void onAudioPortListUpdate() = 0; |
| 50 | // Notifies a change of audio patch configuration. |
| 51 | virtual void onAudioPatchListUpdate() = 0; |
Jean-Michel Trivi | de80105 | 2015-04-14 19:10:14 -0700 | [diff] [blame] | 52 | // Notifies a change in the mixing state of a specific mix in a dynamic audio policy |
| 53 | virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state) = 0; |
Jean-Michel Trivi | 2f4fe9f | 2015-12-04 16:20:59 -0800 | [diff] [blame] | 54 | // Notifies a change of audio recording configuration |
Jean-Michel Trivi | ac4e429 | 2016-12-22 11:39:31 -0800 | [diff] [blame] | 55 | virtual void onRecordingConfigurationUpdate(int event, |
| 56 | const record_client_info_t *clientInfo, |
Jean-Michel Trivi | 7281aa9 | 2016-02-17 15:33:40 -0800 | [diff] [blame] | 57 | const audio_config_base_t *clientConfig, |
Eric Laurent | a9f8665 | 2018-11-28 17:23:11 -0800 | [diff] [blame] | 58 | std::vector<effect_descriptor_t> clientEffects, |
Jean-Michel Trivi | 8c7cf3b | 2016-02-25 17:08:24 -0800 | [diff] [blame] | 59 | const audio_config_base_t *deviceConfig, |
Eric Laurent | a9f8665 | 2018-11-28 17:23:11 -0800 | [diff] [blame] | 60 | std::vector<effect_descriptor_t> effects, |
| 61 | audio_patch_handle_t patchHandle, |
| 62 | audio_source_t source) = 0; |
Eric Laurent | b52c152 | 2014-05-20 11:27:36 -0700 | [diff] [blame] | 63 | }; |
| 64 | |
| 65 | |
| 66 | // ---------------------------------------------------------------------------- |
| 67 | |
| 68 | class BnAudioPolicyServiceClient : public BnInterface<IAudioPolicyServiceClient> |
| 69 | { |
| 70 | public: |
| 71 | virtual status_t onTransact( uint32_t code, |
| 72 | const Parcel& data, |
| 73 | Parcel* reply, |
| 74 | uint32_t flags = 0); |
| 75 | }; |
| 76 | |
| 77 | // ---------------------------------------------------------------------------- |
| 78 | |
| 79 | }; // namespace android |
| 80 | |
| 81 | #endif // ANDROID_IAUDIOPOLICYSERVICECLIENT_H |