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 "dp_inited_callback_proxy.h" 17 #include "macro_utils.h" 18 #include "distributed_device_profile_errors.h" 19 #include "i_distributed_device_profile.h" 20 #include "message_parcel.h" 21 22 namespace OHOS { 23 namespace DistributedDeviceProfile { 24 namespace { 25 const std::string TAG = "DpInitedCallbackProxy"; 26 } 27 OnDpInited()28int32_t DpInitedCallbackProxy::OnDpInited() 29 { 30 sptr<IRemoteObject> remote = nullptr; 31 GET_REMOTE_OBJECT(remote); 32 MessageParcel data; 33 if (!data.WriteInterfaceToken(IDpInitedCallback::GetDescriptor())) { 34 HILOGE("write descriptor failed"); 35 return ERR_FLATTEN_OBJECT; 36 } 37 MessageParcel reply; 38 SEND_REQUEST(remote, static_cast<uint32_t>(DPInterfaceCode::ON_DEVICE_PROFILE_INITED), data, reply); 39 return DP_SUCCESS; 40 } 41 } // namespace DistributedDeviceProfile 42 } // namespace OHOS 43 44