Add splash screen display field for appinfo table 95/61995/9 accepted/tizen/common/20160321.150437 accepted/tizen/ivi/20160322.023142 accepted/tizen/mobile/20160321.113336 accepted/tizen/tv/20160321.113412 accepted/tizen/wearable/20160321.113434 submit/tizen/20160321.014821 submit/tizen_ivi/20160322.020156
authorHwankyu Jhun <h.jhun@samsung.com>
Sat, 12 Mar 2016 06:35:29 +0000 (15:35 +0900)
committerSemun Lee <sm79.lee@samsung.com>
Mon, 21 Mar 2016 01:57:27 +0000 (18:57 -0700)
- Add new API
pkgmgrinfo_appinfo_get_splash_screen_display

Change-Id: Ia04c9b977b675a060e7c057d2ae85d304ae752e1
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
include/pkgmgr-info.h
include/pkgmgrinfo_basic.h
parser/manifest.xsd.in
parser/manifest.xsd.ref
parser/pkgmgr_parser.c
parser/pkgmgr_parser_db.c
src/pkgmgrinfo_appinfo.c
src/pkgmgrinfo_basic.c

index 1fa977d..ab1ed59 100644 (file)
@@ -4394,6 +4394,22 @@ int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
 
 /**
+ * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
+ * @brief      This API gets the application 'splash_screen_display' 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] splash_screen_display   pointer to hold package splash_screen_display 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
+ */
+int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
+
+/**
  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
  * @brief      This API destroys the application information handle freeing up all the resources
  *
index c14a553..2cd11a5 100644 (file)
@@ -142,7 +142,7 @@ typedef struct application_x {
        char *api_version;      /*set from package_x*/
        char *for_all_users; /**< Flag that indicates if the package is available for everyone or for current user only, no xml part*/
        char *is_disabled; /**< Flag that indicates if the application is disabled or not, no xml part*/
-
+       char *splash_screen_display; /*attr, default: "true"*/
        GList *label;   /*element*/
        GList *icon;    /*element*/
        GList *image;   /*element*/
index 1506d03..3150bbd 100644 (file)
       <xs:attribute name="multi-instance-mainid" type="xs:string"/>
       <xs:attribute name="ui-gadget" type="xs:boolean"/>
       <xs:attribute name="launch_mode" type="xs:string"/>
+      <xs:attribute name="splash-screen-display" type="xs:boolean"/>
       <xs:anyAttribute namespace="##any" processContents="lax"/>
     </xs:complexType>
   </xs:element>
index 3dd65b4..1341b5e 100644 (file)
       <xs:attribute name="multi-instance-mainid" type="xs:string"/>
       <xs:attribute name="ui-gadget" type="xs:boolean"/>
       <xs:attribute name="launch_mode" type="packages:LaunchType"/>
+      <xs:attribute name="splash-screen-display" type="xs:boolean"/>
     </xs:complexType>
   </xs:element>
   <xs:element name="ime-application">
