/** Integer property for filtering app disabled by user*/
#define PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER "PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER_VALUE"
+/** Integer property for filtering app support mode */
+#define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
/** Boolean property for filtering based on app info*/
#define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
/**
+ * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
+ * @brief This API gets the support_mode of package
+ *
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to package info handle
+ * @param[out] support_mode pointer to hold support_mode of package
+ * @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
+ * @code
+static int get_support_mode(const char *pkgid)
+{
+ int ret = 0;
+ int support_mode = 0;
+ pkgmgrinfo_pkginfo_h handle = NULL;
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+
+ ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return -1;
+ }
+ printf("support_mode : %s\n", support_mode);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
+
+/**
* @fn int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
* @brief This API compare the cert information from given package id
*
int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
/**
+ * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
+ * @brief This API gets the support_mode 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] support_mode pointer to hold app support_mode
+ * @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()
+ * @code
+static int get_app_support_mode(const char *appid)
+{
+ int ret = 0;
+ int support_mode = 0;
+ pkgmgrinfo_appinfo_h handle = NULL;
+ ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return -1;
+ }
+ printf("support_mode: %s\n", support_mode);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
+
+/**
* @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
* @brief This API gets the list of permission for a particular application
char *package_system; /*set from package_x*/
char *removable; /*set from package_x*/
char *package_installed_time; /*installed time after finishing of installation*/
+ char *support_mode; /*attr*/
GList *label; /*element*/
GList *icon; /*element*/
GList *image; /*element*/
char *root_path; /**< package root path, attr*/
char *csc_path; /**< package csc path, attr*/
char *nodisplay_setting; /**< package no display setting menu, attr, default: "false"*/
+ char *support_mode; /**< package support mode, attr*/
char *support_disable; /**< package support disable flag, attr, default: "false"*/
char *api_version; /**< minimum version of API package using, attr, default: patch_version trimmed version from tizen_full_version*/
char *tep_name; /*no xml part*/
/*Currently No Fields*/
E_PMINFO_APPINFO_PROP_APP_MIN_INT = 601,
E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER = E_PMINFO_APPINFO_PROP_APP_MIN_INT,
- E_PMINFO_APPINFO_PROP_APP_MAX_INT = E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER
+ E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE,
+ E_PMINFO_APPINFO_PROP_APP_MAX_INT = E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE
} pkgmgrinfo_appinfo_filter_prop_int;
/*Integer properties for filtering based on app info*/
#define APP_BG_CATEGORY_IOTCOMM_STR "iot-communication"
#define APP_BG_CATEGORY_SYSTEM "system"
+/* Integer property for mode */
+#define APP_SUPPORT_MODE_ULTRA_POWER_SAVING 0x00001
+#define APP_SUPPORT_MODE_COOL_DOWN 0x00002
+#define APP_SUPPORT_MODE_SCREEN_READER 0x00004
+
/**
* @brief A type to retrieve uid information from the manifest handle
*/
"root_path TEXT, " \
"external_path TEXT, " \
"csc_path TEXT, " \
+ "package_support_mode TEXT, " \
"package_support_disable TEXT NOT NULL DEFAULT 'false', " \
"package_disable TEXT NOT NULL DEFAULT 'false')"
"app_process_pool TEXT NOT NULL DEFAULT 'false', " \
"app_launch_mode TEXT NOT NULL DEFAULT 'caller', " \
"app_ui_gadget TEXT NOT NULL DEFAULT 'false', " \
+ "app_support_mode TEXT, " \
"app_support_disable TEXT NOT NULL DEFAULT 'false', " \
"app_disable TEXT NOT NULL DEFAULT 'false', " \
"app_package_type TEXT DEFAULT 'tpk', " \
"app_hwacceleration, app_screenreader, app_mainapp, app_recentimage, app_launchcondition, " \
"app_indicatordisplay, app_portraitimg, app_landscapeimg, app_guestmodevisibility, app_permissiontype, " \
"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_launch_mode, app_ui_gadget, app_support_mode, app_support_disable, component_type, package, " \
"app_tep_name, app_zip_mount_file, app_background_category, app_package_type, app_root_path, " \
"app_api_version, app_effective_appid, app_splash_screen_display, app_package_system, app_removable, " \
- "app_package_installed_time) " \
+ "app_package_installed_time, app_support_mode) " \
"VALUES(" \
"%Q, %Q, %Q, LOWER(%Q), %Q, " \
"LOWER(%Q), LOWER(%Q), LOWER(%Q), LOWER(%Q), LOWER(%Q), " \
"%Q, %Q, %Q, %Q, %Q, " \
"LOWER(%Q), %Q, %Q, LOWER(%Q), %Q, " \
"LOWER(%Q), LOWER(%Q), %Q, %Q, LOWER(%Q), " \
- "COALESCE(%Q, 'caller'), LOWER(%Q), LOWER(%Q), %Q, %Q, " \
+ "COALESCE(%Q, 'caller'), LOWER(%Q), %Q, LOWER(%Q), %Q, %Q, " \
"%Q, %Q, %d, %Q, %Q, " \
"%Q, %Q, LOWER(%Q), LOWER(%Q), LOWER(%Q), " \
- "%Q)", \
+ "%Q, %Q)", \
app->appid, app->component_type, app->exec, __get_bool(app->nodisplay, false), app->type,
__get_bool(app->onboot, false), __get_bool(app->multiple, false), __get_bool(app->autorestart, false), __get_bool(app->taskmanage, false), __get_bool(app->enabled, true),
app->hwacceleration, app->screenreader, app->mainapp, app->recentimage, app->launchcondition,
__get_bool(app->indicatordisplay, true), app->portraitimg, app->landscapeimg,
__get_bool(app->guestmode_visibility, true), app->permission_type,
__get_bool(mfx->preload, false), __get_bool(app->submode, false), app->submode_mainid, mfx->installed_storage, __get_bool(app->process_pool, false),
- app->launch_mode, __get_bool(app->ui_gadget, false), __get_bool(mfx->support_disable, false), app->component_type, mfx->package,
+ app->launch_mode, __get_bool(app->ui_gadget, false), mfx->support_mode, __get_bool(mfx->support_disable, false), app->component_type, mfx->package,
mfx->tep_name, mfx->zip_mount_file, background_value, type, mfx->root_path, mfx->api_version,
- effective_appid, __get_bool(app->splash_screen_display, false), __get_bool(mfx->system, false), __get_bool(mfx->removable, true), mfx->installed_time);
+ effective_appid, __get_bool(app->splash_screen_display, false), __get_bool(mfx->system, false), __get_bool(mfx->removable, true), mfx->installed_time, mfx->support_mode);
ret = __exec_query(query);
if (ret == -1) {
GList *appicon = NULL;
GList *appimage = NULL;
+ int temp_pkg_mode = 0;
+ int temp_app_mode = 0;
+ char pkg_mode[10] = {'\0'};
+ application_x *up_support_mode = NULL;
+ GList *list_up = NULL;
+
if (mfx->author && mfx->author->data) {
author = (author_x *)mfx->author->data;
if (author->text)
auth_href = author->href;
}
+ if (mfx->support_mode)
+ temp_pkg_mode = atoi(mfx->support_mode);
+
+ list_up = mfx->application;
+ while (list_up != NULL) {
+ up_support_mode = (application_x *)list_up->data;
+ if (up_support_mode->support_mode) {
+ temp_app_mode = atoi(up_support_mode->support_mode);
+ temp_pkg_mode |= temp_app_mode;
+ }
+ list_up = list_up->next;
+ }
+ sprintf(pkg_mode, "%d", temp_pkg_mode);
+
+ if(mfx->support_mode)
+ free((void *)mfx->support_mode);
+ mfx->support_mode = strdup(pkg_mode);
+
/*Insert in the package_info DB*/
sqlite3_snprintf(MAX_QUERY_LEN, query,
"INSERT INTO package_info(" \
"install_location, package_size, package_removable, package_preload, package_readonly, " \
"package_update, package_appsetting, package_nodisplay, package_system, author_name, " \
"author_email, author_href, installed_time, installed_storage, storeclient_id, " \
- "mainapp_id, package_url, root_path, csc_path, package_support_disable) " \
+ "mainapp_id, package_url, root_path, csc_path, package_support_mode, package_support_disable, package_support_mode) " \
"VALUES(" \
"%Q, %Q, %Q, %Q, %Q, %Q, " \
"%Q, %Q, LOWER(%Q), LOWER(%Q), LOWER(%Q), " \
"LOWER(%Q), LOWER(%Q), LOWER(%Q), LOWER(%Q), %Q, " \
"%Q, %Q, %Q, %Q, %Q, " \
- "%Q, %Q, %Q, %Q, LOWER(%Q))",
+ "%Q, %Q, %Q, %Q, %Q, LOWER(%Q), %Q)",
mfx->package, mfx->type, mfx->version, mfx->api_version, mfx->tep_name, mfx->zip_mount_file,
mfx->installlocation, mfx->package_size, __get_bool(mfx->removable, true), __get_bool(mfx->preload, false), __get_bool(mfx->readonly, false),
__get_bool(mfx->update, false), __get_bool(mfx->appsetting, false), __get_bool(mfx->nodisplay_setting, false), __get_bool(mfx->system, false), auth_name,
auth_email, auth_href, mfx->installed_time, mfx->installed_storage,
mfx->storeclient_id,
- mfx->mainapp_id, mfx->package_url, mfx->root_path, mfx->csc_path, __get_bool(mfx->support_disable, false));
+ mfx->mainapp_id, mfx->package_url, mfx->root_path, mfx->csc_path, mfx->support_mode, __get_bool(mfx->support_disable, false), mfx->support_mode);
ret = __exec_query(query);
if (ret == -1) {
"ai.app_splash_screen_display, ai.app_tep_name, "
"ai.app_zip_mount_file, ai.component_type, ai.package, "
"ai.app_external_path, ai.app_package_system, ai.app_removable, "
- "ai.app_package_installed_time";
+ "ai.app_package_installed_time, ai.app_support_mode";
static const char query_label[] =
", COALESCE("
"(SELECT app_label FROM package_app_localized_info WHERE ai.app_id=app_id AND app_locale=?), "
_save_column_str(stmt, idx++, &info->package_system);
_save_column_str(stmt, idx++, &info->removable);
_save_column_str(stmt, idx++, &info->package_installed_time);
+ _save_column_str(stmt, idx++, &info->support_mode);
info->for_all_users =
strdup((uid != GLOBAL_USER) ? "false" : "true");
return pkgmgrinfo_appinfo_usr_get_datacontrol_appid(providerid, _getuid(), appid);
}
+API int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
+{
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+ retvm_if(support_mode == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+
+ pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+ if (info->app_info->support_mode)
+ *support_mode = atoi(info->app_info->support_mode);
+ else
+ *support_mode = 0;
+
+ return PMINFO_R_OK;
+}
+
API int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
pkgmgrinfo_app_permission_list_cb permission_func, void *user_data)
{
free((void *)application->removable);
if (application->package_installed_time)
free((void *)application->package_installed_time);
+ if (application->support_mode)
+ free((void *)application->support_mode);
/*Free Label*/
g_list_free_full(application->label, __ps_free_label);
free((void *)package->zip_mount_file);
if (package->external_path)
free((void *)package->external_path);
+ if (package->support_mode)
+ free((void *)package->support_mode);
/*Free Icon*/
g_list_free_full(package->icon, __ps_free_icon);
"pi.storeclient_id, pi.mainapp_id, pi.package_url, "
"pi.root_path, pi.csc_path, pi.package_nodisplay, "
"pi.package_api_version, pi.package_support_disable, "
- "pi.package_tep_name, pi.package_zip_mount_file, pi.external_path";
+ "pi.package_tep_name, pi.package_zip_mount_file, pi.external_path, "
+ "pi.package_support_mode";
static const char query_author[] =
", pi.author_name, pi.author_email, pi.author_href";
static const char query_label[] =
_save_column_str(stmt, idx++, &info->tep_name);
_save_column_str(stmt, idx++, &info->zip_mount_file);
_save_column_str(stmt, idx++, &info->external_path);
+ _save_column_str(stmt, idx++, &info->support_mode);
info->for_all_users =
strdup((uid != GLOBAL_USER) ? "false" : "true");
return PMINFO_R_OK;
}
+API int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
+{
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
+ retvm_if(support_mode == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+
+ pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+ if (info->pkg_info->support_mode)
+ *support_mode = atoi(info->pkg_info->support_mode);
+ else
+ *support_mode = 0;
+
+ return PMINFO_R_OK;
+}
API int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
{
};
static struct _appinfo_int_map_t appinfo_int_prop_map[] = {
- {E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER, PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER}
+ {E_PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER, PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER},
+ {E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE, PMINFO_APPINFO_PROP_APP_SUPPORT_MODE}
};
struct _appinfo_bool_map_t {
"(SELECT app_id from package_app_info_for_uid WHERE uid=? " \
"AND is_disabled='true' COLLATE NOCASE)");
break;
+ case E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE:
+ snprintf(buf, sizeof(buf), "ai.app_support_mode=?");
+ break;
default:
_LOGE("Invalid Property Type\n");
*condition = NULL;