From 50c9ad0df0181aa3570c0fe8dfe1bd689bd69d3a Mon Sep 17 00:00:00 2001 From: wanghaixiang Date: Mon, 23 Aug 2021 17:37:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E8=8C=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanghaixiang --- .../ipc/src/hks_samgr_client_proxy.c | 17 ++++++++++------- .../os_dependency/sa/sa_mgr/hks_samgr_server.h | 1 + .../os_dependency/sa/sa_mgr/service_pro_main.c | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/frameworks/huks_standard/main/os_dependency/ipc/src/hks_samgr_client_proxy.c b/frameworks/huks_standard/main/os_dependency/ipc/src/hks_samgr_client_proxy.c index 1be18d00..da25ca07 100755 --- a/frameworks/huks_standard/main/os_dependency/ipc/src/hks_samgr_client_proxy.c +++ b/frameworks/huks_standard/main/os_dependency/ipc/src/hks_samgr_client_proxy.c @@ -26,14 +26,16 @@ volatile bool g_messageRecived = false; volatile int32_t g_result = HKS_ERROR_UNKNOWN_ERROR; volatile int32_t g_sleepTimeout = SLEEP_SECOND_TIMEOUT; -static void UpdaeGlobalStatus(uint32_t outBlobSize, bool messageRecived, int32_t result, int32_t sleepTime) { +static void UpdaeGlobalStatus(uint32_t outBlobSize, bool messageRecived, int32_t result, int32_t sleepTime) +{ g_outBlob.size = outBlobSize; g_result = result; - g_sleepTimeout= sleepTime; + g_sleepTimeout = sleepTime; g_messageRecived = messageRecived; } -static int32_t SynchronizeOutput(struct HksBlob *outBlob) { +static int32_t SynchronizeOutput(struct HksBlob *outBlob) +{ while (!g_messageRecived) { g_sleepTimeout -= SLEEP_SECOND_TIME; usleep(SLEEP_SECOND_TIME); @@ -99,7 +101,6 @@ static int CurrentCallback(IOwner owner, int code, IpcIo *reply) g_outBlob.data = dataBuf; UpdaeGlobalStatus(len, true, g_result, SLEEP_SECOND_TIMEOUT); return HKS_SUCCESS; - } static int32_t IpcAsyncCall(IUnknown *iUnknown, enum HksMessage type, const struct HksBlob *inBlob, @@ -163,16 +164,18 @@ void HKS_DestroyClient(const char *service, const char *feature, void *iproxy) free(iproxy); } -int32_t HksSamgrInitialize(void) { +int32_t HksSamgrInitialize(void) +{ int32_t ret = SAMGR_RegisterFectory(HKS_SAMGR_SERVICE, HKS_SAMGR_FEATRURE, HKS_CreatClient, HKS_DestroyClient); if (ret != HKS_SUCCESS) { - return HKS_FAILURE; + return HKS_FAILURE; } SAMGR_Bootstrap(); return HKS_SUCCESS; } -static int32_t HksSendRequestSync(enum HksMessage type, const struct HksBlob *inBlob, struct HksBlob *outBlob) { +static int32_t HksSendRequestSync(enum HksMessage type, const struct HksBlob *inBlob, struct HksBlob *outBlob) +{ HksMgrClientApi *clientProxy; IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(HKS_SAMGR_SERVICE, HKS_SAMGR_FEATRURE); if (iUnknown == NULL) { diff --git a/services/huks_standard/huks_service/main/os_dependency/sa/sa_mgr/hks_samgr_server.h b/services/huks_standard/huks_service/main/os_dependency/sa/sa_mgr/hks_samgr_server.h index 920afa0d..b85866e7 100755 --- a/services/huks_standard/huks_service/main/os_dependency/sa/sa_mgr/hks_samgr_server.h +++ b/services/huks_standard/huks_service/main/os_dependency/sa/sa_mgr/hks_samgr_server.h @@ -17,6 +17,7 @@ #define HKS_SAMGR_SERVER_H #include + #include #include "iproxy_server.h" diff --git a/services/huks_standard/huks_service/main/os_dependency/sa/sa_mgr/service_pro_main.c b/services/huks_standard/huks_service/main/os_dependency/sa/sa_mgr/service_pro_main.c index ce0f5ac4..bdfa48fe 100755 --- a/services/huks_standard/huks_service/main/os_dependency/sa/sa_mgr/service_pro_main.c +++ b/services/huks_standard/huks_service/main/os_dependency/sa/sa_mgr/service_pro_main.c @@ -14,6 +14,7 @@ */ #include + #include "samgr_lite.h" void __attribute__((weak)) OHOS_SystemInit(void) -- Gitee