char *condition = NULL;
char buf[MAX_QUERY_LEN] = { '\0' };
char tmp_query[MAX_QUERY_LEN] = { '\0' };
+ static const char query_pkg_disable[] = " AND ai.package IN "
+ "(SELECT package FROM package_info WHERE package_disable='false')";
GSList *list;
- if (filter == NULL)
- return PMINFO_R_OK;
-
len += strlen(" WHERE 1=1");
strncat(buf, " WHERE 1=1", MAX_QUERY_LEN - len - 1);
+
+ if (filter == NULL) {
+ strncat(buf, query_pkg_disable, MAX_QUERY_LEN - len - 1);
+ *query = strdup(buf);
+ return PMINFO_R_OK;
+ }
+
for (list = filter->list; list; list = list->next) {
joined |= __get_filter_condition(list->data, &condition, bind_params);
if (condition == NULL)
}
strncat(tmp_query, buf, MAX_QUERY_LEN - len - 1);
+ len += strlen(buf);
+ strncat(tmp_query, query_pkg_disable, MAX_QUERY_LEN - len - 1);
+
*query = strdup(tmp_query);
if (*query == NULL)
return PMINFO_R_ERROR;
"ai.app_package_type, ai.app_root_path, ai.app_api_version, "
"ai.app_effective_appid, ai.app_disable, "
"ai.app_splash_screen_display, ai.app_tep_name, "
- "ai.app_zip_mount_file, ai.component_type, ai.package";
+ "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_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->zip_mount_file);
_save_column_str(stmt, idx++, &info->component_type);
_save_column_str(stmt, idx++, &info->package);
+ _save_column_str(stmt, idx++, &info->external_path);
+ _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");
}
}
+ if (__appinfo_check_installed_storage(info) != PMINFO_R_OK) {
+ ret = PMINFO_R_ERROR;
+ pkgmgrinfo_basic_free_application(info);
+ info = NULL;
+ continue;
+ }
+
g_hash_table_insert(applications, (gpointer)info->appid,
(gpointer)info);
}
if (metadata->value == NULL)
*metadata_value = "";
else
- *metadata_value = (char*)metadata->value;
+ *metadata_value = (char *)metadata->value;
return PMINFO_R_OK;
}
}
return PMINFO_R_OK;
}
+API int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
+{
+ pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+ if (handle == NULL || installed_time == NULL) {
+ LOGE("invalid parameter");
+ return PMINFO_R_EINVAL;
+ }
+
+ if (info->app_info == NULL || info->app_info->package_installed_time == NULL)
+ return PMINFO_R_ERROR;
+
+ *installed_time = atoi(info->app_info->package_installed_time);
+
+ return PMINFO_R_OK;
+}
+
API int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access)
{
retvm_if(providerid == NULL, PMINFO_R_EINVAL, "Argument supplied is NULL\n");
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)
{
return PMINFO_R_OK;
}
+API int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle,
+ bool *removable)
+{
+ pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+ if (info == NULL || info->app_info == NULL || removable == NULL) {
+ _LOGE("invalid parameter");
+ return PMINFO_R_EINVAL;
+ }
+
+ *removable = _get_bool_value(info->app_info->removable);
+
+ return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
+{
+ pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+
+ if (info == NULL || info->app_info == NULL || system == NULL) {
+ _LOGE("invalid parameter");
+ return PMINFO_R_EINVAL;
+ }
+
+ *system = _get_bool_value(info->app_info->package_system);
+
+ 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");
static gint __compare_func(gconstpointer data1, gconstpointer data2)
{
- pkgmgrinfo_node_x *node1 = (pkgmgrinfo_node_x*)data1;
- pkgmgrinfo_node_x *node2 = (pkgmgrinfo_node_x*)data2;
+ pkgmgrinfo_node_x *node1 = (pkgmgrinfo_node_x *)data1;
+ pkgmgrinfo_node_x *node2 = (pkgmgrinfo_node_x *)data2;
if (node1->prop == node2->prop)
return 0;
else if (node1->prop > node2->prop)
_LOGE("Invalid Integer Property\n");
return PMINFO_R_EINVAL;
}
- pkgmgrinfo_filter_x *filter = (pkgmgrinfo_filter_x*)handle;
- pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x*)calloc(1, sizeof(pkgmgrinfo_node_x));
+ pkgmgrinfo_filter_x *filter = (pkgmgrinfo_filter_x *)handle;
+ pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x *)calloc(1, sizeof(pkgmgrinfo_node_x));
if (node == NULL) {
_LOGE("Out of Memory!!!\n");
return PMINFO_R_ERROR;
_LOGE("Invalid Boolean Property\n");
return PMINFO_R_EINVAL;
}
- pkgmgrinfo_filter_x *filter = (pkgmgrinfo_filter_x*)handle;
- pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x*)calloc(1, sizeof(pkgmgrinfo_node_x));
+ pkgmgrinfo_filter_x *filter = (pkgmgrinfo_filter_x *)handle;
+ pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x *)calloc(1, sizeof(pkgmgrinfo_node_x));
if (node == NULL) {
_LOGE("Out of Memory!!!\n");
return PMINFO_R_ERROR;
_LOGE("Invalid String Property\n");
return PMINFO_R_EINVAL;
}
- pkgmgrinfo_filter_x *filter = (pkgmgrinfo_filter_x*)handle;
- pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x*)calloc(1, sizeof(pkgmgrinfo_node_x));
+ pkgmgrinfo_filter_x *filter = (pkgmgrinfo_filter_x *)handle;
+ pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x *)calloc(1, sizeof(pkgmgrinfo_node_x));
if (node == NULL) {
_LOGE("Out of Memory!!!\n");
return PMINFO_R_ERROR;
}
API int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
- pkgmgrinfo_app_list_cb app_cb, void * user_data)
+ pkgmgrinfo_app_list_cb app_cb, void *user_data)
{
return pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(handle, app_cb, user_data, _getuid());
}