Tizen 2.4 SDK Rev6 Release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20160530.220051 submit/tizen_2.4/20160530.023047
authorJaekyu Park <jk7744.park@samsung.com>
Fri, 27 May 2016 07:55:05 +0000 (16:55 +0900)
committerJaekyu Park <jk7744.park@samsung.com>
Fri, 27 May 2016 07:55:05 +0000 (16:55 +0900)
include/buffer_handler.h
packaging/data-provider-master.spec
pkgmgr_widget/CMakeLists.txt
pkgmgr_widget/common/src/common.c
src/buffer_handler.c
src/buffer_handler_wayland.c
src/notification_service.c
src/script_handler.c
src/server.c

index f3b0b3d..0083869 100644 (file)
@@ -74,7 +74,7 @@ extern int buffer_handler_resize(struct buffer_info *info, int w, int h, int pix
  * \param[in] h
  * \return void
  */
-extern void buffer_handler_update_size(struct buffer_info *info, int w, int h);
+extern void buffer_handler_update_size(struct buffer_info *info, int w, int h, int pixel_size);
 
 /*!
  * \brief
index e0220cf..bbc9621 100644 (file)
@@ -2,7 +2,7 @@
 
 Name: data-provider-master
 Summary: Master service provider for widgetes
-Version: 1.3.0
+Version: 1.3.2
 Release: 1
 Group: Applications/Core Applications
 License: Flora-1.1
@@ -19,6 +19,7 @@ BuildRequires: pkgconfig(gio-2.0)
 BuildRequires: pkgconfig(libsmack)
 BuildRequires: pkgconfig(bundle)
 BuildRequires: pkgconfig(capi-appfw-app-manager)
+BuildRequires: pkgconfig(capi-system-info)
 
 %if %{with wayland}
 BuildRequires: pkgconfig(ecore-wayland)
@@ -178,11 +179,10 @@ chown ${SYSTEM}:${APP_GID} /opt/dbspace/.widget.db
 chmod 640 /opt/dbspace/.widget.db
 chown ${SYSTEM}:${APP_GID} /opt/dbspace/.widget.db-journal
 chmod 640 /opt/dbspace/.widget.db-journal
-mv /opt/usr/share/live_magazine/widget.lck /opt/usr/share/live_magazine/.widget.lck
-
-
-
+chsmack -a 'data-provider-master::db' /opt/dbspace/.widget.db
+chsmack -a 'data-provider-master::db' /opt/dbspace/.widget.db-journal
 
+mv /opt/usr/share/live_magazine/widget.lck /opt/usr/share/live_magazine/.widget.lck
 
 echo "Successfully installed. Please start a daemon again manually"
 
index 5454dc8..5e860b3 100644 (file)
@@ -8,6 +8,7 @@ pkg_check_modules(bin_pkgs REQUIRED
        libxml-2.0
        db-util
        widget_service
+       capi-system-info
 )
 
 FOREACH(flag ${bin_pkgs_CFLAGS})
index e34246e..91c2e42 100644 (file)
@@ -28,6 +28,7 @@
 #include <libxml/tree.h>
 #include <dlog.h>
 #include <pkgmgr-info.h>
+#include <system_info.h>
 
 #include <widget_service.h>
 #include <widget_service_internal.h>
@@ -45,6 +46,7 @@
 #define SCHEME_HTTP    "http://"
 #define SCHEME_HTTPS   "https://"
 #define SCHEME_FILE    "file://"
+#define SHARED_RES_PATH "/shared/res/"
 
 #if !defined(WIDGET_COUNT_OF_SIZE_TYPE)
 #define WIDGET_COUNT_OF_SIZE_TYPE 13
@@ -220,11 +222,45 @@ struct option {
 static struct {
        const char *dbfile;
        sqlite3 *handle;
+       struct _resolution {
+               int initialized;
+               int width;
+               int height;
+       } resolution;
 } s_info = {
        .dbfile = "/opt/dbspace/.widget.db",
        .handle = NULL,
+       .resolution = {
+               .initialized = 0,
+               .width = 0,
+               .height = 0,
+       },
 };
 
+static void initialize_resolution(void)
+{
+       int ret;
+
+       if (s_info.resolution.initialized) {
+               return;
+       }
+
+       ret = system_info_get_platform_int("http://tizen.org/feature/screen.width", &s_info.resolution.width);
+       if (ret != SYSTEM_INFO_ERROR_NONE) {
+               ErrPrint("Failed to get platform value\n");
+               return;
+       }
+
+       ret = system_info_get_platform_int("http://tizen.org/feature/screen.height", &s_info.resolution.height);
+       if (ret != SYSTEM_INFO_ERROR_NONE) {
+               ErrPrint("Failed to get platform value\n");
+               return;
+       }
+
+       s_info.resolution.initialized = 1;
+       return;
+}
+
 static int is_scheme(const char *path)
 {
        if (!strncasecmp(path, SCHEME_HTTP, strlen(SCHEME_HTTP))) {
@@ -326,10 +362,11 @@ static inline void abspath(const char* pBuffer, char* pRet)
  * And if the input path is not started with '/',
  * Copy the root path into it.
  */
-static inline xmlChar *abspath_strdup(const xmlChar *root_path, xmlChar *src, int *root_len)
+static inline xmlChar *abspath_strdup(const xmlChar *root_path, const xmlChar *src, int *root_len)
 {
        int _root_len = 0;
        xmlChar *ptr;
+       int ptr_len;
 
        if (!root_len) {
                root_len = &_root_len;
@@ -341,17 +378,95 @@ static inline xmlChar *abspath_strdup(const xmlChar *root_path, xmlChar *src, in
                *root_len = 0;
        }
 
-       ptr = xmlMalloc(*root_len + xmlStrlen(src) + 4);
+       ptr_len = *root_len + xmlStrlen(src) + 4;
+       ptr = xmlMalloc(ptr_len);
 
        if (*root_len) {
-               strcpy((char *)ptr, (char *)root_path);
-               ptr[*root_len] = '/';
-               (*root_len)++;
+               int eoc_idx;
+               strncpy((char *)ptr, (char *)root_path, ptr_len);
+               eoc_idx = *root_len;
+               while (eoc_idx > 0) {
+                       if (ptr[eoc_idx - 1] != '/') {
+                               ptr[eoc_idx] = '\0';
+                               DbgPrint("Last trails are removed: [%s]\n", (char *)ptr);
+                               break;
+                       }
+                       eoc_idx--;
+               }
+               if (eoc_idx == 0) {
+                       ErrPrint("Root path is not valid [%s]\n", root_path);
+               }
+               *root_len = eoc_idx;
        }
 
        return ptr;
 }
 
+static xmlChar *verify_path(const xmlChar *base, const xmlChar *preview, int check_resolution)
+{
+       xmlChar *res_path = NULL;
+       xmlChar *tmp_preview;
+       int res_len = 0;
+       int root_len = 0;
+
+       if (check_resolution) {
+               initialize_resolution();
+
+               if (s_info.resolution.initialized) {
+                       char size_str[16];
+                       int base_len;
+                       char *delimeter;
+
+                       res_len = snprintf(size_str, sizeof(size_str) - 1, "%dx%d", s_info.resolution.width, s_info.resolution.height);
+                       if (res_len < 0) {
+                               ErrPrint("snprintf: %d\n", errno);
+                               return (xmlChar *)NULL;
+                       }
+
+                       base_len = xmlStrlen(base);
+                       res_len += base_len + 3;
+                       res_path = xmlMalloc(res_len);
+                       if (!res_path) {
+                               ErrPrint("xmlMalloc: %d\n", errno);
+                               return (xmlChar *)NULL;
+                       }
+
+                       if (base_len == 0 || base[base_len - 1] != '/') {
+                               delimeter = "/";
+                       } else {
+                               delimeter = "";
+                       }
+
+                       if (snprintf((char *)res_path, res_len, "%s%s%s", (char *)base, delimeter, size_str) < 0) {
+                               ErrPrint("snprintf: %d\n", errno);
+                               xmlFree(res_path);
+                               return (xmlChar *)NULL;
+                       }
+               } else {
+                       ErrPrint("Resolution is not initialized\n");
+               }
+       }
+
+       if (!res_path) {
+               res_path = xmlStrdup(base);
+       }
+
+       tmp_preview = abspath_strdup(res_path, preview, &root_len);
+       xmlFree(res_path);
+       if (!tmp_preview) {
+               return (xmlChar *)NULL;
+       }
+
+       abspath((char *)preview, ((char *)tmp_preview) + root_len);
+       DbgPrint("Path: [%s]\n", (char *)tmp_preview);
+       if (access((const char *)tmp_preview, F_OK) != 0) {
+               xmlFree(tmp_preview);
+               return (xmlChar *)NULL;
+       }
+
+       return tmp_preview;
+}
+
 int begin_transaction(void)
 {
        sqlite3_stmt *stmt;
@@ -2163,13 +2278,12 @@ static void update_i18n_name(struct widget *widget, xmlNodePtr node)
        widget->i18n_list = dlist_append(widget->i18n_list, i18n);
 }
 
-static void update_i18n_icon(struct widget *widget, xmlNodePtr node, const xmlChar *root_path)
+static void update_i18n_icon(struct widget *widget, xmlNodePtr node, const xmlChar *root_path, const xmlChar *res_path)
 {
        struct i18n *i18n;
        struct dlist *l;
        xmlChar *lang;
        xmlChar *icon;
-       int root_len;
 
        icon = xmlNodeGetContent(node);
        if (!icon) {
@@ -2196,14 +2310,21 @@ static void update_i18n_icon(struct widget *widget, xmlNodePtr node, const xmlCh
                        }
 
                        i18n->icon = icon;
-                       icon = abspath_strdup(root_path, i18n->icon, &root_len);
+
+                       /**
+                        * Try to do the latest version of path resolution first.
+                        */
+                       icon = verify_path(res_path, i18n->icon, 0);
                        if (!icon) {
-                               ErrPrint("strdup: %d\n", errno);
-                       } else {
-                               abspath((char *)i18n->icon, ((char *)icon) + root_len);
+                               icon = verify_path(root_path, i18n->icon, 0);
+                       }
+
+                       if (icon) {
                                xmlFree(i18n->icon);
                                i18n->icon = icon;
+                               DbgPrint("Icon[%s] - [%s] replaced\n", i18n->lang, i18n->icon);
                        }
+
                        return;
                }
        }
@@ -2217,14 +2338,19 @@ static void update_i18n_icon(struct widget *widget, xmlNodePtr node, const xmlCh
        }
 
        i18n->icon = icon;
-       icon = abspath_strdup(root_path, i18n->icon, &root_len);
+       /**
+        * Try to do the latest version of path resolution first.
+        */
+       icon = verify_path(res_path, i18n->icon, 0);
        if (!icon) {
-               ErrPrint("strdup: %d\n", errno);
-       } else {
-               abspath((char *)i18n->icon, ((char *)icon) + root_len);
+               icon = verify_path(root_path, i18n->icon, 0);
+       }
+
+       if (icon) {
                xmlFree(i18n->icon);
                i18n->icon = icon;
        }
+
        i18n->lang = lang;
        DbgPrint("Icon[%s] - [%s] added\n", i18n->lang, i18n->icon);
        widget->i18n_list = dlist_append(widget->i18n_list, i18n);
@@ -2402,19 +2528,26 @@ static void update_content(struct widget *widget, xmlNodePtr node)
        }
 }
 
