Fix Ace library load micro define problem

Signed-off-by: guozejun <guozejun@huawei.com>
Change-Id: I68b3d7bea3d9632aadde6e6f4daf78e43b345e0d
This commit is contained in:
guozejun 2021-09-27 10:37:17 +08:00
parent c1b57614ac
commit 1ab1cb0b06
3 changed files with 5 additions and 11 deletions

View File

@ -143,12 +143,7 @@ private:
*/ */
bool CheckAppProperty(const ClientSocket::AppProperty *appProperty); bool CheckAppProperty(const ClientSocket::AppProperty *appProperty);
#ifdef ACEABILITY_LIBRARY_LOADER
/**
* Load libace.z.so library when boot the devices
*/
void LoadAceLib(); void LoadAceLib();
#endif
private: private:
const std::string deviceNull_ = "/dev/null"; const std::string deviceNull_ = "/dev/null";

View File

@ -28,10 +28,8 @@
#include "main_thread.h" #include "main_thread.h"
#include "securec.h" #include "securec.h"
#if defined(ABILITY_LIBRARY_LOADER) || defined(APPLICATION_LIBRARY_LOADER)
#include <dirent.h> #include <dirent.h>
#include <dlfcn.h> #include <dlfcn.h>
#endif
#define GRAPHIC_PERMISSION_CHECK #define GRAPHIC_PERMISSION_CHECK
constexpr static size_t ERR_STRING_SZ = 64; constexpr static size_t ERR_STRING_SZ = 64;
@ -159,7 +157,6 @@ void AppSpawnServer::ConnectionPeer()
} }
} }
#ifdef ACEABILITY_LIBRARY_LOADER
void AppSpawnServer::LoadAceLib() void AppSpawnServer::LoadAceLib()
{ {
std::string acelibdir("/system/lib/libace.z.so"); std::string acelibdir("/system/lib/libace.z.so");
@ -173,7 +170,6 @@ void AppSpawnServer::LoadAceLib()
} }
HiLog::Info(LABEL, "MainThread::LoadAbilityLibrary. End calling dlopen."); HiLog::Info(LABEL, "MainThread::LoadAbilityLibrary. End calling dlopen.");
} }
#endif
bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen) bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen)
{ {
@ -182,9 +178,9 @@ bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen)
return false; return false;
} }
std::thread(&AppSpawnServer::ConnectionPeer, this).detach(); std::thread(&AppSpawnServer::ConnectionPeer, this).detach();
#ifdef ACEABILITY_LIBRARY_LOADER
LoadAceLib(); LoadAceLib();
#endif
while (isRunning_) { while (isRunning_) {
std::unique_lock<std::mutex> lock(mut_); std::unique_lock<std::mutex> lock(mut_);
dataCond_.wait(lock, [this] { return !this->appQueue_.empty(); }); dataCond_.wait(lock, [this] { return !this->appQueue_.empty(); });

View File

@ -24,6 +24,9 @@
#undef private #undef private
#undef protected #undef protected
#include <dirent.h>
#include <dlfcn.h>
using namespace testing; using namespace testing;
using namespace testing::ext; using namespace testing::ext;
using namespace OHOS::AppSpawn; using namespace OHOS::AppSpawn;