1*38e8c45fSAndroid Build Coastguard Worker /* 2*38e8c45fSAndroid Build Coastguard Worker * Copyright (C) 2016 The Android Open Source Project 3*38e8c45fSAndroid Build Coastguard Worker * 4*38e8c45fSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*38e8c45fSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*38e8c45fSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*38e8c45fSAndroid Build Coastguard Worker * 8*38e8c45fSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*38e8c45fSAndroid Build Coastguard Worker * 10*38e8c45fSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*38e8c45fSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*38e8c45fSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*38e8c45fSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*38e8c45fSAndroid Build Coastguard Worker * limitations under the License. 15*38e8c45fSAndroid Build Coastguard Worker */ 16*38e8c45fSAndroid Build Coastguard Worker 17*38e8c45fSAndroid Build Coastguard Worker #ifndef ANDROID_IAUDIOMANAGER_H 18*38e8c45fSAndroid Build Coastguard Worker #define ANDROID_IAUDIOMANAGER_H 19*38e8c45fSAndroid Build Coastguard Worker 20*38e8c45fSAndroid Build Coastguard Worker #include <audiomanager/AudioManager.h> 21*38e8c45fSAndroid Build Coastguard Worker #include <utils/Errors.h> 22*38e8c45fSAndroid Build Coastguard Worker #include <binder/IInterface.h> 23*38e8c45fSAndroid Build Coastguard Worker #include <binder/PersistableBundle.h> 24*38e8c45fSAndroid Build Coastguard Worker #include <hardware/power.h> 25*38e8c45fSAndroid Build Coastguard Worker #include <system/audio.h> 26*38e8c45fSAndroid Build Coastguard Worker 27*38e8c45fSAndroid Build Coastguard Worker namespace android { 28*38e8c45fSAndroid Build Coastguard Worker 29*38e8c45fSAndroid Build Coastguard Worker // ---------------------------------------------------------------------------- 30*38e8c45fSAndroid Build Coastguard Worker // TODO(b/309532236) replace this class with AIDL generated parcelable 31*38e8c45fSAndroid Build Coastguard Worker class IAudioManager : public IInterface 32*38e8c45fSAndroid Build Coastguard Worker { 33*38e8c45fSAndroid Build Coastguard Worker public: 34*38e8c45fSAndroid Build Coastguard Worker // These transaction IDs must be kept in sync with the method order from 35*38e8c45fSAndroid Build Coastguard Worker // IAudioService.aidl. 36*38e8c45fSAndroid Build Coastguard Worker enum { 37*38e8c45fSAndroid Build Coastguard Worker TRACK_PLAYER = IBinder::FIRST_CALL_TRANSACTION, 38*38e8c45fSAndroid Build Coastguard Worker PLAYER_ATTRIBUTES = IBinder::FIRST_CALL_TRANSACTION + 1, 39*38e8c45fSAndroid Build Coastguard Worker PLAYER_EVENT = IBinder::FIRST_CALL_TRANSACTION + 2, 40*38e8c45fSAndroid Build Coastguard Worker RELEASE_PLAYER = IBinder::FIRST_CALL_TRANSACTION + 3, 41*38e8c45fSAndroid Build Coastguard Worker TRACK_RECORDER = IBinder::FIRST_CALL_TRANSACTION + 4, 42*38e8c45fSAndroid Build Coastguard Worker RECORDER_EVENT = IBinder::FIRST_CALL_TRANSACTION + 5, 43*38e8c45fSAndroid Build Coastguard Worker RELEASE_RECORDER = IBinder::FIRST_CALL_TRANSACTION + 6, 44*38e8c45fSAndroid Build Coastguard Worker PLAYER_SESSION_ID = IBinder::FIRST_CALL_TRANSACTION + 7, 45*38e8c45fSAndroid Build Coastguard Worker PORT_EVENT = IBinder::FIRST_CALL_TRANSACTION + 8, 46*38e8c45fSAndroid Build Coastguard Worker PERMISSION_UPDATE_BARRIER = IBinder::FIRST_CALL_TRANSACTION + 9, 47*38e8c45fSAndroid Build Coastguard Worker }; 48*38e8c45fSAndroid Build Coastguard Worker 49*38e8c45fSAndroid Build Coastguard Worker DECLARE_META_INTERFACE(AudioManager) 50*38e8c45fSAndroid Build Coastguard Worker 51*38e8c45fSAndroid Build Coastguard Worker // The parcels created by these methods must be kept in sync with the 52*38e8c45fSAndroid Build Coastguard Worker // corresponding methods from IAudioService.aidl and objects it imports. 53*38e8c45fSAndroid Build Coastguard Worker virtual audio_unique_id_t trackPlayer(player_type_t playerType, audio_usage_t usage, 54*38e8c45fSAndroid Build Coastguard Worker audio_content_type_t content, const sp<IBinder>& player, 55*38e8c45fSAndroid Build Coastguard Worker audio_session_t sessionId) = 0; 56*38e8c45fSAndroid Build Coastguard Worker /*oneway*/ virtual status_t playerAttributes(audio_unique_id_t piid, audio_usage_t usage, 57*38e8c45fSAndroid Build Coastguard Worker audio_content_type_t content)= 0; 58*38e8c45fSAndroid Build Coastguard Worker /*oneway*/ virtual status_t playerEvent(audio_unique_id_t piid, player_state_t event, 59*38e8c45fSAndroid Build Coastguard Worker const std::vector<audio_port_handle_t>& eventIds) = 0; 60*38e8c45fSAndroid Build Coastguard Worker /*oneway*/ virtual status_t releasePlayer(audio_unique_id_t piid) = 0; 61*38e8c45fSAndroid Build Coastguard Worker virtual audio_unique_id_t trackRecorder(const sp<IBinder>& recorder) = 0; 62*38e8c45fSAndroid Build Coastguard Worker /*oneway*/ virtual status_t recorderEvent(audio_unique_id_t riid, recorder_state_t event) = 0; 63*38e8c45fSAndroid Build Coastguard Worker /*oneway*/ virtual status_t releaseRecorder(audio_unique_id_t riid) = 0; 64*38e8c45fSAndroid Build Coastguard Worker /*oneway*/ virtual status_t playerSessionId(audio_unique_id_t piid, audio_session_t sessionId) = 0; 65*38e8c45fSAndroid Build Coastguard Worker /*oneway*/ virtual status_t portEvent(audio_port_handle_t portId, player_state_t event, 66*38e8c45fSAndroid Build Coastguard Worker const std::unique_ptr<os::PersistableBundle>& extras) = 0; 67*38e8c45fSAndroid Build Coastguard Worker virtual status_t permissionUpdateBarrier() = 0; 68*38e8c45fSAndroid Build Coastguard Worker }; 69*38e8c45fSAndroid Build Coastguard Worker 70*38e8c45fSAndroid Build Coastguard Worker // ---------------------------------------------------------------------------- 71*38e8c45fSAndroid Build Coastguard Worker 72*38e8c45fSAndroid Build Coastguard Worker }; // namespace android 73*38e8c45fSAndroid Build Coastguard Worker 74*38e8c45fSAndroid Build Coastguard Worker #endif // ANDROID_IAUDIOMANAGER_H 75