1 /* 2 * Copyright (c) 2024 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 RESSCHED_EXECUTOR_SERVICES_RESSCHEDEXESERVICE_INCLUDE_RES_SCHED_EXE_SERVICE_STUB_H 17 #define RESSCHED_EXECUTOR_SERVICES_RESSCHEDEXESERVICE_INCLUDE_RES_SCHED_EXE_SERVICE_STUB_H 18 19 #include <cstdint> 20 21 #include "iremote_stub.h" 22 23 #include "ires_sched_exe_service.h" 24 25 namespace OHOS { 26 namespace ResourceSchedule { 27 class ResSchedExeServiceStub : public IRemoteStub<IResSchedExeService> { 28 public: 29 /** 30 * @brief Construct a new ResSchedExeServiceStub object. 31 */ 32 ResSchedExeServiceStub(); 33 34 /** 35 * @brief Destroy the ResSchedExeServiceStub object. 36 */ 37 ~ResSchedExeServiceStub(); 38 39 /** 40 * @brief Recieve remote ipc request. 41 * 42 * @param code Indicates the request code. 43 * @param data Indicates the object client send. 44 * @param reply Indicates the object server reply. 45 * @param option Indicates the ipc type. 46 * @return function result. 47 */ 48 int32_t OnRemoteRequest( 49 uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 50 51 private: 52 int32_t ReportRequestInner(MessageParcel& data, MessageParcel& reply); 53 int32_t KillProcessInner(MessageParcel& data, MessageParcel& reply); 54 int32_t ReportDebugInner(MessageParcel& data); 55 bool ParseParcel(MessageParcel& data, uint32_t& resType, int64_t& value, nlohmann::json& context); 56 void Init(); 57 DISALLOW_COPY_AND_MOVE(ResSchedExeServiceStub); 58 }; 59 } // namespace ResourceSchedule 60 } // namespace OHOS 61 62 #endif // RESSCHED_EXECUTOR_SERVICES_RESSCHEDEXESERVICE_INCLUDE_RES_SCHED_EXE_SERVICE_STUB_H 63