diff --git a/include/appspawn_server.h b/include/appspawn_server.h index b210bc599d5ca5a107ca13118702e7ce7c996e7b..c73cf79fa9fa00cf026a1a9e3f403ae67b695ce2 100644 --- a/include/appspawn_server.h +++ b/include/appspawn_server.h @@ -143,13 +143,6 @@ 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"; std::string socketName_ {}; diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp index 2959d92085aaadadcd4ee2b1c1c016da9c480deb..0c5f75884302ba7ffe1a5811bdfea819b07e9c00 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,9 +157,14 @@ void AppSpawnServer::ConnectionPeer() } } -#ifdef ACEABILITY_LIBRARY_LOADER -void AppSpawnServer::LoadAceLib() +bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen) { + if (socket_->RegisterServerSocket() != 0) { + HiLog::Error(LABEL, "AppSpawnServer::Failed to register server socket"); + return false; + } + std::thread(&AppSpawnServer::ConnectionPeer, this).detach(); + std::string acelibdir("/system/lib/libace.z.so"); void *AceAbilityLib = nullptr; HiLog::Info(LABEL, "MainThread::LoadAbilityLibrary. Start calling dlopen acelibdir."); @@ -172,19 +175,7 @@ void AppSpawnServer::LoadAceLib() HiLog::Info(LABEL, "Success to dlopen %{public}s", acelibdir.c_str()); } HiLog::Info(LABEL, "MainThread::LoadAbilityLibrary. End calling dlopen."); -} -#endif -bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen) -{ - if (socket_->RegisterServerSocket() != 0) { - HiLog::Error(LABEL, "AppSpawnServer::Failed to register server socket"); - 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(); });