-static void update_size_info(struct widget *widget, int idx, xmlNodePtr node, const xmlChar *root_path)
+static void update_size_info(struct widget *widget, int idx, xmlNodePtr node, const xmlChar *root_path, const xmlChar *res_path)
 {
        if (xmlHasProp(node, (const xmlChar *)"preview")) {
                xmlChar *tmp_preview;
-               int root_len;
 
                widget->preview[idx] = xmlGetProp(node, (const xmlChar *)"preview");
+               
+               tmp_preview = verify_path(res_path, widget->preview[idx], 1);
+               if (!tmp_preview) {
+                       tmp_preview = verify_path(root_path, widget->preview[idx], 1);
+               }
 
-               tmp_preview = abspath_strdup(root_path, widget->preview[idx], &root_len);
                if (!tmp_preview) {
-                       ErrPrint("strdup: %d\n", errno);
-               } else {
-                       abspath((char *)widget->preview[idx], ((char *)tmp_preview) + root_len);
+                       tmp_preview = verify_path(res_path, widget->preview[idx], 0);
+                       if (!tmp_preview) {
+                               tmp_preview = verify_path(root_path, widget->preview[idx], 0);
+                       }
+               }
+
+               if (tmp_preview) {
                        xmlFree(widget->preview[idx]);
                        widget->preview[idx] = tmp_preview;
                }
@@ -2494,7 +2627,7 @@ static void update_size_info(struct widget *widget, int idx, xmlNodePtr node, co
        }
 }
 
-static void update_support_size(struct widget *widget, xmlNodePtr node, const xmlChar *root_path)
+static void update_support_size(struct widget *widget, xmlNodePtr node, const xmlChar *root_path, const xmlChar *res_path)
 {
        xmlChar *size;
        int is_easy = 0;
@@ -2522,61 +2655,61 @@ static void update_support_size(struct widget *widget, xmlNodePtr node, const xm
        if (!xmlStrcasecmp(size, (const xmlChar *)"1x1")) {
                if (is_easy) {
                        widget->size_list |= WIDGET_SIZE_TYPE_EASY_1x1;
-                       update_size_info(widget, 9, node, root_path);
+                       update_size_info(widget, 9, node, root_path, res_path);
                } else {
                        widget->size_list |= WIDGET_SIZE_TYPE_1x1;
-                       update_size_info(widget, 0, node, root_path);
+                       update_size_info(widget, 0, node, root_path, res_path);
                }
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"3x1")) {
                if (is_easy) {
                        widget->size_list |= WIDGET_SIZE_TYPE_EASY_3x1;
-                       update_size_info(widget, 10, node, root_path);
+                       update_size_info(widget, 10, node, root_path, res_path);
                } else {
                        ErrPrint("Invalid size tag (%s)\n", size);
                }
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"3x3")) {
                if (is_easy) {
                        widget->size_list |= WIDGET_SIZE_TYPE_EASY_3x3;
-                       update_size_info(widget, 11, node, root_path);
+                       update_size_info(widget, 11, node, root_path, res_path);
                } else {
                        ErrPrint("Invalid size tag (%s)\n", size);
                }
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"2x1")) {
                widget->size_list |= WIDGET_SIZE_TYPE_2x1;
-               update_size_info(widget, 1, node, root_path);
+               update_size_info(widget, 1, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"2x2")) {
                widget->size_list |= WIDGET_SIZE_TYPE_2x2;
-               update_size_info(widget, 2, node, root_path);
+               update_size_info(widget, 2, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x1")) {
                widget->size_list |= WIDGET_SIZE_TYPE_4x1;
-               update_size_info(widget, 3, node, root_path);
+               update_size_info(widget, 3, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x2")) {
                widget->size_list |= WIDGET_SIZE_TYPE_4x2;
-               update_size_info(widget, 4, node, root_path);
+               update_size_info(widget, 4, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x3")) {
                widget->size_list |= WIDGET_SIZE_TYPE_4x3;
-               update_size_info(widget, 5, node, root_path);
+               update_size_info(widget, 5, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x4")) {
                widget->size_list |= WIDGET_SIZE_TYPE_4x4;
-               update_size_info(widget, 6, node, root_path);
+               update_size_info(widget, 6, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x5")) {
                widget->size_list |= WIDGET_SIZE_TYPE_4x5;
-               update_size_info(widget, 7, node, root_path);
+               update_size_info(widget, 7, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x6")) {
                widget->size_list |= WIDGET_SIZE_TYPE_4x6;
-               update_size_info(widget, 8, node, root_path);
+               update_size_info(widget, 8, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"21x21")) {
                widget->size_list |= WIDGET_SIZE_TYPE_EASY_1x1;
-               update_size_info(widget, 9, node, root_path);
+               update_size_info(widget, 9, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"23x21")) {
                widget->size_list |= WIDGET_SIZE_TYPE_EASY_3x1;
-               update_size_info(widget, 10, node, root_path);
+               update_size_info(widget, 10, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"23x23")) {
                widget->size_list |= WIDGET_SIZE_TYPE_EASY_3x3;
-               update_size_info(widget, 11, node, root_path);
+               update_size_info(widget, 11, node, root_path, res_path);
        } else if (!xmlStrcasecmp(size, (const xmlChar *)"0x0")) {
                widget->size_list |= WIDGET_SIZE_TYPE_FULL;
-               update_size_info(widget, 12, node, root_path);
+               update_size_info(widget, 12, node, root_path, res_path);
        } else {
                ErrPrint("Invalid size tag (%s)\n", size);
        }
@@ -2584,7 +2717,7 @@ static void update_support_size(struct widget *widget, xmlNodePtr node, const xm
        xmlFree(size);
 }
 
-static void update_box(struct widget *widget, xmlNodePtr node, const xmlChar *root_path)
+static void update_box(struct widget *widget, xmlNodePtr node, const xmlChar *root_path, const xmlChar *res_path)
 {
        int root_len;
 
@@ -2725,61 +2858,61 @@ static void update_box(struct widget *widget, xmlNodePtr node, const xmlChar *ro
                        if (!xmlStrcasecmp(size, (const xmlChar *)"1x1")) {
                                if (is_easy) {
                                        widget->size_list |= WIDGET_SIZE_TYPE_EASY_1x1;
-                                       update_size_info(widget, 9, node, root_path);
+                                       update_size_info(widget, 9, node, root_path, res_path);
                                } else {
                                        widget->size_list |= WIDGET_SIZE_TYPE_1x1;
-                                       update_size_info(widget, 0, node, root_path);
+                                       update_size_info(widget, 0, node, root_path, res_path);
                                }
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"3x1")) {
                                if (is_easy) {
                                        widget->size_list |= WIDGET_SIZE_TYPE_EASY_3x1;
-                                       update_size_info(widget, 10, node, root_path);
+                                       update_size_info(widget, 10, node, root_path, res_path);
                                } else {
                                        ErrPrint("Invalid size tag (%s)\n", size);
                                }
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"3x3")) {
                                if (is_easy) {
                                        widget->size_list |= WIDGET_SIZE_TYPE_EASY_3x3;
-                                       update_size_info(widget, 11, node, root_path);
+                                       update_size_info(widget, 11, node, root_path, res_path);
                                } else {
                                        ErrPrint("Invalid size tag (%s)\n", size);
                                }
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"2x1")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_2x1;
-                               update_size_info(widget, 1, node, root_path);
+                               update_size_info(widget, 1, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"2x2")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_2x2;
-                               update_size_info(widget, 2, node, root_path);
+                               update_size_info(widget, 2, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x1")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_4x1;
-                               update_size_info(widget, 3, node, root_path);
+                               update_size_info(widget, 3, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x2")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_4x2;
-                               update_size_info(widget, 4, node, root_path);
+                               update_size_info(widget, 4, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x3")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_4x3;
-                               update_size_info(widget, 5, node, root_path);
+                               update_size_info(widget, 5, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x4")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_4x4;
-                               update_size_info(widget, 6, node, root_path);
+                               update_size_info(widget, 6, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x5")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_4x5;
-                               update_size_info(widget, 7, node, root_path);
+                               update_size_info(widget, 7, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"4x6")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_4x6;
-                               update_size_info(widget, 8, node, root_path);
+                               update_size_info(widget, 8, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"21x21")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_EASY_1x1;
-                               update_size_info(widget, 9, node, root_path);
+                               update_size_info(widget, 9, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"23x21")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_EASY_3x1;
-                               update_size_info(widget, 10, node, root_path);
+                               update_size_info(widget, 10, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"23x23")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_EASY_3x3;
-                               update_size_info(widget, 11, node, root_path);
+                               update_size_info(widget, 11, node, root_path, res_path);
                        } else if (!xmlStrcasecmp(size, (const xmlChar *)"0x0")) {
                                widget->size_list |= WIDGET_SIZE_TYPE_FULL;
-                               update_size_info(widget, 12, node, root_path);
+                               update_size_info(widget, 12, node, root_path, res_path);
                        } else {
                                ErrPrint("Invalid size tag (%s)\n", size);
                        }
@@ -3269,13 +3402,31 @@ int db_install_widget(xmlNodePtr node, const char *appid)
        xmlChar *pkgid;
        xmlChar *tmp;
        xmlChar *root_path;
+       xmlChar *res_path;
+       int res_path_len;
 
        root_path = pkgmgr_get_root_path(appid);
        DbgPrint("RootPath is %s\n", (char *)root_path);
+       res_path_len = xmlStrlen(root_path) + strlen(SHARED_RES_PATH) + 2;
+       res_path = xmlMalloc(res_path_len);
+       if (!res_path) {
+               ErrPrint("Unable to allocate heap for shared res path\n");
+               xmlFree(root_path);
+               return -ENOMEM;
+       }
+
+       if (snprintf((char *)res_path, res_path_len - 1, "%s"SHARED_RES_PATH, root_path) < 0) {
+               ErrPrint("Unable to prepare res_path: %d\n", errno);
+               xmlFree(root_path);
+               xmlFree(res_path);
+               return -EFAULT;
+       }
+       DbgPrint("ResPath is %s\n", res_path);
 
        if (!xmlHasProp(node, (const xmlChar *)"appid")) {
                ErrPrint("Missing appid\n");
                xmlFree(root_path);
+               xmlFree(res_path);
                return -EINVAL;
        }
 
@@ -3284,6 +3435,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                ErrPrint("Invalid appid\n");
                xmlFree(pkgid);
                xmlFree(root_path);
+               xmlFree(res_path);
                return -EINVAL;
        }
 
@@ -3294,6 +3446,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                ErrPrint("calloc: %d\n", errno);
                xmlFree(pkgid);
                xmlFree(root_path);
+               xmlFree(res_path);
                return -ENOMEM;
        }
 
@@ -3411,6 +3564,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                        ErrPrint("ABI is NIL\n");
                        widget_destroy(widget);
                        xmlFree(root_path);
+                       xmlFree(res_path);
                        return -EFAULT;
                }
        }
@@ -3458,6 +3612,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                        ErrPrint("libexec is NIL\n");
                        widget_destroy(widget);
                        xmlFree(root_path);
+                       xmlFree(res_path);
                        return -EFAULT;
                }
 
@@ -3466,6 +3621,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                        ErrPrint("strdup: %d\n", errno);
                        widget_destroy(widget);
                        xmlFree(root_path);
+                       xmlFree(res_path);
                        return -EFAULT;
                }
 
@@ -3485,6 +3641,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                                ErrPrint("xmlstrdup: %d\n", errno);
                                widget_destroy(widget);
                                xmlFree(root_path);
+                               xmlFree(res_path);
                                return -ENOMEM;
                        }
                } else if (xmlStrcasecmp(widget->abi, (const xmlChar *)"c") && xmlStrcasecmp(widget->abi, (const xmlChar *)"cpp")) {
@@ -3499,6 +3656,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                        ErrPrint("libexec is NIL\n");
                        widget_destroy(widget);
                        xmlFree(root_path);
+                       xmlFree(res_path);
                        return -EFAULT;
                }
 
@@ -3507,6 +3665,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                        ErrPrint("strdup: %d\n", errno);
                        widget_destroy(widget);
                        xmlFree(root_path);
+                       xmlFree(res_path);
                        return -EFAULT;
                }
 
@@ -3526,6 +3685,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                                ErrPrint("xmlstrdup: %d\n", errno);
                                widget_destroy(widget);
                                xmlFree(root_path);
+                               xmlFree(res_path);
                                return -ENOMEM;
                        }
                } else if (xmlStrcasecmp(widget->abi, (const xmlChar *)"app")) {
@@ -3556,17 +3716,17 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                }
 
                if (!xmlStrcasecmp(node->name, (const xmlChar *)"icon")) {
-                       update_i18n_icon(widget, node, root_path);
+                       update_i18n_icon(widget, node, root_path, res_path);
                        continue;
                }
 
                if (!xmlStrcasecmp(node->name, (const xmlChar *)"box")) {
-                       update_box(widget, node, root_path);
+                       update_box(widget, node, root_path, res_path);
                        continue;
                }
 
                if (!xmlStrcasecmp(node->name, (const xmlChar *)"support-size")) {
-                       update_support_size(widget, node, root_path);
+                       update_support_size(widget, node, root_path, res_path);
                        continue;
                }
 
