1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef AUDIO_POLICY_CLIENT_STUB_H
17 #define AUDIO_POLICY_CLIENT_STUB_H
18 
19 #include "event_handler.h"
20 #include "event_runner.h"
21 #include "audio_policy_client.h"
22 #include "audio_system_manager.h"
23 
24 namespace OHOS {
25 namespace AudioStandard {
26 class AudioPolicyClientStub : public IRemoteStub<IAudioPolicyClient> {
27 public:
28     AudioPolicyClientStub();
29     ~AudioPolicyClientStub();
30     virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
31         MessageOption &option) override;
32 private:
33     void HandleVolumeKeyEvent(MessageParcel &data, MessageParcel &reply);
34     void HandleAudioFocusInfoChange(MessageParcel &data, MessageParcel &reply);
35     void HandleAudioFocusRequested(MessageParcel &data, MessageParcel &reply);
36     void HandleAudioFocusAbandoned(MessageParcel &data, MessageParcel &reply);
37     void HandleDeviceChange(MessageParcel &data, MessageParcel &reply);
38     void HandleMicrophoneBlocked(MessageParcel &data, MessageParcel &reply);
39     void HandleRingerModeUpdated(MessageParcel &data, MessageParcel &reply);
40     void HandleMicStateChange(MessageParcel &data, MessageParcel &reply);
41     void HandlePreferredOutputDeviceUpdated(MessageParcel &data, MessageParcel &reply);
42     void HandlePreferredInputDeviceUpdated(MessageParcel &data, MessageParcel &reply);
43     void HandleRendererStateChange(MessageParcel &data, MessageParcel &reply);
44     void HandleCapturerStateChange(MessageParcel &data, MessageParcel &reply);
45     void HandleRendererDeviceChange(MessageParcel &data, MessageParcel &reply);
46     void HandleRecreateRendererStreamEvent(MessageParcel &data, MessageParcel &reply);
47     void HandleRecreateCapturerStreamEvent(MessageParcel &data, MessageParcel &reply);
48     void HandleHeadTrackingDeviceChange(MessageParcel &data, MessageParcel &reply);
49     void HandleSpatializationEnabledChange(MessageParcel &data, MessageParcel &reply);
50     void HandleSpatializationEnabledChangeForAnyDevice(MessageParcel &data, MessageParcel &reply);
51     void HandleHeadTrackingEnabledChange(MessageParcel &data, MessageParcel &reply);
52     void HandleHeadTrackingEnabledChangeForAnyDevice(MessageParcel &data, MessageParcel &reply);
53     void HandleAudioSessionCallback(MessageParcel &data, MessageParcel &reply);
54 
55     void OnMaxRemoteRequest(uint32_t updateCode, MessageParcel &data, MessageParcel &reply);
56     void OnFirMaxRemoteRequest(uint32_t updateCode, MessageParcel &data, MessageParcel &reply);
57 };
58 } // namespace AudioStandard
59 } // namespace OHOS
60 #endif // AUDIO_POLICY_CLIENT_STUB_H