13fc297bdSopenharmony_ci/*
23fc297bdSopenharmony_ci * Copyright (c) 2022-2024 Huawei Device Co., Ltd.
33fc297bdSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
43fc297bdSopenharmony_ci * you may not use this file except in compliance with the License.
53fc297bdSopenharmony_ci * You may obtain a copy of the License at
63fc297bdSopenharmony_ci *
73fc297bdSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
83fc297bdSopenharmony_ci *
93fc297bdSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
103fc297bdSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
113fc297bdSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
123fc297bdSopenharmony_ci * See the License for the specific language governing permissions and
133fc297bdSopenharmony_ci * limitations under the License.
143fc297bdSopenharmony_ci */
153fc297bdSopenharmony_ci
163fc297bdSopenharmony_ci#ifndef SOC_PERF_SERVICES_SERVER_INCLUDE_SOCPERF_SERVER_H
173fc297bdSopenharmony_ci#define SOC_PERF_SERVICES_SERVER_INCLUDE_SOCPERF_SERVER_H
183fc297bdSopenharmony_ci
193fc297bdSopenharmony_ci#include "singleton.h"
203fc297bdSopenharmony_ci#include "socperf_stub.h"
213fc297bdSopenharmony_ci#include "socperf.h"
223fc297bdSopenharmony_ci#include "system_ability.h"
233fc297bdSopenharmony_ci
243fc297bdSopenharmony_cinamespace OHOS {
253fc297bdSopenharmony_cinamespace SOCPERF {
263fc297bdSopenharmony_ciclass SocPerfServer : public SystemAbility, public SocPerfStub,
273fc297bdSopenharmony_ci    public std::enable_shared_from_this<SocPerfServer> {
283fc297bdSopenharmony_ciDISALLOW_COPY_AND_MOVE(SocPerfServer);
293fc297bdSopenharmony_ciDECLARE_SYSTEM_ABILITY(SocPerfServer);
303fc297bdSopenharmony_ciDECLARE_DELAYED_SINGLETON(SocPerfServer);
313fc297bdSopenharmony_ci
323fc297bdSopenharmony_cipublic:
333fc297bdSopenharmony_ci    void PerfRequest(int32_t cmdId, const std::string& msg) override;
343fc297bdSopenharmony_ci    void PerfRequestEx(int32_t cmdId, bool onOffTag, const std::string& msg) override;
353fc297bdSopenharmony_ci    void PowerLimitBoost(bool onOffTag, const std::string& msg) override;
363fc297bdSopenharmony_ci    void ThermalLimitBoost(bool onOffTag, const std::string& msg) override;
373fc297bdSopenharmony_ci    void LimitRequest(int32_t clientId,
383fc297bdSopenharmony_ci        const std::vector<int32_t>& tags, const std::vector<int64_t>& configs, const std::string& msg) override;
393fc297bdSopenharmony_ci    void SetRequestStatus(bool status, const std::string& msg) override;
403fc297bdSopenharmony_ci    void SetThermalLevel(int32_t level) override;
413fc297bdSopenharmony_ci    void RequestDeviceMode(const std::string& mode, bool status) override;
423fc297bdSopenharmony_ci    std::string RequestCmdIdCount(const std::string& msg) override;
433fc297bdSopenharmony_ci    int32_t Dump(int32_t fd, const std::vector<std::u16string>& args) override;
443fc297bdSopenharmony_ci
453fc297bdSopenharmony_cipublic:
463fc297bdSopenharmony_ci    SocPerfServer(int32_t systemAbilityId, bool runOnCreate);
473fc297bdSopenharmony_ci
483fc297bdSopenharmony_ciprotected:
493fc297bdSopenharmony_ci    void OnStart() override;
503fc297bdSopenharmony_ci    void OnStop() override;
513fc297bdSopenharmony_ci
523fc297bdSopenharmony_ciprivate:
533fc297bdSopenharmony_ci    SocPerf socPerf;
543fc297bdSopenharmony_ci    bool AllowDump();
553fc297bdSopenharmony_ci};
563fc297bdSopenharmony_ci} // namespace SOCPERF
573fc297bdSopenharmony_ci} // namespace OHOS
583fc297bdSopenharmony_ci
593fc297bdSopenharmony_ci#endif // SOC_PERF_SERVICES_SERVER_INCLUDE_SOCPERF_SERVER_H
60