@@ -3604,6 +3764,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
                        if (update_category(widget, node) < 0) {
                                widget_destroy(widget);
                                xmlFree(root_path);
+                               xmlFree(res_path);
                                return -EINVAL;
                        }
 
@@ -3636,6 +3797,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
        }
 
        xmlFree(root_path);
+       xmlFree(res_path);
        return db_insert_widget(widget, appid);
 }
 
@@ -3644,13 +3806,31 @@ int db_install_watchapp(xmlNodePtr node, const char *appid)
        struct widget *widget;
        xmlChar *pkgid;
        xmlChar *root_path;
+       xmlChar *res_path;
+       int res_path_len;
 
        root_path = pkgmgr_get_root_path(appid);
        DbgPrint("RootPath is %s\n", root_path);
+       res_path_len = xmlStrlen(root_path) + strlen(SHARED_RES_PATH) + 2;
+       res_path = xmlMalloc(res_path_len);
+       if (!res_path) {
+               ErrPrint("Unable to allocate heap for shared res path\n");
+               xmlFree(root_path);
+               return -ENOMEM;
+       }
+
+       if (snprintf((char *)res_path, res_path_len - 1, "%s"SHARED_RES_PATH, root_path) < 0) {
+               ErrPrint("Unable to prepare res_path: %d\n", errno);
+               xmlFree(root_path);
+               xmlFree(res_path);
+               return -EFAULT;
+       }
+       DbgPrint("ResPath is %s\n", res_path);
 
        if (!xmlHasProp(node, (const xmlChar *)"appid")) {
                ErrPrint("Missing appid\n");
                xmlFree(root_path);
+               xmlFree(res_path);
                return -EINVAL;
        }
 
