Jean-Michel Trivi | 0008a48 | 2016-12-26 15:58:24 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
Vlad Popa | 459fc74 | 2022-06-10 00:07:27 +0200 | [diff] [blame^] | 20 | #include <audiomanager/AudioManager.h> |
Jean-Michel Trivi | 0008a48 | 2016-12-26 15:58:24 -0800 | [diff] [blame] | 21 | #include <utils/Errors.h> |
| 22 | #include <binder/IInterface.h> |
| 23 | #include <hardware/power.h> |
| 24 | #include <system/audio.h> |
| 25 | |
| 26 | namespace android { |
| 27 | |
| 28 | // ---------------------------------------------------------------------------- |
| 29 | |
| 30 | class IAudioManager : public IInterface |
| 31 | { |
| 32 | public: |
| 33 | // These transaction IDs must be kept in sync with the method order from |
| 34 | // IAudioService.aidl. |
| 35 | enum { |
Mikhail Naganov | ef69422 | 2018-01-31 10:22:21 -0800 | [diff] [blame] | 36 | TRACK_PLAYER = IBinder::FIRST_CALL_TRANSACTION, |
| 37 | PLAYER_ATTRIBUTES = IBinder::FIRST_CALL_TRANSACTION + 1, |
| 38 | PLAYER_EVENT = IBinder::FIRST_CALL_TRANSACTION + 2, |
| 39 | RELEASE_PLAYER = IBinder::FIRST_CALL_TRANSACTION + 3, |
Mikhail Naganov | decb629 | 2019-04-10 16:49:02 -0700 | [diff] [blame] | 40 | TRACK_RECORDER = IBinder::FIRST_CALL_TRANSACTION + 4, |
| 41 | RECORDER_EVENT = IBinder::FIRST_CALL_TRANSACTION + 5, |
Mikhail Naganov | b8bff0c | 2019-05-09 09:06:15 -0700 | [diff] [blame] | 42 | RELEASE_RECORDER = IBinder::FIRST_CALL_TRANSACTION + 6, |
Eric Laurent | bf28ea6 | 2021-01-29 20:45:03 +0100 | [diff] [blame] | 43 | PLAYER_SESSION_ID = IBinder::FIRST_CALL_TRANSACTION + 7, |
Jean-Michel Trivi | 0008a48 | 2016-12-26 15:58:24 -0800 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | DECLARE_META_INTERFACE(AudioManager) |
| 47 | |
| 48 | // The parcels created by these methods must be kept in sync with the |
| 49 | // corresponding methods from IAudioService.aidl and objects it imports. |
Jean-Michel Trivi | 6318932 | 2017-01-05 18:05:28 -0800 | [diff] [blame] | 50 | virtual audio_unique_id_t trackPlayer(player_type_t playerType, audio_usage_t usage, |
Eric Laurent | bf28ea6 | 2021-01-29 20:45:03 +0100 | [diff] [blame] | 51 | audio_content_type_t content, const sp<IBinder>& player, |
| 52 | audio_session_t sessionId) = 0; |
Jean-Michel Trivi | 6318932 | 2017-01-05 18:05:28 -0800 | [diff] [blame] | 53 | /*oneway*/ virtual status_t playerAttributes(audio_unique_id_t piid, audio_usage_t usage, |
| 54 | audio_content_type_t content)= 0; |
Oscar Azucena | fae808f | 2020-12-22 20:40:07 +0000 | [diff] [blame] | 55 | /*oneway*/ virtual status_t playerEvent(audio_unique_id_t piid, player_state_t event, |
Vlad Popa | 459fc74 | 2022-06-10 00:07:27 +0200 | [diff] [blame^] | 56 | audio_port_handle_t eventId) = 0; |
Jean-Michel Trivi | 6318932 | 2017-01-05 18:05:28 -0800 | [diff] [blame] | 57 | /*oneway*/ virtual status_t releasePlayer(audio_unique_id_t piid) = 0; |
Mikhail Naganov | decb629 | 2019-04-10 16:49:02 -0700 | [diff] [blame] | 58 | virtual audio_unique_id_t trackRecorder(const sp<IBinder>& recorder) = 0; |
| 59 | /*oneway*/ virtual status_t recorderEvent(audio_unique_id_t riid, recorder_state_t event) = 0; |
Mikhail Naganov | b8bff0c | 2019-05-09 09:06:15 -0700 | [diff] [blame] | 60 | /*oneway*/ virtual status_t releaseRecorder(audio_unique_id_t riid) = 0; |
Eric Laurent | bf28ea6 | 2021-01-29 20:45:03 +0100 | [diff] [blame] | 61 | /*oneway*/ virtual status_t playerSessionId(audio_unique_id_t piid, audio_session_t sessionId) = 0; |
Jean-Michel Trivi | 0008a48 | 2016-12-26 15:58:24 -0800 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | // ---------------------------------------------------------------------------- |
| 65 | |
| 66 | }; // namespace android |
| 67 | |
| 68 | #endif // ANDROID_IAUDIOMANAGER_H |