1 /* 2 * Copyright (c) 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 SOC_PERF_ABILITY_H 17 #define SOC_PERF_ABILITY_H 18 19 #include "i_socperf_service.h" 20 #include "socperf_stub.h" 21 #include "socperf.h" 22 23 namespace OHOS { 24 namespace SOCPERF { 25 class SocPerfServer : public SystemAbility, public SocPerfStub { 26 DECLARE_SYSTEM_ABILITY(SocPerfServer); 27 28 public: 29 void PerfRequest(int cmdId, const std::string& msg) override; 30 void PerfRequestEx(int cmdId, bool onOffTag, const std::string& msg) override; 31 void PowerRequest(int cmdId, const std::string& msg) override; 32 void PowerRequestEx(int cmdId, bool onOffTag, const std::string& msg) override; 33 void PowerLimitBoost(bool onOffTag, const std::string& msg) override; 34 void ThermalRequest(int cmdId, const std::string& msg) override; 35 void ThermalRequestEx(int cmdId, bool onOffTag, const std::string& msg) override; 36 void ThermalLimitBoost(bool onOffTag, const std::string& msg) override; 37 38 public: SocPerfServer(int32_t systemAbilityId,bool runOnCreate)39 SocPerfServer(int32_t systemAbilityId, bool runOnCreate) 40 : SystemAbility(systemAbilityId, runOnCreate) {} ~SocPerfServer()41 ~SocPerfServer() {} 42 43 protected: 44 void OnStart() override; 45 void OnStop() override; 46 47 private: 48 SocPerf socPerf; 49 }; 50 } // namespace SOCPERF 51 } // namespace OHOS 52 53 #endif // SOC_PERF_ABILITY_H