merge master branch
authorjunsuk77.oh <junsuk77.oh@samsung.com>
Tue, 18 Jun 2013 09:13:03 +0000 (18:13 +0900)
committerjunsuk77.oh <junsuk77.oh@samsung.com>
Tue, 18 Jun 2013 09:13:03 +0000 (18:13 +0900)
Change-Id: I560765997e5f9ea7e6250eb25075ea9b1562ac1d
Signed-off-by: junsuk77.oh <junsuk77.oh@samsung.com>
include/pkgmgr-info.h
packaging/pkgmgr-info.spec
parser/manifest.xsd.in
parser/pkgmgr_parser.c
parser/pkgmgr_parser.h
parser/pkgmgr_parser_db.c
src/pkgmgr-info.c

index 3b70b78..32a3fe3 100755 (executable)
@@ -2952,6 +2952,124 @@ static int get_component_type(const char *appid)
  */
 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char **component_type);
 
  */
 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char **component_type);
 
+/**
+ * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
+ * @brief      This API gets the application 'hwacceleration' value from the app ID
+ *
+ * @par                This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in]  handle  pointer to application info handle
+ * @param[out] hwacceleration          pointer to hold package hwacceleration value
+ * @return     0 if success, error code(<0) if fail
+ * @retval     PMINFO_R_OK     success
+ * @retval     PMINFO_R_EINVAL invalid argument
+ * @retval     PMINFO_R_ERROR  internal error
+ * @pre                pkgmgrinfo_appinfo_get_appinfo()
+ * @post       pkgmgrinfo_appinfo_destroy_appinfo()
+ * @see                pkgmgrinfo_appinfo_get_appid()
+ * @see                pkgmgrinfo_appinfo_is_multiple()
+ * @code
+static int get_app_hwacceleration(const char *appid)
+{
+       int ret = 0;
+       pkgmgrinfo_app_hwacceleration hwacceleration;
+       pkgmgrinfo_appinfo_h handle;
+       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+       if (ret != PMINFO_R_OK)
+               return -1;
+       ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
+       if (ret != PMINFO_R_OK) {
+               pkgmgrinfo_appinfo_destroy_appinfo(handle);
+               return -1;
+       }
+       printf("app hwacceleration: %d\n", hwacceleration);
+       pkgmgrinfo_appinfo_destroy_appinfo(handle);
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
+
+/**
+ * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
+ * @brief      This API gets the application's landscape & portrait effect images
+ *
+ * @par                This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in]  handle  pointer to application info handle
+ * @param[out]  portrait_img contains portrait mode effect image
+ * @param[out]  landscape_img contains landscape mode effect image
+ * @return     0 if success, error code(<0) if fail
+ * @retval     PMINFO_R_OK     success
+ * @retval     PMINFO_R_EINVAL invalid argument
+ * @retval     PMINFO_R_ERROR  internal error
+ * @pre                pkgmgrinfo_appinfo_get_appinfo()
+ * @post               pkgmgrinfo_appinfo_destroy_appinfo()
+ * @see                pkgmgrinfo_appinfo_get_appid()
+ * @see                pkgmgrinfo_appinfo_is_nodisplay()
+ * @code
+static int get_app_effectimages(const char *appid)
+{
+       int ret = 0;
+       char *portraitimg = NULL;
+       char *landscapeimg = NULL;
+       pkgmgrinfo_appinfo_h handle;
+       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+       if (ret != PMINFO_R_OK)
+               return -1;
+       ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
+       if (ret != PMINFO_R_OK) {
+               pkgmgrinfo_appinfo_destroy_appinfo(handle);
+               return -1;
+       }
+       printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
+       pkgmgrinfo_appinfo_destroy_appinfo(handle);
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img);
+
+/**
+ * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
+ * @brief      This API gets the submode_mainid of the application
+ *
+ * @par                This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle           pointer to the application info handle.
+ * @param[out] submode_mainid          pointer to hold package name
+ * @return     0 if success, error code(<0) if fail
+ * @retval     PMINFO_R_OK     success
+ * @retval     PMINFO_R_EINVAL invalid argument
+ * @retval     PMINFO_R_ERROR  internal error
+ * @pre                pkgmgrinfo_appinfo_get_appinfo()
+ * @post               pkgmgrinfo_appinfo_destroy_appinfo()
+ * @see                pkgmgrinfo_appinfo_get_appid()
+ * @see                pkgmgrinfo_appinfo_is_multiple()
+ * @code
+static int get_app_submode_mainid(const char *appid)
+{
+       int ret = 0;
+       char *submode_mainid = NULL;
+       pkgmgrinfo_appinfo_h handle = NULL;
+       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+       if (ret != PMINFO_R_OK)
+               return -1;
+       ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
+       if (ret != PMINFO_R_OK) {
+               pkgmgrinfo_appinfo_destroy_appinfo(handle);
+               return -1;
+       }
+       printf("submode_mainid: %s\n", submode_mainid);
+       pkgmgrinfo_appinfo_destroy_appinfo(handle);
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h  handle, char **submode_mainid);
 
 /**
  * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
 
 /**
  * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
@@ -3261,47 +3379,6 @@ static int get_app_indicator_display(const char *appid)
 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
 
 /**
 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
 
 /**
- * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
- * @brief      This API gets the application's landscape & portrait effect images
- *
- * @par                This API is for package-manager client application
- * @par Sync (or) Async : Synchronous API
- *
- * @param[in]  handle  pointer to application info handle
- * @param[out]  portrait_img contains portrait mode effect image
- * @param[out]  landscape_img contains landscape mode effect image
- * @return     0 if success, error code(<0) if fail
- * @retval     PMINFO_R_OK     success
- * @retval     PMINFO_R_EINVAL invalid argument
- * @retval     PMINFO_R_ERROR  internal error
- * @pre                pkgmgrinfo_appinfo_get_appinfo()
- * @post               pkgmgrinfo_appinfo_destroy_appinfo()
- * @see                pkgmgrinfo_appinfo_get_appid()
- * @see                pkgmgrinfo_appinfo_is_nodisplay()
- * @code
-static int get_app_effectimages(const char *appid)
-{
-       int ret = 0;
-       char *portraitimg = NULL;
-       char *landscapeimg = NULL;
-       pkgmgrinfo_appinfo_h handle;
-       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
-       if (ret != PMINFO_R_OK)
-               return -1;
-       ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
-       if (ret != PMINFO_R_OK) {
-               pkgmgrinfo_appinfo_destroy_appinfo(handle);
-               return -1;
-       }
-       printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
-       pkgmgrinfo_appinfo_destroy_appinfo(handle);
-       return 0;
-}
- * @endcode
- */
-int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img);
-
-/**
  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
  * @brief      This API gets the application 'taskmanage' value from the app ID
  *
  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
  * @brief      This API gets the application 'taskmanage' value from the app ID
  *
@@ -3380,45 +3457,6 @@ static int get_app_enabled(const char *appid)
 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
 
 /**
 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
 
 /**
- * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
- * @brief      This API gets the application 'hwacceleration' value from the app ID
- *
- * @par                This API is for package-manager client application
- * @par Sync (or) Async : Synchronous API
- *
- * @param[in]  handle  pointer to application info handle
- * @param[out] hwacceleration          pointer to hold package hwacceleration value
- * @return     0 if success, error code(<0) if fail
- * @retval     PMINFO_R_OK     success
- * @retval     PMINFO_R_EINVAL invalid argument
- * @retval     PMINFO_R_ERROR  internal error
- * @pre                pkgmgrinfo_appinfo_get_appinfo()
- * @post       pkgmgrinfo_appinfo_destroy_appinfo()
- * @see                pkgmgrinfo_appinfo_get_appid()
- * @see                pkgmgrinfo_appinfo_is_multiple()
- * @code
-static int get_app_hwacceleration(const char *appid)
-{
-       int ret = 0;
-       pkgmgrinfo_app_hwacceleration hwacceleration;
-       pkgmgrinfo_appinfo_h handle;
-       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
-       if (ret != PMINFO_R_OK)
-               return -1;
-       ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
-       if (ret != PMINFO_R_OK) {
-               pkgmgrinfo_appinfo_destroy_appinfo(handle);
-               return -1;
-       }
-       printf("app hwacceleration: %d\n", hwacceleration);
-       pkgmgrinfo_appinfo_destroy_appinfo(handle);
-       return 0;
-}
- * @endcode
- */
-int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
-
-/**
  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
  * @brief      This API gets the application 'onboot' value from the app ID
  *
  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
  * @brief      This API gets the application 'onboot' value from the app ID
  *
@@ -3576,6 +3614,45 @@ static int get_app_preload(const char *appid)
 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
 
 /**
 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
 
 /**
+ * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
+ * @brief      This API gets the value for given application is submode or not from handle
+ *
+ * @par                This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in]  handle  pointer to application info handle
+ * @param[out] submode         pointer to hold submode is or not
+ * @return     0 if success, error code(<0) if fail
+ * @retval     PMINFO_R_OK     success
+ * @retval     PMINFO_R_EINVAL invalid argument
+ * @retval     PMINFO_R_ERROR  internal error
+ * @pre                pkgmgrinfo_appinfo_get_appinfo()
+ * @post               pkgmgrinfo_appinfo_destroy_appinfo()
+ * @see                pkgmgrinfo_appinfo_get_appid()
+ * @see                pkgmgrinfo_appinfo_is_multiple()
+ * @code
+static int get_app_submode(const char *appid)
+{
+       int ret = 0;
+       bool submode = 0;
+       pkgmgrinfo_appinfo_h handle = NULL;
+       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+       if (ret != PMINFO_R_OK)
+               return -1;
+       ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
+       if (ret != PMINFO_R_OK) {
+               pkgmgrinfo_appinfo_destroy_appinfo(handle);
+               return -1;
+       }
+       printf("submode: %d\n", submode);
+       pkgmgrinfo_appinfo_destroy_appinfo(handle);
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
+
+/**
  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
  * @brief      This API destroys the application information handle freeing up all the resources
  *
  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
  * @brief      This API destroys the application information handle freeing up all the resources
  *
index eb25e26..c4ee1e1 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       pkgmgr-info
 Summary:    Packager Manager infomation api for package
 Name:       pkgmgr-info
 Summary:    Packager Manager infomation api for package
-Version:    0.0.120
+Version:    0.0.123
 Release:    1
 Group:      Application Framework/Package Management
 License:    Apache-2.0
 Release:    1
 Group:      Application Framework/Package Management
 License:    Apache-2.0
index 1de9261..0523d5d 100755 (executable)
          <xs:attribute name="launchcondition" type="xs:boolean"/>
          <xs:attribute name="permission-type" type="xs:string"/>
          <xs:attribute name="component-type" type="xs:string"/>
          <xs:attribute name="launchcondition" type="xs:boolean"/>
          <xs:attribute name="permission-type" type="xs:string"/>
          <xs:attribute name="component-type" type="xs:string"/>
+         <xs:attribute name="submode" type="xs:boolean"/>
+         <xs:attribute name="submode-mainid" type="xs:string"/>
     </xs:complexType>
   </xs:element>
   <xs:element name="ime-application">
     </xs:complexType>
   </xs:element>
   <xs:element name="ime-application">
index 6c3d92e..b8e2f7b 100755 (executable)
@@ -1373,6 +1373,14 @@ static void __ps_free_uiapplication(uiapplication_x *uiapplication)
                free((void *)uiapplication->preload);
                uiapplication->preload = NULL;
        }
                free((void *)uiapplication->preload);
                uiapplication->preload = NULL;
        }
+       if (uiapplication->submode) {
+               free((void *)uiapplication->submode);
+               uiapplication->submode = NULL;
+       }
+       if (uiapplication->submode_mainid) {
+               free((void *)uiapplication->submode_mainid);
+               uiapplication->submode_mainid = NULL;
+       }
 
        free((void*)uiapplication);
        uiapplication = NULL;
 
        free((void*)uiapplication);
        uiapplication = NULL;
@@ -2564,6 +2572,15 @@ static int __ps_process_uiapplication(xmlTextReaderPtr reader, uiapplication_x *
        } else {
                uiapplication->component_type = strdup("uiapp");
        }
        } else {
                uiapplication->component_type = strdup("uiapp");
        }
+       if (xmlTextReaderGetAttribute(reader, XMLCHAR("submode"))) {
+               uiapplication->submode = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("submode")));
+               if (uiapplication->submode == NULL)
+                       uiapplication->submode = strdup("false");
+       } else {
+               uiapplication->submode = strdup("false");
+       }
+       if (xmlTextReaderGetAttribute(reader, XMLCHAR("submode-mainid")))
+               uiapplication->submode_mainid = ASCII(xmlTextReaderGetAttribute(reader, XMLCHAR("submode-mainid")));
 
        depth = xmlTextReaderDepth(reader);
        while ((ret = __next_child_element(reader, depth))) {
 
        depth = xmlTextReaderDepth(reader);
        while ((ret = __next_child_element(reader, depth))) {
@@ -3329,6 +3346,7 @@ typedef enum {
        AIL_INSTALL = 0,
        AIL_UPDATE,
        AIL_REMOVE,
        AIL_INSTALL = 0,
        AIL_UPDATE,
        AIL_REMOVE,
+       AIL_CLEAN,
        AIL_MAX
 } AIL_TYPE;
 
        AIL_MAX
 } AIL_TYPE;
 
@@ -3355,6 +3373,9 @@ static int __ail_change_info(int op, const char *appid)
                case 2:
                        aop  = "ail_desktop_remove";
                        break;
                case 2:
                        aop  = "ail_desktop_remove";
                        break;
+               case 3:
+                       aop  = "ail_desktop_clean";
+                       break;
                default:
                        goto END;
                        break;
                default:
                        goto END;
                        break;
@@ -3401,6 +3422,9 @@ static int __ps_make_nativeapp_desktop(manifest_x * mfx, const char *manifest, b
                return -1;
        }
 
                return -1;
        }
 
+       if (is_update)
+               __ail_change_info(AIL_CLEAN, mfx->package);
+
        for(; mfx->uiapplication; mfx->uiapplication=mfx->uiapplication->next) {
 
                if (manifest != NULL) {
        for(; mfx->uiapplication; mfx->uiapplication=mfx->uiapplication->next) {
 
                if (manifest != NULL) {
@@ -3724,10 +3748,7 @@ static int __ps_make_nativeapp_desktop(manifest_x * mfx, const char *manifest, b
                fsync(fd);
                fclose(file);
 
                fsync(fd);
                fclose(file);
 
-               if (!is_update)
-                       __ail_change_info(AIL_INSTALL, mfx->uiapplication->appid);
-               else
-                       __ail_change_info(AIL_UPDATE, mfx->uiapplication->appid);
+               __ail_change_info(AIL_INSTALL, mfx->uiapplication->appid);
        }
 
        free(buf);
        }
 
        free(buf);
@@ -3874,6 +3895,22 @@ static int __check_preload_updated(manifest_x * mfx, const char *manifest)
        return 0;
 }
 
        return 0;
 }
 
+
+API int pkgmgr_parser_create_desktop_file(manifest_x *mfx)
+{
+        int ret = 0;
+       if (mfx == NULL) {
+               DBG("Manifest pointer is NULL\n");
+               return -1;
+       }
+        ret = __ps_make_nativeapp_desktop(mfx, NULL, 0);
+        if (ret == -1)
+                DBG("Creating desktop file failed\n");
+        else
+                DBG("Creating desktop file Success\n");
+        return ret;
+}
+
 API void pkgmgr_parser_free_manifest_xml(manifest_x *mfx)
 {
        if (mfx == NULL)
 API void pkgmgr_parser_free_manifest_xml(manifest_x *mfx)
 {
        if (mfx == NULL)
@@ -4172,22 +4209,6 @@ API int pkgmgr_parser_parse_manifest_for_installation(const char *manifest, char
        return PMINFO_R_OK;
 }
 
        return PMINFO_R_OK;
 }
 
-API int pkgmgr_parser_create_desktop_file(manifest_x *mfx)
-{
-        int ret = 0;
-       if (mfx == NULL) {
-               DBG("Manifest pointer is NULL\n");
-               return -1;
-       }
-        ret = __ps_make_nativeapp_desktop(mfx, NULL, 0);
-        if (ret == -1)
-                DBG("Creating desktop file failed\n");
-        else
-                DBG("Creating desktop file Success\n");
-        return ret;
-}
-
-
 API int pkgmgr_parser_parse_manifest_for_upgrade(const char *manifest, char *const tagv[])
 {
        char *temp[] = {"shortcut-list", "livebox", "account", "notifications", "privileges", "ime", "font", NULL};
 API int pkgmgr_parser_parse_manifest_for_upgrade(const char *manifest, char *const tagv[])
 {
        char *temp[] = {"shortcut-list", "livebox", "account", "notifications", "privileges", "ime", "font", NULL};
@@ -4198,7 +4219,7 @@ API int pkgmgr_parser_parse_manifest_for_upgrade(const char *manifest, char *con
        DBG("parsing manifest for upgradation: %s\n", manifest);
        manifest_x *mfx = NULL;
        int ret = -1;
        DBG("parsing manifest for upgradation: %s\n", manifest);
        manifest_x *mfx = NULL;
        int ret = -1;
-       bool preload = 0;
+       bool preload = false;
        char *csc_path = NULL;
        pkgmgrinfo_pkginfo_h handle = NULL;
 
        char *csc_path = NULL;
        pkgmgrinfo_pkginfo_h handle = NULL;
 
@@ -4321,6 +4342,21 @@ API int pkgmgr_parser_run_parser_for_uninstallation(xmlDocPtr docPtr, const char
        return __ps_run_parser(docPtr, tag, ACTION_UNINSTALL, pkgid);
 }
 
        return __ps_run_parser(docPtr, tag, ACTION_UNINSTALL, pkgid);
 }
 
+API int pkgmgr_parser_run_post_for_installation(const char *pkgid, char *const tagv[])
+{
+       return PMINFO_R_OK;
+}
+
+API int pkgmgr_parser_run_post_for_upgrade(const char *pkgid, char *const tagv[])
+{
+       return PMINFO_R_OK;
+}
+
+API int pkgmgr_parser_run_post_for_uninstallation(const char *pkgid)
+{
+       return PMINFO_R_OK;
+}
+
 #define SCHEMA_FILE "/usr/etc/package-manager/preload/manifest.xsd"
 #if 1
 API int pkgmgr_parser_check_manifest_validation(const char *manifest)
 #define SCHEMA_FILE "/usr/etc/package-manager/preload/manifest.xsd"
 #if 1
 API int pkgmgr_parser_check_manifest_validation(const char *manifest)
index e3a93b0..a0daef1 100755 (executable)
@@ -376,6 +376,8 @@ typedef struct uiapplication_x {
        const char *permission_type;
        const char *component_type;
        const char *preload;
        const char *permission_type;
        const char *component_type;
        const char *preload;
+       const char *submode;
+       const char *submode_mainid;
        struct label_x *label;
        struct icon_x *icon;
        struct image_x *image;
        struct label_x *label;
        struct icon_x *icon;
        struct image_x *image;
@@ -787,6 +789,90 @@ static int parse_docptr_for_uninstallation(xmlDocPtr docPtr)
 int pkgmgr_parser_run_parser_for_uninstallation(xmlDocPtr docPtr, const char *tag, const char *pkgid);
 
 /**
 int pkgmgr_parser_run_parser_for_uninstallation(xmlDocPtr docPtr, const char *tag, const char *pkgid);
 
 /**
+ * @fn int pkgmgr_parser_run_post_for_installation(const char *pkgid, char *const tagv[])
+ * @brief      This API is called by backend installer for post action. It is used during package installation
+ *
+ * @par                This API is for package-manager installer backends.
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in]  pkgid           the package id
+ * @param[in]  tagv            array of tags or NULL
+ * @return     0 if success, error code(<0) if fail
+ * @retval     PMINFO_R_OK     success
+ * @retval     PMINFO_R_EINVAL invalid argument
+ * @retval     PMINFO_R_ERROR  internal error
+ * @pre                None
+ * @post               None
+ * @code
+static int parse_post_for_installation(const char *pkgid)
+{
+       int ret = 0;
+       ret = pkgmgr_parser_run_post_for_installation(pkgid, NULL);
+       if (ret)
+               return -1;
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgr_parser_run_post_for_installation(const char *pkgid, char *const tagv[]);
+
+/**
+ * @fn int pkgmgr_parser_run_post_for_upgrade(const char *pkgid, char *const tagv[])
+ * @brief      This API is called by backend installer for post action. It is used during package upgrade
+
+ * @par                This API is for package-manager installer backends.
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in]  pkgid           the package id
+ * @param[in]  tagv            array of tags or NULL
+ * @return     0 if success, error code(<0) if fail
+ * @retval     PMINFO_R_OK     success
+ * @retval     PMINFO_R_EINVAL invalid argument
+ * @retval     PMINFO_R_ERROR  internal error
+ * @pre                None
+ * @post               None
+ * @code
+static int parse_post_for_upgrade(const char *pkgid)
+{
+       int ret = 0;
+       ret = pkgmgr_parser_run_post_for_upgrade(pkgid, NULL);
+       if (ret)
+               return -1;
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgr_parser_run_post_for_upgrade(const char *pkgid, char *const tagv[]);
+
+/**
+ * @fn int pkgmgr_parser_run_post_for_uninstallation(const char *pkgid)
+ * @brief      This API is called by backend installer for run post action. It is used during package uninstallation
+ *
+ * @par                This API is for package-manager installer backends.
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in]  pkgid           the package id
+ * @return     0 if success, error code(<0) if fail
+ * @retval     PMINFO_R_OK     success
+ * @retval     PMINFO_R_EINVAL invalid argument
+ * @retval     PMINFO_R_ERROR  internal error
+ * @pre                None
+ * @post               None
+ * @code
+static int parse_post_for_uninstallation(const char *pkgid)
+{
+       int ret = 0;
+       ret = pkgmgr_parser_run_post_for_uninstallation(pkgid);
+       if (ret)
+               return -1;
+       return 0;
+}
+ * @endcode
+ */
+int pkgmgr_parser_run_post_for_uninstallation(const char *pkgid);
+
+
+/**
  * @fn int pkgmgr_parser_create_desktop_file(manifest_x *mfx)
  * @brief      This API generates the application desktop file
  *
  * @fn int pkgmgr_parser_create_desktop_file(manifest_x *mfx)
  * @brief      This API generates the application desktop file
  *
index 18335f6..2359273 100755 (executable)
@@ -108,6 +108,8 @@ char *prev = NULL;
                                                "app_guestmodevisibility text DEFAULT 'true', " \
                                                "app_permissiontype text DEFAULT 'normal', " \
                                                "app_preload text DEFAULT 'false', " \
                                                "app_guestmodevisibility text DEFAULT 'true', " \
                                                "app_permissiontype text DEFAULT 'normal', " \
                                                "app_preload text DEFAULT 'false', " \
+                                               "app_submode text DEFAULT 'false', " \
+                                               "app_submode_mainid text, " \
                                                "component_type text, " \
                                                "package text not null, " \
                                                "FOREIGN KEY(package) " \
                                                "component_type text, " \
                                                "package text not null, " \
                                                "FOREIGN KEY(package) " \
@@ -657,11 +659,6 @@ static void __insert_uiapplication_locale_info(gpointer data, gpointer userdata)
                        "('%q', '%q', '%q', '%q', '%q', '%q', '%q')", up->package, (char*)data,
                        label, icon, NULL, NULL, NULL);
                ret = __exec_query_no_msg(query);
                        "('%q', '%q', '%q', '%q', '%q', '%q', '%q')", up->package, (char*)data,
                        label, icon, NULL, NULL, NULL);
                ret = __exec_query_no_msg(query);
-               if (ret == -1) {
-                       snprintf(query, MAX_QUERY_LEN,
-                               "update package_localized_info set  package_label='%s', package_icon='%s' where package='%s' and package_locale='%s'", label, icon, up->package, (char*)data);
-                       __exec_query_no_msg(query);
-               }
        }
 }
 
        }
 }
 
@@ -801,11 +798,13 @@ static int __insert_uiapplication_info(manifest_x *mfx)
                snprintf(query, MAX_QUERY_LEN,
                         "insert into package_app_info(app_id, app_component, app_exec, app_nodisplay, app_type, app_onboot, " \
                        "app_multiple, app_autorestart, app_taskmanage, app_enabled, app_hwacceleration, app_mainapp , app_recentimage, " \
                snprintf(query, MAX_QUERY_LEN,
                         "insert into package_app_info(app_id, app_component, app_exec, app_nodisplay, app_type, app_onboot, " \
                        "app_multiple, app_autorestart, app_taskmanage, app_enabled, app_hwacceleration, app_mainapp , app_recentimage, " \
-                       "app_launchcondition, app_indicatordisplay, app_portraitimg, app_landscapeimg, app_guestmodevisibility, app_permissiontype, app_preload, component_type, package) " \
-                       "values('%s', '%s', '%s', '%s', '%s', '%s','%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\
+                       "app_launchcondition, app_indicatordisplay, app_portraitimg, app_landscapeimg, app_guestmodevisibility, app_permissiontype, "\
+                       "app_preload, app_submode, app_submode_mainid, component_type, package) " \
+                       "values('%s', '%s', '%s', '%s', '%s', '%s','%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",\
                         up->appid, "uiapp", up->exec, up->nodisplay, up->type, "\0", up->multiple,
                         "\0", up->taskmanage, up->enabled, up->hwacceleration,up->mainapp, up->recentimage,
                         up->appid, "uiapp", up->exec, up->nodisplay, up->type, "\0", up->multiple,
                         "\0", up->taskmanage, up->enabled, up->hwacceleration,up->mainapp, up->recentimage,
-                        up->launchcondition, up->indicatordisplay, up->portraitimg, up->landscapeimg, up->guestmode_visibility, up->permission_type, mfx->preload, up->component_type, mfx->package);
+                        up->launchcondition, up->indicatordisplay, up->portraitimg, up->landscapeimg, up->guestmode_visibility, up->permission_type,
+                        mfx->preload, up->submode, up->submode_mainid, up->component_type, mfx->package);
                ret = __exec_query(query);
                if (ret == -1) {
                        DBG("Package UiApp Info DB Insert Failed\n");
                ret = __exec_query(query);
                if (ret == -1) {
                        DBG("Package UiApp Info DB Insert Failed\n");
index 0319686..7460390 100755 (executable)
@@ -669,6 +669,16 @@ static int __uiapp_list_cb(void *data, int ncols, char **coltxt, char **colname)
                                info->manifest_info->uiapplication->preload = strdup(coltxt[i]);
                        else
                                info->manifest_info->uiapplication->preload = NULL;
                                info->manifest_info->uiapplication->preload = strdup(coltxt[i]);
                        else
                                info->manifest_info->uiapplication->preload = NULL;
+               } else if (strcmp(colname[i], "app_submode") == 0 ) {
+                       if (coltxt[i])
+                               info->manifest_info->uiapplication->submode = strdup(coltxt[i]);
+                       else
+                               info->manifest_info->uiapplication->submode = NULL;
+               } else if (strcmp(colname[i], "app_submode_mainid") == 0 ) {
+                       if (coltxt[i])
+                               info->manifest_info->uiapplication->submode_mainid = strdup(coltxt[i]);
+                       else
+                               info->manifest_info->uiapplication->submode_mainid = NULL;
                } else
                        continue;
        }
                } else
                        continue;
        }
@@ -1319,6 +1329,16 @@ static int __mini_appinfo_cb(void *data, int ncols, char **coltxt, char **colnam
                                info->uiapp_info->preload = strdup(coltxt[i]);
                        else
                                info->uiapp_info->preload = NULL;
                                info->uiapp_info->preload = strdup(coltxt[i]);
                        else
                                info->uiapp_info->preload = NULL;
+               } else if (strcmp(colname[i], "app_submode") == 0 ) {
+                       if (coltxt[i])
+                               info->uiapp_info->submode = strdup(coltxt[i]);
+                       else
+                               info->uiapp_info->submode = NULL;
+               } else if (strcmp(colname[i], "app_submode_mainid") == 0 ) {
+                       if (coltxt[i])
+                               info->uiapp_info->submode_mainid = strdup(coltxt[i]);
+                       else
+                               info->uiapp_info->submode_mainid = NULL;
                } else
                        continue;
        }
                } else
                        continue;
        }
@@ -1503,6 +1523,16 @@ static int __appinfo_cb(void *data, int ncols, char **coltxt, char **colname)
                                        info->uiapp_info->preload = strdup(coltxt[i]);
                                else
                                        info->uiapp_info->preload = NULL;
                                        info->uiapp_info->preload = strdup(coltxt[i]);
                                else
                                        info->uiapp_info->preload = NULL;
+                       } else if (strcmp(colname[i], "app_submode") == 0 ) {
+                               if (coltxt[i])
+                                       info->uiapp_info->submode = strdup(coltxt[i]);
+                               else
+                                       info->uiapp_info->submode = NULL;
+                       } else if (strcmp(colname[i], "app_submode_mainid") == 0 ) {
+                               if (coltxt[i])
+                                       info->uiapp_info->submode_mainid = strdup(coltxt[i]);
+                               else
+                                       info->uiapp_info->submode_mainid = NULL;
                        } else
                                continue;
                }
                        } else
                                continue;
                }
@@ -4852,6 +4882,50 @@ API int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char
        return PMINFO_R_OK;
 }
 
        return PMINFO_R_OK;
 }
 
+API int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+       retvm_if(hwacceleration == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       char *val = NULL;
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+       val = (char *)info->uiapp_info->hwacceleration;
+       if (val) {
+               if (strcasecmp(val, "not-use-GL") == 0)
+                       *hwacceleration = PMINFO_HWACCELERATION_NOT_USE_GL;
+               else if (strcasecmp(val, "use-GL") == 0)
+                       *hwacceleration = PMINFO_HWACCELERATION_USE_GL;
+               else
+                       *hwacceleration = PMINFO_HWACCELERATION_USE_SYSTEM_SETTING;
+       }
+       return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+       retvm_if(portrait_img == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       retvm_if(landscape_img == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+       if (info->app_component == PMINFO_UI_APP){
+               *portrait_img = (char *)info->uiapp_info->portraitimg;
+               *landscape_img = (char *)info->uiapp_info->landscapeimg;
+       }
+
+       return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h  handle, char **submode_mainid)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+       retvm_if(submode_mainid == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+       *submode_mainid = (char *)info->uiapp_info->submode_mainid;
+
+       return PMINFO_R_OK;
+}
+
 API int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
                        pkgmgrinfo_app_permission_list_cb permission_func, void *user_data)
 {
 API int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
                        pkgmgrinfo_app_permission_list_cb permission_func, void *user_data)
 {
@@ -4976,15 +5050,15 @@ API int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
        switch (component) {
        case PMINFO_UI_APP:
                if (mfx->uiapplication) {
        switch (component) {
        case PMINFO_UI_APP:
                if (mfx->uiapplication) {
-                       if (mfx->uiapplication->appcontrol) {
-                               appcontrol = mfx->uiapplication->appcontrol;
+                       if (mfx->uiapplication->appsvc) {
+                               appcontrol = mfx->uiapplication->appsvc;
                        }
                }
                break;
        case PMINFO_SVC_APP:
                if (mfx->serviceapplication) {
                        }
                }
                break;
        case PMINFO_SVC_APP:
                if (mfx->serviceapplication) {
-                       if (mfx->serviceapplication->appcontrol) {
-                               appcontrol = mfx->serviceapplication->appcontrol;
+                       if (mfx->serviceapplication->appsvc) {
+                               appcontrol = mfx->serviceapplication->appsvc;
                        }
                }
                break;
                        }
                }
                break;
@@ -5157,22 +5231,6 @@ API int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h han
        return PMINFO_R_OK;
 }
 
        return PMINFO_R_OK;
 }
 
-
-API int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
-{
-       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
-       retvm_if(portrait_img == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
-       retvm_if(landscape_img == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
-       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
-
-       if (info->app_component == PMINFO_UI_APP){
-               *portrait_img = (char *)info->uiapp_info->portraitimg;
-               *landscape_img = (char *)info->uiapp_info->landscapeimg;
-       }
-
-       return PMINFO_R_OK;
-}
-
 API int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
 API int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
@@ -5218,24 +5276,6 @@ API int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enable
 
 }
 
 
 }
 
-API int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
-{
-       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
-       retvm_if(hwacceleration == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
-       char *val = NULL;
-       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
-       val = (char *)info->uiapp_info->hwacceleration;
-       if (val) {
-               if (strcasecmp(val, "not-use-GL") == 0)
-                       *hwacceleration = PMINFO_HWACCELERATION_NOT_USE_GL;
-               else if (strcasecmp(val, "use-GL") == 0)
-                       *hwacceleration = PMINFO_HWACCELERATION_USE_GL;
-               else
-                       *hwacceleration = PMINFO_HWACCELERATION_USE_SYSTEM_SETTING;
-       }
-       return PMINFO_R_OK;
-}
-
 API int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
 API int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
@@ -5308,6 +5348,24 @@ API int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload
        return PMINFO_R_OK;
 }
 
        return PMINFO_R_OK;
 }
 
+API int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
+{
+       retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL\n");
+       retvm_if(submode == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+       char *val = NULL;
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+       val = (char *)info->uiapp_info->submode;
+       if (val) {
+               if (strcasecmp(val, "true") == 0)
+                       *submode = 1;
+               else if (strcasecmp(val, "false") == 0)
+                       *submode = 0;
+               else
+                       *submode = 0;
+       }
+       return PMINFO_R_OK;
+}
+
 API int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
 API int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle)
 {
        retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");