diff --git a/bundle.json b/bundle.json index 0f533f0d..de1b59e9 100644 --- a/bundle.json +++ b/bundle.json @@ -152,7 +152,6 @@ "test": [ "//foundation/communication/ipc/ipc/test:moduletest", "//foundation/communication/ipc/ipc/native/test:unittest", - "//foundation/communication/ipc/interfaces/innerkits/rust/tests:unittest", "//foundation/communication/ipc/ipc/native/test/fuzztest:fuzztest", "//foundation/communication/ipc/services/dbinder/test/unittest:unittest", "//foundation/communication/ipc/services/dbinder/test/fuzztest:fuzztest" diff --git a/ipc/native/src/core/BUILD.gn b/ipc/native/src/core/BUILD.gn index d1890c16..4f0d04d7 100644 --- a/ipc/native/src/core/BUILD.gn +++ b/ipc/native/src/core/BUILD.gn @@ -48,7 +48,6 @@ ohos_shared_library("ipc_common") { "c_utils:utils", "hilog:libhilog", "hisysevent:libhisysevent", - "json:nlohmann_json_static", ] defines = [ "FFRT_IPC_ENABLE" ] diff --git a/ipc/native/src/core/include/comm_auth_info.h b/ipc/native/src/core/include/comm_auth_info.h index 227e62f6..79aff9a8 100644 --- a/ipc/native/src/core/include/comm_auth_info.h +++ b/ipc/native/src/core/include/comm_auth_info.h @@ -22,7 +22,8 @@ namespace OHOS { class CommAuthInfo { public: - CommAuthInfo(IRemoteObject *stub, int pid, int uid, uint32_t tokenId, const std::string &deviceId); + CommAuthInfo(IRemoteObject *stub, int pid, int uid, uint32_t tokenId, + const std::string &deviceId, int32_t socketId = 0); virtual ~CommAuthInfo(); IRemoteObject *GetStubObject() const; int GetRemotePid() const; diff --git a/ipc/native/src/core/source/comm_auth_info.cpp b/ipc/native/src/core/source/comm_auth_info.cpp index 476fdc2f..8249c676 100644 --- a/ipc/native/src/core/source/comm_auth_info.cpp +++ b/ipc/native/src/core/source/comm_auth_info.cpp @@ -16,8 +16,10 @@ #include "comm_auth_info.h" namespace OHOS { -CommAuthInfo::CommAuthInfo(IRemoteObject *stub, int pid, int uid, uint32_t tokenId, const std::string &deviceId) - : stub_(stub), remotePid_(pid), remoteUid_(uid), tokenId_(tokenId), deviceId_(deviceId), socketId_(0) +CommAuthInfo::CommAuthInfo(IRemoteObject *stub, int pid, int uid, uint32_t tokenId, + const std::string &deviceId, int32_t socketId) + : stub_(stub), remotePid_(pid), remoteUid_(uid), + tokenId_(tokenId), deviceId_(deviceId), socketId_(socketId) {} CommAuthInfo::~CommAuthInfo() diff --git a/ipc/native/src/core/source/process_skeleton.cpp b/ipc/native/src/core/source/process_skeleton.cpp index bdb714a2..05b4214e 100644 --- a/ipc/native/src/core/source/process_skeleton.cpp +++ b/ipc/native/src/core/source/process_skeleton.cpp @@ -150,7 +150,6 @@ bool ProcessSkeleton::AttachObject(IRemoteObject *object, const std::u16string & { CHECK_INSTANCE_EXIT_WITH_RETVAL(exitFlag_, false); std::unique_lock lockGuard(objMutex_, std::defer_lock); - ZLOGD(LOG_LABEL, "The value of lockflag is:%{public}d", lockFlag); if (lockFlag) { lockGuard.lock(); } diff --git a/ipc/native/test/unittest/common/ipc_capi_parcel_unittest.cpp b/ipc/native/test/unittest/common/ipc_capi_parcel_unittest.cpp index 2504693f..8fedbfd0 100644 --- a/ipc/native/test/unittest/common/ipc_capi_parcel_unittest.cpp +++ b/ipc/native/test/unittest/common/ipc_capi_parcel_unittest.cpp @@ -131,8 +131,17 @@ uint32_t IpcCApiParcelUnitTest::CalcSpendTime(TimePoint& start, TimePoint& end) void IpcCApiParcelUnitTest::PerformanceStatistic(uint32_t writeAvg, uint32_t readAvg, uint32_t writeCppAvg, uint32_t readCppAvg) { + static constexpr uint32_t percent = 100; + static constexpr uint32_t percentRange = 105; + static constexpr uint32_t errorValue = 5000; // ns std::cout << "OHIPCParcel writeAvg:" << writeAvg << "ns, readAvg:" << readAvg << "ns" << std::endl; std::cout << "MessageParcel writeAvg:" << writeCppAvg << "ns, readAvg:" << readCppAvg << "ns" << std::endl; + if (writeCppAvg >= errorValue) { + ASSERT_LE(writeAvg * percent, writeCppAvg * percentRange); + } + if (readCppAvg >= errorValue) { + ASSERT_LE(readAvg * percent, readCppAvg * percentRange); + } } void IpcCApiParcelUnitTest::ReadWriteString(const char *str, uint32_t &writeDuration, uint32_t &readDuration) diff --git a/ipc/test/BUILD.gn b/ipc/test/BUILD.gn index 2a825768..cd9a89db 100644 --- a/ipc/test/BUILD.gn +++ b/ipc/test/BUILD.gn @@ -15,7 +15,6 @@ import("//build/test.gni") SUBSYSTEM_DIR = "//foundation/communication/ipc" IPC_TEST_ROOT = "//foundation/communication/ipc/ipc/test" -IPC_CORE_ROOT = "//foundation/communication/ipc/ipc/native/c" config("ipc_test_config") { include_dirs = [ @@ -24,7 +23,6 @@ config("ipc_test_config") { "$SUBSYSTEM_DIR/utils/include", "$SUBSYSTEM_DIR/ipc/native/src/mock/include", "$SUBSYSTEM_DIR/interfaces/innerkits/c_api/include", - "$IPC_CORE_ROOT/src/c_api/include", ] } diff --git a/services/dbinder/dbinder_service/src/dbinder_service.cpp b/services/dbinder/dbinder_service/src/dbinder_service.cpp index 3e0d64d3..d08986a2 100644 --- a/services/dbinder/dbinder_service/src/dbinder_service.cpp +++ b/services/dbinder/dbinder_service/src/dbinder_service.cpp @@ -530,7 +530,7 @@ std::shared_ptr DBinderService::PopLoadSaItem(const std::strin std::lock_guard lockGuard(loadSaMutex_); auto it = std::find_if(loadSaReply_.begin(), loadSaReply_.end(), checkSaItem); if (it == loadSaReply_.end()) { - DBINDER_LOGI(LOG_LABEL, "findSaItem failed saId:%{public}d, deviceId:%{public}s", + DBINDER_LOGI(LOG_LABEL, "no msg for saId:%{public}d, deviceId:%{public}s", systemAbilityId, DBinderService::ConvertToSecureDeviceID(srcNetworkId).c_str()); return nullptr; } @@ -670,6 +670,7 @@ bool DBinderService::OnRemoteInvokerMessage(std::shared_ptr re return true; } -uint32_t DBinderService::OnRemoteInvokerDataBusMessage(IPCObjectProxy *proxy, std::shared_ptr replyMessage, +uint32_t DBinderService::OnRemoteInvokerDataBusMessage(IPCObjectProxy *proxy, + std::shared_ptr replyMessage, std::string &remoteDeviceId, int pid, int uid, uint32_t tokenId) { if (CheckDeviceIdIllegal(remoteDeviceId)) {