• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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_MANAGER_STUB_H
17 #define AUDIO_POLICY_MANAGER_STUB_H
18 
19 #include "audio_policy_base.h"
20 
21 namespace OHOS {
22 namespace AudioStandard {
23 class AudioPolicyManagerStub : public IRemoteStub<IAudioPolicy> {
24 public:
25     virtual int32_t OnRemoteRequest(uint32_t code, MessageParcel &data,
26                                 MessageParcel &reply, MessageOption &option) override;
27     bool IsPermissionValid();
28 
29 private:
30     void SetStreamVolumeInternal(MessageParcel &data, MessageParcel &reply);
31     void SetRingerModeInternal(MessageParcel &data, MessageParcel &reply);
32     void GetRingerModeInternal(MessageParcel &data);
33     void SetAudioSceneInternal(MessageParcel &data, MessageParcel &reply);
34     void GetAudioSceneInternal(MessageParcel &data);
35     void GetStreamVolumeInternal(MessageParcel &data, MessageParcel &reply);
36     void SetStreamMuteInternal(MessageParcel &data, MessageParcel &reply);
37     void GetStreamMuteInternal(MessageParcel &data, MessageParcel &reply);
38     void IsStreamActiveInternal(MessageParcel &data, MessageParcel &reply);
39     void SetDeviceActiveInternal(MessageParcel &data, MessageParcel &reply);
40     void IsDeviceActiveInternal(MessageParcel &data, MessageParcel &reply);
41     void SetRingerModeCallbackInternal(MessageParcel &data, MessageParcel &reply);
42     void UnsetRingerModeCallbackInternal(MessageParcel &data, MessageParcel &reply);
43     void SetInterruptCallbackInternal(MessageParcel &data, MessageParcel &reply);
44     void UnsetInterruptCallbackInternal(MessageParcel &data, MessageParcel &reply);
45     void ActivateInterruptInternal(MessageParcel &data, MessageParcel &reply);
46     void DeactivateInterruptInternal(MessageParcel &data, MessageParcel &reply);
47     void SetAudioManagerInterruptCbInternal(MessageParcel &data, MessageParcel &reply);
48     void UnsetAudioManagerInterruptCbInternal(MessageParcel &data, MessageParcel &reply);
49     void RequestAudioFocusInternal(MessageParcel &data, MessageParcel &reply);
50     void AbandonAudioFocusInternal(MessageParcel &data, MessageParcel &reply);
51     void GetStreamInFocusInternal(MessageParcel &reply);
52     void GetSessionInfoInFocusInternal(MessageParcel &reply);
53     void ReadAudioInterruptParams(MessageParcel &data, AudioInterrupt &audioInterrupt);
54     void ReadAudioManagerInterruptParams(MessageParcel &data, AudioInterrupt &audioInterrupt);
55     void WriteAudioInteruptParams(MessageParcel &reply, const AudioInterrupt &audioInterrupt);
56     void SetVolumeKeyEventCallbackInternal(MessageParcel &data, MessageParcel &reply);
57     void UnsetVolumeKeyEventCallbackInternal(MessageParcel &data, MessageParcel &reply);
58     void GetDevicesInternal(MessageParcel &data, MessageParcel &reply);
59     void SetDeviceChangeCallbackInternal(MessageParcel &data, MessageParcel &reply);
60     void UnsetDeviceChangeCallbackInternal(MessageParcel &data, MessageParcel &reply);
61 };
62 } // namespace AudioStandard
63 } // namespace OHOS
64 #endif // AUDIO_POLICY_MANAGER_STUB_H
65