@@ -3659,6 +3839,7 @@ int db_install_watchapp(xmlNodePtr node, const char *appid)
                ErrPrint("Invalid appid\n");
                xmlFree(pkgid);
                xmlFree(root_path);
+               xmlFree(res_path);
                return -EINVAL;
        }
 
@@ -3669,6 +3850,7 @@ int db_install_watchapp(xmlNodePtr node, const char *appid)
                ErrPrint("strdup: %d\n", errno);
                xmlFree(pkgid);
                xmlFree(root_path);
+               xmlFree(res_path);
                return -ENOMEM;
        }
 
@@ -3701,6 +3883,7 @@ int db_install_watchapp(xmlNodePtr node, const char *appid)
                        ErrPrint("libexec is NIL\n");
                        widget_destroy(widget);
                        xmlFree(root_path);
+                       xmlFree(res_path);
                        return -EFAULT;
                }
        }
@@ -3717,12 +3900,13 @@ int db_install_watchapp(xmlNodePtr node, const char *appid)
                }
 
                if (!xmlStrcasecmp(node->name, (const xmlChar *)"icon")) {
-                       update_i18n_icon(widget, node, root_path);
+                       update_i18n_icon(widget, node, root_path, res_path);
                        continue;
                }
        }
 
        xmlFree(root_path);
