blob: 2f5ccb89e9678a8ceb6473350481ae838acda67d [file] [log] [blame]
Jean-Michel Trivi0008a482016-12-26 15:58:24 -08001/*
2 * Copyright (C) 2016 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_IAUDIOMANAGER_H
18#define ANDROID_IAUDIOMANAGER_H
19
20#include <utils/Errors.h>
21#include <binder/IInterface.h>
22#include <hardware/power.h>
23#include <system/audio.h>
24
25namespace android {
26
27// ----------------------------------------------------------------------------
28
29class IAudioManager : public IInterface
30{
31public:
32 // These transaction IDs must be kept in sync with the method order from
33 // IAudioService.aidl.
34 enum {
Mikhail Naganovef694222018-01-31 10:22:21 -080035 TRACK_PLAYER = IBinder::FIRST_CALL_TRANSACTION,
36 PLAYER_ATTRIBUTES = IBinder::FIRST_CALL_TRANSACTION + 1,
37 PLAYER_EVENT = IBinder::FIRST_CALL_TRANSACTION + 2,
38 RELEASE_PLAYER = IBinder::FIRST_CALL_TRANSACTION + 3,
Mikhail Naganovdecb6292019-04-10 16:49:02 -070039 TRACK_RECORDER = IBinder::FIRST_CALL_TRANSACTION + 4,
40 RECORDER_EVENT = IBinder::FIRST_CALL_TRANSACTION + 5,
Mikhail Naganovb8bff0c2019-05-09 09:06:15 -070041 RELEASE_RECORDER = IBinder::FIRST_CALL_TRANSACTION + 6,
Jean-Michel Trivi0008a482016-12-26 15:58:24 -080042 };
43
44 DECLARE_META_INTERFACE(AudioManager)
45
46 // The parcels created by these methods must be kept in sync with the
47 // corresponding methods from IAudioService.aidl and objects it imports.
Jean-Michel Trivi63189322017-01-05 18:05:28 -080048 virtual audio_unique_id_t trackPlayer(player_type_t playerType, audio_usage_t usage,
49 audio_content_type_t content, const sp<IBinder>& player) = 0;
50 /*oneway*/ virtual status_t playerAttributes(audio_unique_id_t piid, audio_usage_t usage,
51 audio_content_type_t content)= 0;
52 /*oneway*/ virtual status_t playerEvent(audio_unique_id_t piid, player_state_t event) = 0;
53 /*oneway*/ virtual status_t releasePlayer(audio_unique_id_t piid) = 0;
Mikhail Naganovdecb6292019-04-10 16:49:02 -070054 virtual audio_unique_id_t trackRecorder(const sp<IBinder>& recorder) = 0;
55 /*oneway*/ virtual status_t recorderEvent(audio_unique_id_t riid, recorder_state_t event) = 0;
Mikhail Naganovb8bff0c2019-05-09 09:06:15 -070056 /*oneway*/ virtual status_t releaseRecorder(audio_unique_id_t riid) = 0;
Jean-Michel Trivi0008a482016-12-26 15:58:24 -080057};
58
59// ----------------------------------------------------------------------------
60
61}; // namespace android
62
63#endif // ANDROID_IAUDIOMANAGER_H