From a748f040a148586085dc9d667fe2aac9f7f11bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=83=B3=E4=B8=8D=E5=87=BA=E5=88=AB=E5=90=8D?= Date: Sat, 18 Sep 2021 10:36:48 +0800 Subject: [PATCH 1/2] test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 想不出别名 --- .../native_cpp/src/ipc/lite/ipc_cmd_parser.cpp | 16 ++-------------- .../src/ipc/lite/ipc_cmd_parser.cpp | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp index bd67cd215..68048a879 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp @@ -193,7 +193,7 @@ ON_IPC_CMD(SERVER_DEVICE_STATE_NOTIFY, IpcIo &reply) DmDeviceState deviceState = static_cast(IpcIoPopInt32(&reply)); uint32_t size; const DmDeviceInfo *deviceInfo = (const DmDeviceInfo*)IpcIoPopFlatObj(&reply, &size); - if (pkgName == "" || len == 0 || deviceInfo == NULL) { + if (deviceInfo == NULL) { DMLOG(DM_LOG_ERROR, "OnDeviceOnline, get para failed"); return; } @@ -220,7 +220,7 @@ ON_IPC_CMD(SERVER_DEVICE_FOUND, IpcIo &reply) uint16_t subscribeId = IpcIoPopUint16(&reply); uint32_t size; const DmDeviceInfo *deviceInfo = (const DmDeviceInfo*)IpcIoPopFlatObj(&reply, &size); - if (pkgName == "" || len == 0 || deviceInfo == NULL) { + if (deviceInfo == NULL) { DMLOG(DM_LOG_ERROR, "OnDeviceChanged, get para failed"); return; } @@ -234,10 +234,6 @@ ON_IPC_CMD(SERVER_DISCOVER_FINISH, IpcIo &reply) uint16_t subscribeId = IpcIoPopUint16(&reply); int32_t failedReason = IpcIoPopInt32(&reply); - if (pkgName == "" || len == 0) { - DMLOG(DM_LOG_ERROR, "OnDiscoverySuccess, get para failed"); - return; - } if (failedReason == DEVICEMANAGER_OK) { DeviceManagerNotify::GetInstance().OnDiscoverySuccess(pkgName, subscribeId); } else { @@ -255,10 +251,6 @@ ON_IPC_CMD(SERVER_AUTH_RESULT, IpcIo &reply) int32_t status = IpcIoPopInt32(&reply); int32_t reason = IpcIoPopInt32(&reply); - if (pkgName == "" || len == 0 || deviceId == "" || devIdLen == 0) { - DMLOG(DM_LOG_ERROR, "OnAuthResult, get para failed"); - return; - } DeviceManagerNotify::GetInstance().OnAuthResult(pkgName, deviceId, pinToken, status, reason); } @@ -271,10 +263,6 @@ ON_IPC_CMD(SERVER_CHECK_AUTH_RESULT, IpcIo &reply) int32_t resultCode = IpcIoPopInt32(&reply); int32_t flag = IpcIoPopInt32(&reply); - if (pkgName == "" || len == 0 || deviceId == "" || devIdLen == 0) { - DMLOG(DM_LOG_ERROR, "OnAuthResult, get para failed"); - return; - } DeviceManagerNotify::GetInstance().OnCheckAuthResult(pkgName, deviceId, resultCode, flag); } diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp index b71b3edfd..fa24048c7 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp @@ -40,7 +40,7 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_STATE_NOTIFY, std::shared_ptr pBaseReq, DmDeviceInfo deviceInfo = pReq->GetDeviceInfo(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str()); + IpcIoPushString(&request, pkgName.c_str());; IpcIoPushInt32(&request, deviceState); IpcIoPushFlatObj(&request, &deviceInfo, sizeof(DmDeviceInfo)); return DEVICEMANAGER_OK; -- Gitee From 46b496aa1814dd16ffb4b2603d5ad6730183a4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=83=B3=E4=B8=8D=E5=87=BA=E5=88=AB=E5=90=8D?= Date: Sat, 18 Sep 2021 11:12:49 +0800 Subject: [PATCH 2/2] test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 想不出别名 --- services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp index fa24048c7..250af2661 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp @@ -40,7 +40,7 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_STATE_NOTIFY, std::shared_ptr pBaseReq, DmDeviceInfo deviceInfo = pReq->GetDeviceInfo(); IpcIoInit(&request, buffer, buffLen, 0); - IpcIoPushString(&request, pkgName.c_str());; + IpcIoPushString(&request, pkgName.c_str());-; IpcIoPushInt32(&request, deviceState); IpcIoPushFlatObj(&request, &deviceInfo, sizeof(DmDeviceInfo)); return DEVICEMANAGER_OK; -- Gitee