diff --git a/tools/aa/src/test_observer_proxy.cpp b/tools/aa/src/test_observer_proxy.cpp index 1721a9e7ad27a0e1d56d2e2047ae33bf41846e7e..84a29cb50b594b23dca80adbffea9bde3901903b 100644 --- a/tools/aa/src/test_observer_proxy.cpp +++ b/tools/aa/src/test_observer_proxy.cpp @@ -39,7 +39,6 @@ void TestObserverProxy::TestStatus(const std::string &msg, const int &resultCode if (!data.WriteInterfaceToken(GetDescriptor())) { return; } - sptr remote = Remote(); if (remote == nullptr) { HILOG_ERROR("Failed to send cmd to service due to remote object is null"); @@ -75,7 +74,6 @@ void TestObserverProxy::TestFinished(const std::string &msg, const int &resultCo if (!data.WriteInterfaceToken(GetDescriptor())) { return; } - sptr remote = Remote(); if (remote == nullptr) { HILOG_ERROR("Failed to send cmd to service due to remote object is null"); @@ -113,7 +111,6 @@ ShellCommandResult TestObserverProxy::ExecuteShellCommand( if (!data.WriteInterfaceToken(GetDescriptor())) { return result; } - sptr remote = Remote(); if (remote == nullptr) { HILOG_ERROR("Failed to send cmd to service due to remote object is null"); diff --git a/zidl/test/native/src/zidl_test_service_proxy.cpp b/zidl/test/native/src/zidl_test_service_proxy.cpp index d9f3e88a7601f611d00afdb15cc4242643ab48e0..dec88363b3f97c29b70a584a485e0726beb87fea 100644 --- a/zidl/test/native/src/zidl_test_service_proxy.cpp +++ b/zidl/test/native/src/zidl_test_service_proxy.cpp @@ -27,7 +27,6 @@ ErrCode ZidlTestServiceProxy::TestIntTransaction( if (!data.WriteInterfaceToken(GetDescriptor())) { return ERR_INVALID_VALUE; } - data.WriteInt32(_data); int32_t st = Remote()->SendRequest(COMMAND_TEST_INT_TRANSACTION, data, reply, option); @@ -50,11 +49,10 @@ ErrCode ZidlTestServiceProxy::TestStringTransaction( MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); - + if (!data.WriteInterfaceToken(GetDescriptor())) { return ERR_INVALID_VALUE; } - data.WriteString16(Str8ToStr16(_data)); int32_t st = Remote()->SendRequest(COMMAND_TEST_STRING_TRANSACTION, data, reply, option);