From 1ab1cb0b06763bb60202d884aaebdeb25e141cd9 Mon Sep 17 00:00:00 2001 From: guozejun Date: Mon, 27 Sep 2021 10:37:17 +0800 Subject: [PATCH] fixed 53e444f from https://gitee.com/guozejun/startup_appspawn/pulls/41 Fix Ace library load micro define problem Signed-off-by: guozejun Change-Id: I68b3d7bea3d9632aadde6e6f4daf78e43b345e0d --- include/appspawn_server.h | 5 ----- src/appspawn_server.cpp | 8 ++------ .../app_spawn_server_override_test.cpp | 3 +++ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/appspawn_server.h b/include/appspawn_server.h index b210bc59..281eb5a3 100644 --- a/include/appspawn_server.h +++ b/include/appspawn_server.h @@ -143,12 +143,7 @@ private: */ bool CheckAppProperty(const ClientSocket::AppProperty *appProperty); -#ifdef ACEABILITY_LIBRARY_LOADER - /** - * Load libace.z.so library when boot the devices - */ void LoadAceLib(); -#endif private: const std::string deviceNull_ = "/dev/null"; diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp index 2959d920..9e238409 100644 --- a/src/appspawn_server.cpp +++ b/src/appspawn_server.cpp @@ -28,10 +28,8 @@ #include "main_thread.h" #include "securec.h" -#if defined(ABILITY_LIBRARY_LOADER) || defined(APPLICATION_LIBRARY_LOADER) #include #include -#endif #define GRAPHIC_PERMISSION_CHECK constexpr static size_t ERR_STRING_SZ = 64; @@ -159,7 +157,6 @@ void AppSpawnServer::ConnectionPeer() } } -#ifdef ACEABILITY_LIBRARY_LOADER void AppSpawnServer::LoadAceLib() { std::string acelibdir("/system/lib/libace.z.so"); @@ -173,7 +170,6 @@ void AppSpawnServer::LoadAceLib() } HiLog::Info(LABEL, "MainThread::LoadAbilityLibrary. End calling dlopen."); } -#endif bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen) { @@ -182,9 +178,9 @@ bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen) return false; } std::thread(&AppSpawnServer::ConnectionPeer, this).detach(); -#ifdef ACEABILITY_LIBRARY_LOADER + LoadAceLib(); -#endif + while (isRunning_) { std::unique_lock lock(mut_); dataCond_.wait(lock, [this] { return !this->appQueue_.empty(); }); diff --git a/test/unittest/app_spawn_server_test/app_spawn_server_override_test.cpp b/test/unittest/app_spawn_server_test/app_spawn_server_override_test.cpp index 33422757..8956e0c2 100644 --- a/test/unittest/app_spawn_server_test/app_spawn_server_override_test.cpp +++ b/test/unittest/app_spawn_server_test/app_spawn_server_override_test.cpp @@ -24,6 +24,9 @@ #undef private #undef protected +#include +#include + using namespace testing; using namespace testing::ext; using namespace OHOS::AppSpawn;