int *mime_count, char ***mime);
/**
+ * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
+ int *subapp_count, char ***subapp)
+ * @brief This API gets the list of subapp of the application
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to the appcontrol handle.
+ * @param[out] subapp_count pointer to hold number of subapp
+ * @param[out] subapp pointer to hold list of subapp
+ * @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_uri()
+ * @see pkgmgrinfo_appinfo_get_operation()
+ * @code
+int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
+{
+ int sc = 0;
+ int i = 0;
+ char **subapp = NULL;
+ pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
+ for (i = 0; i < sc; i++) {
+ if (strcmp(subapp[i], (char *)user_data) == 0)
+ return -1;
+ else
+ return 0;
+ }
+}
+
+static int check_subapp(const char *appid, char *subapp)
+{
+ int ret = 0;
+ pkgmgrinfo_appinfo_h handle = NULL;
+ ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return -1;
+ }
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
+ int *subapp_count, char ***subapp);
+
+/**
* @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
* @brief This API gets the notification icon of the application
*
*/
int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
+
+/**
+ * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
+ * @brief This API gets the value for given application is preload 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] preload pointer to hold preload 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_preload(const char *appid)
+{
+ int ret = 0;
+ bool preload = 0;
+ pkgmgrinfo_appinfo_h handle = NULL;
+ ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return -1;
+ }
+ printf("preload: %d\n", preload);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
+
/**
* @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
* @brief This API destroys the application information handle freeing up all the resources
Name: pkgmgr-info
Summary: Packager Manager infomation api for package
-Version: 0.0.119
+Version: 0.0.120
Release: 1
Group: Application Framework/Package Management
License: Apache-2.0
free((void *)uiapplication->component_type);
uiapplication->component_type = NULL;
}
+ if (uiapplication->preload) {
+ free((void *)uiapplication->preload);
+ uiapplication->preload = NULL;
+ }
free((void*)uiapplication);
uiapplication = NULL;
DBG("parsing manifest for upgradation: %s\n", manifest);
manifest_x *mfx = NULL;
int ret = -1;
- bool preload;
- pkgmgrinfo_pkginfo_h handle;
+ bool preload = 0;
+ char *csc_path = NULL;
+ pkgmgrinfo_pkginfo_h handle = NULL;
xmlInitParser();
mfx = pkgmgr_parser_process_manifest_xml(manifest);
if (ret != PMINFO_R_OK)
DBG("pkgmgrinfo_pkginfo_is_preload failed\n");
- if (preload){
+ if (preload) {
free((void *)mfx->preload);
mfx->preload = strdup("true");
}
+ ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &csc_path);
+ if (ret != PMINFO_R_OK)
+ DBG("pkgmgrinfo_pkginfo_get_csc_path failed\n");
+
+ if (csc_path != NULL) {
+ if (mfx->csc_path)
+ free((void *)mfx->csc_path);
+ mfx->csc_path = strdup(csc_path);
+ }
+
ret = pkgmgr_parser_update_manifest_info_in_db(mfx);
if (ret == -1)
DBG("DB Update failed\n");
const char *app_component;
const char *permission_type;
const char *component_type;
+ const char *preload;
struct label_x *label;
struct icon_x *icon;
struct image_x *image;
"app_landscapeimg text, " \
"app_guestmodevisibility text DEFAULT 'true', " \
"app_permissiontype text DEFAULT 'normal', " \
+ "app_preload text DEFAULT 'false', " \
"component_type text, " \
"package text not null, " \
"FOREIGN KEY(package) " \
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, 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')",\
+ "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')",\
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, up->component_type, mfx->package);
+ up->launchcondition, up->indicatordisplay, up->portraitimg, up->landscapeimg, up->guestmode_visibility, up->permission_type, mfx->preload, up->component_type, mfx->package);
ret = __exec_query(query);
if (ret == -1) {
DBG("Package UiApp Info DB Insert Failed\n");
int operation_count;
int uri_count;
int mime_count;
+ int subapp_count;
char **operation;
char **uri;
char **mime;
+ char **subapp;
} pkgmgrinfo_appcontrol_x;
typedef int (*sqlite_query_callback)(void *data, int ncols, char **coltxt, char **colname);
info->manifest_info->uiapplication->component_type = strdup(coltxt[i]);
else
info->manifest_info->uiapplication->component_type = NULL;
+ } else if (strcmp(colname[i], "app_preload") == 0 ) {
+ if (coltxt[i])
+ info->manifest_info->uiapplication->preload = strdup(coltxt[i]);
+ else
+ info->manifest_info->uiapplication->preload = NULL;
} else
continue;
}
info->uiapp_info->component_type = strdup(coltxt[i]);
else
info->uiapp_info->component_type = NULL;
+ } else if (strcmp(colname[i], "app_preload") == 0 ) {
+ if (coltxt[i])
+ info->uiapp_info->preload = strdup(coltxt[i]);
+ else
+ info->uiapp_info->preload = NULL;
} else
continue;
}
info->uiapp_info->component_type = strdup(coltxt[i]);
else
info->uiapp_info->component_type = NULL;
+ } else if (strcmp(colname[i], "app_preload") == 0 ) {
+ if (coltxt[i])
+ info->uiapp_info->preload = strdup(coltxt[i]);
+ else
+ info->uiapp_info->preload = NULL;
} else
continue;
}
check_result = __check_app_locale_from_app_localized_info_by_fallback(db, appid, locale);
if(check_result == 1) {
locale_new = __get_app_locale_from_app_localized_info_by_fallback(db, appid, locale);
- _LOGD("%s found (%s) language-locale in DB by fallback!\n", appid, locale_new);
free(locale);
if (locale_new == NULL)
locale_new = strdup(DEFAULT_LOCALE);
/* default locale */
free(locale);
- _LOGD("%s DEFAULT_LOCALE)\n", appid);
return strdup(DEFAULT_LOCALE);
}
return PMINFO_R_OK;
}
+API int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
+ int *subapp_count, char ***subapp)
+{
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+ retvm_if(subapp == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+ retvm_if(subapp_count == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+ pkgmgrinfo_appcontrol_x *data = (pkgmgrinfo_appcontrol_x *)handle;
+ *subapp_count = data->subapp_count;
+ *subapp = data->subapp;
+ return PMINFO_R_OK;
+}
+
API int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
{
retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL\n");
int oc = 0;
int mc = 0;
int uc = 0;
+ int sc = 0;
char *pkgid = NULL;
char *manifest = NULL;
char **operation = NULL;
char **uri = NULL;
char **mime = NULL;
+ char **subapp = NULL;
appcontrol_x *appcontrol = NULL;
manifest_x *mfx = NULL;
operation_x *op = NULL;
uri_x *ui = NULL;
mime_x *mi = NULL;
+ subapp_x *sa = NULL;
pkgmgrinfo_app_component component;
pkgmgrinfo_appcontrol_x *ptr = NULL;
ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
mc = mc + 1;
mi = appcontrol->mime;
+ sa = appcontrol->subapp;
+ for (; sa; sa = sa->next)
+ sc = sc + 1;
+ sa = appcontrol->subapp;
+
operation = (char **)calloc(oc, sizeof(char *));
for (i = 0; i < oc; i++) {
operation[i] = strndup(op->name, PKG_STRING_LEN_MAX - 1);
mime[i] = strndup(mi->name, PKG_STRING_LEN_MAX - 1);
mi = mi->next;
}
+
+ subapp = (char **)calloc(sc, sizeof(char *));
+ for (i = 0; i < sc; i++) {
+ subapp[i] = strndup(sa->name, PKG_STRING_LEN_MAX - 1);
+ sa = sa->next;
+ }
+
/*populate appcontrol handle*/
ptr->operation_count = oc;
ptr->uri_count = uc;
ptr->mime_count = mc;
+ ptr->subapp_count = sc;
ptr->operation = operation;
ptr->uri = uri;
ptr->mime = mime;
+ ptr->subapp = subapp;
+
ret = appcontrol_func((void *)ptr, user_data);
for (i = 0; i < oc; i++) {
if (operation[i]) {
free(mime);
mime = NULL;
}
+ for (i = 0; i < sc; i++) {
+ if (subapp[i]) {
+ free(subapp[i]);
+ subapp[i] = NULL;
+ }
+ }
+ if (subapp) {
+ free(subapp);
+ subapp = NULL;
+ }
if (ret < 0)
break;
uc = 0;
mc = 0;
oc = 0;
+ sc = 0;
}
pkgmgr_parser_free_manifest_xml(mfx);
if (ptr) {
return PMINFO_R_OK;
}
+API int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
+{
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL\n");
+ retvm_if(preload == 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->preload;
+ if (val) {
+ if (strcasecmp(val, "true") == 0)
+ *preload = 1;
+ else if (strcasecmp(val, "false") == 0)
+ *preload = 0;
+ else
+ *preload = 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");