2 * Copyright (C) 2011 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef ANDROID_AUDIOPOLICYCLIENTLEGACY_H
18 #define ANDROID_AUDIOPOLICYCLIENTLEGACY_H
20 #include <system/audio.h>
21 #include <system/audio_policy.h>
22 #include <hardware/audio_policy.h>
24 #include <hardware_legacy/AudioSystemLegacy.h>
25 #include <hardware_legacy/AudioPolicyInterface.h>
27 /************************************/
28 /* FOR BACKWARDS COMPATIBILITY ONLY */
29 /************************************/
30 namespace android_audio_legacy {
32 class AudioPolicyCompatClient : public AudioPolicyClientInterface {
34 AudioPolicyCompatClient(struct audio_policy_service_ops *serviceOps,
36 mServiceOps(serviceOps) , mService(service) {}
38 virtual audio_io_handle_t openOutput(uint32_t *pDevices,
39 uint32_t *pSamplingRate,
43 AudioSystem::output_flags flags);
44 virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1,
45 audio_io_handle_t output2);
46 virtual status_t closeOutput(audio_io_handle_t output);
47 virtual status_t suspendOutput(audio_io_handle_t output);
48 virtual status_t restoreOutput(audio_io_handle_t output);
49 virtual audio_io_handle_t openInput(uint32_t *pDevices,
50 uint32_t *pSamplingRate,
53 audio_in_acoustics_t acoustics);
54 virtual status_t closeInput(audio_io_handle_t input);
55 virtual status_t setStreamOutput(AudioSystem::stream_type stream, audio_io_handle_t output);
56 virtual status_t moveEffects(int session,
57 audio_io_handle_t srcOutput,
58 audio_io_handle_t dstOutput);
60 virtual String8 getParameters(audio_io_handle_t ioHandle, const String8& keys);
61 virtual void setParameters(audio_io_handle_t ioHandle,
62 const String8& keyValuePairs,
64 virtual status_t setStreamVolume(AudioSystem::stream_type stream,
66 audio_io_handle_t output,
68 virtual status_t startTone(ToneGenerator::tone_type tone, AudioSystem::stream_type stream);
69 virtual status_t stopTone();
70 virtual status_t setVoiceVolume(float volume, int delayMs = 0);
73 struct audio_policy_service_ops* mServiceOps;
77 }; // namespace android_audio_legacy
79 #endif // ANDROID_AUDIOPOLICYCLIENTLEGACY_H