1 /*
2  * Copyright (c) 2021 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_ABILITY_H
17 #define AUDIO_ABILITY_H
18 
19 #include <string>
20 
21 #include "refbase.h"
22 #include "system_ability.h"
23 #include "test_audio_ability_stub.h"
24 
25 namespace OHOS {
26 class TestAudioAbility : public SystemAbility, public TestAudioAbilityStub {
27     DECLARE_SYSTEM_ABILITY(TestAudioAbility);
28 
29 public:
30     TestAudioAbility(int32_t saId, bool runOnCreate);
31     ~TestAudioAbility();
32 
33     int AddVolume(int volume) override;
34     int32_t ReduceVolume(int volume) override;
35     int32_t TestRpcInt32(int32_t value) override;
36     uint32_t TestRpcUInt32(uint32_t value) override;
37     int64_t TestRpcInt64(int64_t value) override;
38     uint64_t TestRpcUInt64(uint64_t value) override;
39     float TestRpcFloat(float value) override;
40     double TestRpcDouble(double value) override;
41     const std::u16string TestRpcString16(const std::u16string& name) override;
42     sptr<IRemoteObject> GetBaseSystemAbility(int32_t systemAbilityId);
43 
44 protected:
45     void OnStart() override;
46     void OnStop() override;
47     void OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override;
48     void OnRemoveSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override;
49 };
50 }
51 
52 #endif // !defined(AUDIO_ABILITY_H)
53