diff --git a/bundle.json b/bundle.json index bbef3846f5e5a9c855a656c583cbba5bf5f408d4..ea7c592483ca0e053ab209d7dbe685c11aacc34d 100644 --- a/bundle.json +++ b/bundle.json @@ -23,7 +23,7 @@ "components": [ "hilog_lite", "samgr_lite", - "ipc_lite", + "ipc_single", "kv_store", "aafwk_lite", "ace_engine_lite", diff --git a/services/BUILD.gn b/services/BUILD.gn index 7ab1d17e9ab6ec03c62f3e9c38c0b6806a4eadf7..4d99cea5a9697b9d3d45959d03a64d0f40c1084d 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -51,7 +51,7 @@ executable("appspawn") { deps = [ "${aafwk_lite_path}/frameworks/ability_lite:aafwk_abilitykit_lite", "//build/lite/config/component/cJSON:cjson_shared", - "//foundation/communication/ipc_lite:liteipc_adapter", + "//foundation/communication/ipc/interfaces/innerkits/c/ipc:ipc_single", "//foundation/distributedschedule/samgr_lite/samgr:samgr", "//third_party/bounds_checking_function:libsec_shared", "//utils/native/lite/kv_store:kv_store", diff --git a/services/src/appspawn_service.c b/services/src/appspawn_service.c index 66ed3b0965dadd60761401e809fd581adeb7589b..6d6752b3b2ef0b352b0db275bc27f5a06ac2ef16 100644 --- a/services/src/appspawn_service.c +++ b/services/src/appspawn_service.c @@ -24,7 +24,7 @@ #include "appspawn_process.h" #include "iproxy_server.h" #include "iunknown.h" -#include "liteipc_adapter.h" +#include "ipc_skeleton.h" #include "log.h" #include "message.h" #include "ohos_errno.h" @@ -99,29 +99,14 @@ static int GetMessageSt(MessageSt* msgSt, IpcIo* req) if (msgSt == NULL || req == NULL) { return EC_FAILURE; } -#ifdef __LINUX__ size_t len = 0; - char* str = IpcIoPopString(req, &len); + char* str = ReadString(req, &len); if (str == NULL || len == 0) { HILOG_ERROR(HILOG_MODULE_HIVIEW, "[appspawn] invoke, get data failed."); return EC_FAILURE; } int ret = SplitMessage(str, len, msgSt); // after split message, str no need to free(linux version) -#else - BuffPtr* dataPtr = IpcIoPopDataBuff(req); - if (dataPtr == NULL) { - HILOG_ERROR(HILOG_MODULE_HIVIEW, "[appspawn] invoke, get data failed."); - return EC_FAILURE; - } - - int ret = SplitMessage((char*)dataPtr->buff, dataPtr->buffSz, msgSt); - - // release buffer - if (FreeBuffer(NULL, dataPtr->buff) != LITEIPC_OK) { - HILOG_ERROR(HILOG_MODULE_HIVIEW, "[appspawn] invoke, free buffer failed!"); - } -#endif return ret; } @@ -138,14 +123,14 @@ static int Invoke(IServerProxy* iProxy, int funcId, void* origin, IpcIo* req, Ip if (reply == NULL || funcId != ID_CALL_CREATE_SERVICE || req == NULL) { HILOG_ERROR(HILOG_MODULE_HIVIEW, "[appspawn] invoke, funcId %{public}d invalid, reply %{public}d.", \ funcId, INVALID_PID); - IpcIoPushInt64(reply, INVALID_PID); + WriteInt64(reply, INVALID_PID); return EC_BADPTR; } MessageSt msgSt = {0}; if (GetMessageSt(&msgSt, req) != EC_SUCCESS) { HILOG_ERROR(HILOG_MODULE_HIVIEW, "[appspawn] invoke, parse failed! reply %{public}d.", INVALID_PID); - IpcIoPushInt64(reply, INVALID_PID); + WriteInt64(reply, INVALID_PID); return EC_FAILURE; } @@ -154,7 +139,7 @@ static int Invoke(IServerProxy* iProxy, int funcId, void* origin, IpcIo* req, Ip pid_t newPid = CreateProcess(&msgSt); FreeMessageSt(&msgSt); - IpcIoPushInt64(reply, newPid); + WriteInt64(reply, newPid); #ifdef OHOS_DEBUG struct timespec tmEnd = {0};