diff --git a/include/appspawn_server.h b/include/appspawn_server.h index b210bc599d5ca5a107ca13118702e7ce7c996e7b..281eb5a3535e00e6162bee753ba5ed5470ce59b4 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 2959d92085aaadadcd4ee2b1c1c016da9c480deb..9e238409ad41ac139353d796b7bffa3cff86ed28 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 33422757e190970eb1ff7b0372b4b88d5b32ea75..8956e0c272b9963f3929e3282b2d4dbfcb0879f2 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;