+       xmlFree(res_path);
        return db_insert_widget(widget, appid);
 }
 
index 7b1b2d8..88f5bb5 100644 (file)
@@ -1030,7 +1030,7 @@ EAPI int buffer_handler_is_loaded(const struct buffer_info *info)
        return info ? info->is_loaded : 0;
 }
 
-EAPI void buffer_handler_update_size(struct buffer_info *info, int w, int h)
+EAPI void buffer_handler_update_size(struct buffer_info *info, int w, int h, int pixel_size)
 {
        if (!info) {
                return;
@@ -1038,6 +1038,9 @@ EAPI void buffer_handler_update_size(struct buffer_info *info, int w, int h)
 
        info->w = w;
        info->h = h;
+       if (pixel_size > 0) {
+               info->pixel_size = pixel_size;
+       }
 }
 
 EAPI int buffer_handler_resize(struct buffer_info *info, int w, int h, int pixel_size)
@@ -1056,7 +1059,7 @@ EAPI int buffer_handler_resize(struct buffer_info *info, int w, int h, int pixel
                }
        }
 
-       buffer_handler_update_size(info, w, h);
+       buffer_handler_update_size(info, w, h, pixel_size);
 
        if (!info->is_loaded) {
                DbgPrint("Buffer size is updated[%dx%d]\n", w, h);
index a8dcb99..a655969 100644 (file)
@@ -879,7 +879,7 @@ EAPI int buffer_handler_is_loaded(const struct buffer_info *info)
        return info ? info->is_loaded : 0;
 }
 
