[Fix review comments] Modify plugin directory path
authorAtul Rai <a.rai@samsung.com>
Thu, 14 Mar 2019 06:01:45 +0000 (11:31 +0530)
committersaerome.kim <saerome.kim@samsung.com>
Fri, 15 Mar 2019 04:42:18 +0000 (13:42 +0900)
Signed-off-by: Atul Rai <a.rai@samsung.com>
ua-daemon/include/ua-manager-common.h
ua-daemon/src/pm/ua-plugin-manager.c
ua-daemon/src/ua-manager-core.c

index faf9394..b838e96 100644 (file)
@@ -54,7 +54,7 @@ extern "C" {
 #define FUNC_ENTRY UAM_DBG("+")
 #define FUNC_EXIT UAM_DBG("-")
 
-#define PLUGIN_DIR tzplatform_mkpath(TZ_SYS_GLOBALUSER_DATA, "network/ua/lib")
+#define SENSOR_PLUGIN_DIR tzplatform_mkpath(TZ_SYS_GLOBALUSER_DATA, "network/ua/lib/sensor")
 #ifdef VD_REQ
 #define POWER_PLUGIN_DIR tzplatform_mkpath(TZ_SYS_GLOBALUSER_DATA, "network/ua/lib/power")
 #define CLOUD_PLUGIN_DIR tzplatform_mkpath(TZ_SYS_GLOBALUSER_DATA, "network/ua/lib/cloud")
index 42e371d..3a13745 100644 (file)
@@ -136,11 +136,11 @@ static int __load_sensor_plugins(void)
        const char *filename;
        int ret = UAM_ERROR_INTERNAL;
 
-       retv_if(0 == strlen(PLUGIN_DIR), UAM_ERROR_INVALID_PARAM);
+       retv_if(0 == strlen(SENSOR_PLUGIN_DIR), UAM_ERROR_INVALID_PARAM);
 
-       UAM_DBG("Loading plugins from %s", PLUGIN_DIR);
+       UAM_DBG("Loading plugins from %s", SENSOR_PLUGIN_DIR);
 
-       dir = g_dir_open(PLUGIN_DIR, 0, NULL);
+       dir = g_dir_open(SENSOR_PLUGIN_DIR, 0, NULL);
        if (!dir) {
                UAM_ERR("Unable to open directory");
                return UAM_ERROR_INTERNAL;
@@ -153,7 +153,7 @@ static int __load_sensor_plugins(void)
 
                /* If atleast one plugin is loaded, return value is UAM_ERROR_NONE */
                if (UAM_ERROR_NONE == __load_plugin(
-                                       PLUGIN_DIR, filename, "uas_module"))
+                                       SENSOR_PLUGIN_DIR, filename, "uas_module"))
                        ret = UAM_ERROR_NONE;
 
        }
index 64c8783..ae5d0fe 100644 (file)
 
 #include "ua-manager-database.h"
 #include "ua-manager-config-parser.h"
+#include "ua-cloud-plugin-handler.h"
 
 #ifdef VD_REQ
 #include "ua-power-plugin-manager.h"
-#include "ua-cloud-plugin-handler.h"
 #endif
 
 #define UAM_MAX_USERS 255
@@ -240,10 +240,9 @@ static void __free_uam_db_user_info(gpointer data)
        if (UAM_ERROR_NONE != _uam_pm_set_registered_devices(devices))
                UAM_ERR("_uam_pm_set_registered_devices failed");
 
-#ifdef VD_REQ
        /* Set/update registered device list to cloud plugin */
        _uam_cloud_set_registered_devices(devices);
-#endif
+
        __uam_core_release_user_id(user->user_id);
        g_free(user->name);
        g_free(user->account);
@@ -815,10 +814,9 @@ int _uam_core_remove_device(const char *account, const uam_device_info_t *dev_in
        if (UAM_ERROR_NONE != _uam_pm_set_registered_devices(devices))
                UAM_ERR("_uam_pm_set_registered_devices failed");
 
-#ifdef VD_REQ
        /* Set/update registered device list to cloud plugin */
        _uam_cloud_set_registered_devices(devices);
-#endif
+
        FUNC_EXIT;
        return UAM_ERROR_NONE;
 }
@@ -887,10 +885,9 @@ int _uam_core_remove_device_by_device_id(const char *device_id, int tech_type)
        if (UAM_ERROR_NONE != _uam_pm_set_registered_devices(devices))
                UAM_ERR("_uam_pm_set_registered_devices failed");
 
-#ifdef VD_REQ
        /* Set/update registered device list to cloud plugin */
        _uam_cloud_set_registered_devices(devices);
-#endif
+
        FUNC_EXIT;
        return UAM_ERROR_NONE;
 }
@@ -949,10 +946,9 @@ int _uam_core_remove_device_by_mac(const char *mac)
        if (UAM_ERROR_NONE != _uam_pm_set_registered_devices(devices))
                UAM_ERR("_uam_pm_set_registered_devices failed");
 
-#ifdef VD_REQ
        /* Set/update registered device list to cloud plugin */
        _uam_cloud_set_registered_devices(devices);
-#endif
+
        FUNC_EXIT;
        return UAM_ERROR_NONE;
 }
@@ -1484,10 +1480,9 @@ int _uam_core_init(void)
        if (UAM_ERROR_NONE != _uam_pm_set_registered_devices(devices))
                UAM_ERR("_uam_pm_set_registered_devices failed");
 
-#ifdef VD_REQ
        /* Set/update registered device list to cloud plugin */
        _uam_cloud_set_registered_devices(devices);
-#endif
+
        FUNC_EXIT;
        return UAM_ERROR_NONE;
 }
@@ -1630,13 +1625,11 @@ void _uam_core_handle_device_added(int status,
                        UAM_ERR("_uam_pm_set_registered_devices failed");
        }
 
-#ifdef VD_REQ
        _uam_cloud_send_device_added(status, user_id, dev_info);
 
        /* Set/update registered device list to cloud plugin */
        if (UAM_ERROR_NONE == status)
                _uam_cloud_set_registered_devices(devices);
-#endif
 
        FUNC_EXIT;
 }
@@ -1907,9 +1900,8 @@ void _uam_core_reset_database(void)
                UAM_ERR("_uam_pm_set_registered_devices failed with %s",
                                _uam_manager_error_to_str(ret));
 
-#ifdef VD_REQ
        /* Set/update registered device list to cloud plugin */
        _uam_cloud_set_registered_devices(devices);
-#endif
+
        FUNC_EXIT;
 }