#define CHROMIUM_UPGRADE_LIB_PATH \
LIB_UPGRADE_ROOT_DIR "/lib/" CHROMIUM_IMPL_LIB_FILE
+
#include <lwipc.h>
#include <ttrace.h>
-#include <privileged-service/PS_API.h>
#include <sys/resource.h>
#endif
const unsigned int kPSAgentTimeout = 30000;
#if TIZEN_VERSION_AT_LEAST(7, 0, 0)
+const char* kPrivilegeServiceLibPath = "libprivileged-service-client.so";
+
bool WaitPSAgentReady() {
static bool ps_agent_ready = false;
if (ps_agent_ready)
LOG(INFO) << "mount args: \"" << args << "\"";
- rv = PS_Mount_Fast(args, strlen(args) + 1, 1, &result);
+ auto ps_handle_ = dlopen(kPrivilegeServiceLibPath, RTLD_LAZY);
+ if (!ps_handle_) {
+ LOG(ERROR) << "dlopen() fail : " << dlerror();
+ return;
+ }
+ typedef int (*ps_mount)(const char*, size_t, int, int*);
+ ps_mount PS_Mount = nullptr;
+ PS_Mount = (ps_mount)dlsym(ps_handle_, "PS_Mount_Fast");
+ if (!PS_Mount)
+ PS_Mount = (ps_mount)dlsym(ps_handle_, "PS_Mount");
+ if (!PS_Mount) {
+ LOG(ERROR) << "dlsym() fail : " << dlerror();
+ return;
+ }
+ rv = PS_Mount(args, strlen(args) + 1, 1, &result);
LOG(INFO) << "result = " << rv << ", " << result;
if (rv != 0 || result != 0) {
LOG(ERROR) << "mount failed. (" << rv << ", " << result << ")";