-EAPI void buffer_handler_update_size(struct buffer_info *info, int w, int h)
+EAPI void buffer_handler_update_size(struct buffer_info *info, int w, int h, int pixel_size)
 {
        if (!info) {
                return;
@@ -887,9 +887,12 @@ EAPI void buffer_handler_update_size(struct buffer_info *info, int w, int h)
 
        info->w = w;
        info->h = h;
+       if (pixel_size > 0) {
+               info->pixel_size = pixel_size;
+       }
 }
 
-EAPI int buffer_handler_resize(struct buffer_info *info, int w, int h)
+EAPI int buffer_handler_resize(struct buffer_info *info, int w, int h, int pixel_size)
 {
        int ret;
 
@@ -903,7 +906,7 @@ EAPI int buffer_handler_resize(struct buffer_info *info, int w, int h)
                return WIDGET_ERROR_NONE;
        }
 
-       buffer_handler_update_size(info, w, h);
+       buffer_handler_update_size(info, w, h, pixel_size);
 
        if (!info->is_loaded) {
                DbgPrint("Buffer size is updated[%dx%d]\n", w, h);
index 0f72299..3e88f09 100644 (file)
@@ -994,7 +994,7 @@ HAPI int notification_service_init(void)
        notification_setting_refresh_setting_table();
 
        pkgmgr_add_event_callback(PKGMGR_EVENT_INSTALL, _package_install_cb, (void*)&s_info);
-       /* pkgmgr_add_event_callback(PKGMGR_EVENT_UPDATE, _package_install_cb, (void*)&s_info); */
+       pkgmgr_add_event_callback(PKGMGR_EVENT_UPDATE, _package_install_cb, (void*)&s_info);
        pkgmgr_add_event_callback(PKGMGR_EVENT_UNINSTALL, _package_uninstall_cb, (void*)&s_info);
 
        DbgPrint("Successfully initiated\n");
index aa82041..e9a221d 100644 (file)
@@ -895,7 +895,7 @@ static void update_size_for_script(struct script_info *info, struct inst_info *i
         * If it required to be unload and load.
         * New size of buffer will be allocated
         */
-       buffer_handler_update_size(info->buffer_handle, w, h);
+       buffer_handler_update_size(info->buffer_handle, w, h, 0);
 
        if (info->port->update_size) {
                (void)info->port->update_size(info->port_data, NULL, w, h);
index c50702e..e568dd6 100644 (file)
@@ -2463,7 +2463,7 @@ static struct packet *client_gbar_mouse_set(pid_t pid, int handle, const struct
                goto out;
        }
 
-       ret = packet_get(packet, "ssdiiidd", &pkgname, &id, &timestamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
+       ret = packet_get(packet, "ssdiiiddi", &pkgname, &id, &timestamp, &x, &y, &source, &ratio_w, &ratio_h, &device);
        if (ret != 9) {
                ErrPrint("Parameter is not matched\n");
                ret = WIDGET_ERROR_INVALID_PARAMETER;