index 4f38b9a..ca5ba0e 100644 (file)
@@ -1624,6 +1624,7 @@ static int __ps_process_application(xmlTextReaderPtr reader, application_x *appl
        __save_xml_attribute(reader, "ui-gadget", &application->ui_gadget, "false");
        __save_xml_attribute(reader, "auto-restart", &application->autorestart, "false");
        __save_xml_attribute(reader, "on-boot", &application->onboot, "false");
+       __save_xml_attribute(reader, "splash-screen-display", &application->splash_screen_display, "true");
 
        application->package= strdup(package);
        /* overwrite some attributes if the app is widgetapp */
index 91142ae..c0a792f 100644 (file)
@@ -172,6 +172,7 @@ sqlite3 *pkgmgr_cert_db;
                                                "app_root_path text, " \
                                                "app_api_version text, " \
                                                "app_effective_appid text, " \
+                                               "app_splash_screen_display text DEFAULT 'true', " \
                                                "FOREIGN KEY(package) " \
                                                "REFERENCES package_info(package) " \
                                                "ON DELETE CASCADE)"
@@ -1206,7 +1207,7 @@ static int __insert_application_info(manifest_x *mfx)
                        "app_preload, app_submode, app_submode_mainid, app_installed_storage, app_process_pool, " \
                        "app_launch_mode, app_ui_gadget, app_support_disable, component_type, package, " \
                        "app_tep_name, app_background_category, app_package_type, app_root_path, app_api_version, " \
-                       "app_effective_appid) " \
+                       "app_effective_appid, app_splash_screen_display) " \
                        "values(" \
                        "'%s', '%s', '%s', '%s', '%s', " \
                        "'%s', '%s', '%s', '%s', '%s', " \
@@ -1215,7 +1216,7 @@ static int __insert_application_info(manifest_x *mfx)
                        "'%s', '%s', '%s', '%s', '%s', " \
                        "'%s', '%s', '%s', '%s', '%s', " \
                        "'%s', '%d', '%s', '%s', '%s', " \
-                       "'%s')", \
+                       "'%s', '%s')", \
                        app->appid, app->component_type, app->exec, app->nodisplay, app->type,
                        app->onboot, app->multiple, app->autorestart, app->taskmanage, app->enabled,
                        app->hwacceleration, app->screenreader, app->mainapp, __get_str(app->recentimage), app->launchcondition,
@@ -1224,7 +1225,7 @@ static int __insert_application_info(manifest_x *mfx)
                        mfx->preload, app->submode, __get_str(app->submode_mainid), mfx->installed_storage, app->process_pool,
                        app->launch_mode, app->ui_gadget, mfx->support_disable, app->component_type, mfx->package,
                        __get_str(mfx->tep_name), background_value, type, mfx->root_path, __get_str(mfx->api_version),
-                       __get_str(effective_appid));
+                       __get_str(effective_appid), app->splash_screen_display);
 
                ret = __exec_query(query);
                if (ret == -1) {
index 4a2cd88..28fdda9 100644 (file)
@@ -595,7 +595,8 @@ static int _appinfo_get_application(sqlite3 *db, const char *appid,
                "app_support_disable, "
                "component_type, package, app_process_pool, app_installed_storage, "
                "app_background_category, app_package_type, "
-               "app_root_path, app_api_version, app_effective_appid, app_disable "
+                "app_root_path, app_api_version, app_effective_appid, app_disable, "
+                "app_splash_screen_display "
                "FROM package_app_info WHERE app_id='%s' "
                "AND (app_disable='%s' "
                "%s app_id %s IN "
@@ -671,7 +672,8 @@ static int _appinfo_get_application(sqlite3 *db, const char *appid,
        _save_column_str(stmt, idx++, &info->root_path);
        _save_column_str(stmt, idx++, &info->api_version);
        _save_column_str(stmt, idx++, &info->effective_appid);
-       _save_column_str(stmt, idx++, &info->is_disabled);
+        _save_column_str(stmt, idx++, &info->is_disabled);
+        _save_column_str(stmt, idx++, &info->splash_screen_display);
 
        info->background_category = __get_background_category(bg_category_str);
        free(bg_category_str);
@@ -807,7 +809,8 @@ int _appinfo_get_applist(uid_t uid, const char *locale, GHashTable **appinfo_tab
                        "app_installed_storage, app_process_pool, app_launch_mode, "
                        "app_package_type, component_type, package, app_tep_name, "
                        "app_background_category, app_root_path, app_api_version, "
-                       "app_effective_appid, (CASE WHEN A.app_disable='true' THEN 'true' "
+                        "app_effective_appid, app_disable, app_splash_screen_display, "
+                       "(CASE WHEN A.app_disable='true' THEN 'true' "
                        "ELSE (CASE WHEN (SELECT app_id FROM package_app_disable_for_user "
                        "WHERE app_id=A.app_id AND uid='%d') IS NULL "
                        "THEN 'false' ELSE 'true' END) END) AS app_disable "
@@ -862,7 +865,8 @@ int _appinfo_get_applist(uid_t uid, const char *locale, GHashTable **appinfo_tab
                _save_column_str(stmt, idx++, &appinfo->api_version);
 
                _save_column_str(stmt, idx++, &appinfo->effective_appid);
-               _save_column_str(stmt, idx++, &appinfo->is_disabled);
+                _save_column_str(stmt, idx++, &appinfo->is_disabled);
+                _save_column_str(stmt, idx++, &appinfo->splash_screen_display);
 
                appinfo->background_category = __get_background_category(bg_category_str);
                free(bg_category_str);
@@ -1177,6 +1181,8 @@ static int _appinfo_copy_appinfo(application_x **application, application_x *dat
                app_info->package_type = strdup(data->package_type);
        if (data->effective_appid != NULL)
                app_info->effective_appid = strdup(data->effective_appid);
+       if (data->splash_screen_display != NULL)
+               app_info->splash_screen_display = strdup(data->splash_screen_display);
 
        /* GList */
        ret = 0;
@@ -2618,7 +2624,23 @@ API int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
        *global = _get_bool_value(info->app_info->for_all_users);
 
        return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
+{
+       pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
 
+       if (info == NULL || splash_screen_display == NULL) {
+               _LOGE("Invalid parameter");
+               return PMINFO_R_EINVAL;
+       }
+
+       if (info->app_info == NULL || info->app_info->splash_screen_display == NULL)
+               return PMINFO_R_ERROR;
+
+       *splash_screen_display = _get_bool_value(info->app_info->splash_screen_display);
+
+       return PMINFO_R_OK;
 }
 
 API int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
index 85f8144..5d03253 100644 (file)
@@ -301,6 +301,8 @@ static void __ps_free_application(gpointer data)
                free((void *)application->effective_appid);
        if (application->is_disabled)
                free((void *)application->is_disabled);
+       if (application->splash_screen_display)
+               free((void *)application->splash_screen_display);
 
        /*Free Label*/
        g_list_free_full(application->label, __ps_free_label);