int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
/**
+ * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
+ * @brief This API gets the application 'is_disable' 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] disabled pointer to hold application is_disabled value
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @pre pkgmgrinfo_appinfo_get_appinfo()
+ * @post pkgmgrinfo_appinfo_destroy_appinfo()
+ * @code
+static int get_app_is_disable(const char *appid)
+{
+ int ret = 0;
+ bool is_disable;
+ pkgmgrinfo_appinfo_h handle = NULL;
+ ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return -1;
+ }
+ printf("app is_disable: %d\n", is_disable);
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
+
+/**
* @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
* @brief This API gets whethere the given application is global application or user application
*
char *root_path; /*set from package_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*/
+
GList *label; /*element*/
GList *icon; /*element*/
GList *image; /*element*/
"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 "
- "FROM package_app_info WHERE app_disable='false' AND app_id NOT IN "
- "(SELECT app_id FROM package_app_disable_for_user WHERE uid='%d')",
- (int)getuid());
+ "app_effective_appid, (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 "
+ "FROM package_app_info A", (int)getuid());
if (query == NULL) {
_LOGE("Out of memory");
_save_column_str(stmt, idx++, &bg_category_str);
_save_column_str(stmt, idx++, &appinfo->root_path);
_save_column_str(stmt, idx++, &appinfo->api_version);
+
_save_column_str(stmt, idx++, &appinfo->effective_appid);
+ _save_column_str(stmt, idx++, &appinfo->is_disabled);
appinfo->background_category = __get_background_category(bg_category_str);
free(bg_category_str);
return PMINFO_R_OK;
}
+API int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
+{
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+ retvm_if(disabled == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL");
+ pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+ if (info->app_info == NULL || info->app_info->is_disabled == NULL)
+ return PMINFO_R_ERROR;
+
+ *disabled = _get_bool_value(info->app_info->is_disabled);
+
+ return PMINFO_R_OK;
+}
+
API int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
{
pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
free((void *)application->for_all_users);
if (application->effective_appid)
free((void *)application->effective_appid);
+ if (application->is_disabled)
+ free((void *)application->is_disabled);
/*Free Label*/
g_list_free_full(application->label, __ps_free_label);