#include "PluginManager.h"
+#ifdef __TIZEN__
+#include <appfw/app_common.h>
+#endif
using namespace OIC;
PluginManager::PluginManager()
{
-/**
- * For Tizen Platform, specifiy the absolute location of dynamic library. It is required for
- * Tizen 2.3 EFL App to work.
- */
#ifdef __TIZEN__
- handle = dlopen("/opt/usr/apps/org.iotivity.service.ppm.ppmsampleapp/lib/libpmimpl.so",
- RTLD_LAZY);
+ char *app_id = NULL;
+ std::string completePath = "";
+ int res = app_get_id(&app_id);
+ if (APP_ERROR_NONE == res)
+ {
+ completePath = "/opt/usr/apps/";
+ completePath += app_id;
+ completePath += "/lib/libpmimpl.so";
+ }
+ free(app_id);
+ app_id = NULL;
+ handle = dlopen(completePath.c_str(), RTLD_LAZY);
#else
handle = dlopen("./libpmimpl.so", RTLD_LAZY);
#endif //#ifdef __TIZEN__
std::string PluginManager::getState(const std::string plugID)
{
return pluginManagerImpl->getState(plugID);
-}
\ No newline at end of file
+}