diff --git a/frameworks/core/src/manager/ans_manager_proxy_utils.cpp b/frameworks/core/src/manager/ans_manager_proxy_utils.cpp index 97ed7314f9e4d4d2d110cedc925b7fe1306d2f88..013e4dbda85cb180dbff2185e7bac876d8bae305 100644 --- a/frameworks/core/src/manager/ans_manager_proxy_utils.cpp +++ b/frameworks/core/src/manager/ans_manager_proxy_utils.cpp @@ -128,11 +128,6 @@ ErrCode AnsManagerProxy::SetTargetDeviceStatus(const std::string &deviceType, co return ERR_ANS_PARCELABLE_FAILED; } - if (!data.WriteString(deveiceId)) { - ANS_LOGE("Set package config fail:: write deveiceId failed."); - return ERR_ANS_PARCELABLE_FAILED; - } - MessageParcel reply; MessageOption option = {MessageOption::TF_SYNC}; ErrCode result = InnerTransact(NotificationInterfaceCode::SET_TARGET_DEVICE_STATUS, option, data, reply); @@ -173,11 +168,6 @@ ErrCode AnsManagerProxy::SetTargetDeviceStatus(const std::string &deviceType, co return ERR_ANS_PARCELABLE_FAILED; } - if (!data.WriteString(deveiceId)) { - ANS_LOGE("Set package config fail:: write deveiceId failed."); - return ERR_ANS_PARCELABLE_FAILED; - } - MessageParcel reply; MessageOption option = {MessageOption::TF_SYNC}; ErrCode result = InnerTransact(NotificationInterfaceCode::SET_TARGET_DEVICE_STATUS_WITH_FLAG, option, data, reply); diff --git a/services/ans/src/ans_manager_stub.cpp b/services/ans/src/ans_manager_stub.cpp index 64132e5b3facf6274a87582166139eed2c1ee066..9465a24823b53a8e1e609f1fb23d55c40822cd25 100644 --- a/services/ans/src/ans_manager_stub.cpp +++ b/services/ans/src/ans_manager_stub.cpp @@ -2529,13 +2529,7 @@ ErrCode AnsManagerStub::HandleSetTargetDeviceStatus(MessageParcel &data, Message return ERR_ANS_PARCELABLE_FAILED; } - std::string deviceId; - if (!data.ReadString(deviceId)) { - ANS_LOGE("[HandleSetTargetDeviceStatus] fail: read deviceId failed"); - return ERR_ANS_PARCELABLE_FAILED; - } - - ErrCode result = SetTargetDeviceStatus(deviceType, status, deviceId); + ErrCode result = SetTargetDeviceStatus(deviceType, status, std::string()); if (!reply.WriteInt32(result)) { ANS_LOGE("[HandleSetTargetDeviceStatus] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED; @@ -2632,13 +2626,7 @@ ErrCode AnsManagerStub::HandleSetDeviceStatus(MessageParcel &data, MessageParcel return ERR_ANS_PARCELABLE_FAILED; } - std::string deviceId; - if (!data.ReadString(deviceId)) { - ANS_LOGE("[HandleSetTargetDeviceStatus] fail: read deviceId failed"); - return ERR_ANS_PARCELABLE_FAILED; - } - - ErrCode result = SetTargetDeviceStatus(deviceType, status, controlFlag, deviceId); + ErrCode result = SetTargetDeviceStatus(deviceType, status, controlFlag, std::string()); if (!reply.WriteInt32(result)) { ANS_LOGE("[HandleSetTargetDeviceStatus] fail: write result failed, ErrCode=%{public}d", result); return ERR_ANS_PARCELABLE_FAILED;