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 
20 #include <vector>
21 
22 #include <utils/RefBase.h>
23 #include <binder/IInterface.h>
24 #include <system/audio.h>
25 #include <system/audio_effect.h>
26 #include <media/AudioPolicy.h>
27 #include <media/AudioVolumeGroup.h>
28 
29 namespace android {
30 
31 // ----------------------------------------------------------------------------
32 
33 struct record_client_info {
34     audio_unique_id_t riid;
35     uid_t uid;
36     audio_session_t session;
37     audio_source_t source;
38     audio_port_handle_t port_id;
39     bool silenced;
40 };
41 
42 typedef struct record_client_info record_client_info_t;
43 
44 // ----------------------------------------------------------------------------
45 
46 class IAudioPolicyServiceClient : public IInterface
47 {
48 public:
49     DECLARE_META_INTERFACE(AudioPolicyServiceClient);
50 
51     // Notifies a change of volume group
52     virtual void onAudioVolumeGroupChanged(volume_group_t group, int flags) = 0;
53     // Notifies a change of audio port configuration.
54     virtual void onAudioPortListUpdate() = 0;
55     // Notifies a change of audio patch configuration.
56     virtual void onAudioPatchListUpdate() = 0;
57     // Notifies a change in the mixing state of a specific mix in a dynamic audio policy
58     virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state) = 0;
59     // Notifies a change of audio recording configuration
60     virtual void onRecordingConfigurationUpdate(int event,
61             const record_client_info_t *clientInfo,
62             const audio_config_base_t *clientConfig,
63             std::vector<effect_descriptor_t> clientEffects,
64             const audio_config_base_t *deviceConfig,
65             std::vector<effect_descriptor_t> effects,
66             audio_patch_handle_t patchHandle,
67             audio_source_t source) = 0;
68 };
69 
70 
71 // ----------------------------------------------------------------------------
72 
73 class BnAudioPolicyServiceClient : public BnInterface<IAudioPolicyServiceClient>
74 {
75 public:
76     virtual status_t    onTransact( uint32_t code,
77                                     const Parcel& data,
78                                     Parcel* reply,
79                                     uint32_t flags = 0);
80 };
81 
82 // ----------------------------------------------------------------------------
83 
84 }; // namespace android
85 
86 #endif // ANDROID_IAUDIOPOLICYSERVICECLIENT_H
87