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 #include "dump_callback_broker_proxy.h"
16 #include <message_parcel.h>
17 #include "dump_errors.h"
18 #include "hilog_wrapper.h"
19 namespace OHOS {
20 namespace HiviewDFX {
OnStatusChanged(uint32_t status)21 void DumpCallbackBrokerProxy::OnStatusChanged(uint32_t status)
22 {
23 sptr<IRemoteObject> remote = Remote();
24 if (remote == nullptr) {
25 return;
26 }
27 MessageParcel data;
28 MessageParcel reply;
29 MessageOption option;
30 if (!data.WriteInterfaceToken(DumpCallbackBrokerProxy::GetDescriptor())) {
31 return;
32 }
33 if (!data.WriteUint32(status)) {
34 return;
35 }
36 int ret = remote->SendRequest(static_cast<int>(IDumpCallbackBroker::ON_STATUS_CHANGED),
37 data, reply, option);
38 if (ret != ERR_OK) {
39 DUMPER_HILOGE(MODULE_ZIDL, "error|SendRequest error code: %{public}d", ret);
40 }
41 }
42 } // namespace HiviewDFX
43 } // namespace OHOS
44