From e7293ff0e39e6da7b72a71d2c3318f2185ba2534 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Sun, 6 Apr 2025 16:04:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3TDD=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- .../core/src/manager/ans_manager_proxy_utils.cpp | 10 ---------- services/ans/src/ans_manager_stub.cpp | 16 ++-------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/frameworks/core/src/manager/ans_manager_proxy_utils.cpp b/frameworks/core/src/manager/ans_manager_proxy_utils.cpp index 97ed7314f..013e4dbda 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 64132e5b3..9465a2482 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; -- Gitee