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 #include "res_sched_systemload_notifier_proxy.h"
17 
18 #include "ipc_types.h"
19 #include "ipc_util.h"
20 #include "iremote_object.h"
21 #include "message_option.h"
22 #include "message_parcel.h"
23 #include "res_sched_errors.h"
24 #include "res_sched_log.h"
25 #include "res_sched_ipc_interface_code.h"
26 
27 namespace OHOS {
28 namespace ResourceSchedule {
OnSystemloadLevel(int32_t level)29 void ResSchedSystemloadNotifierProxy::OnSystemloadLevel(int32_t level)
30 {
31     RESSCHED_LOGD("ResSchedSystemloadNotifierProxy OnSystemloadLevel");
32     MessageParcel data;
33     MessageParcel reply;
34     MessageOption option;
35     WRITE_PARCEL(
36         data, InterfaceToken, ResSchedSystemloadNotifierProxy::GetDescriptor(), void(), ResSchedServiceProxy);
37     WRITE_PARCEL(data, Int32, level, void(), ResSchedServiceProxy);
38     int32_t errCode = Remote()->SendRequest(static_cast<uint32_t>
39         (ResourceSceduleSystemloadNotifierCode::SYSTEMLOAD_LEVEL), data, reply, option);
40     RESSCHED_LOGD("result = %{public}d", errCode);
41 }
42 } // namespace ResourceSchedule
43 } // namespace OHOS
44