package_manager_event_type_e event_type, package_manager_event_state_e event_state, int progress,
package_manager_error_e error, void *user_data);
static bool __apps_data_pkg_get_apps_info(app_info_h app_handle, app_data_t **item);
+static bool __apps_data_get_app_info_from_pkg(package_info_app_component_type_e comp_type, const char *app_id, void *data);
static bool __apps_package_manager_get_item(app_info_h app_handle, void *data);
static void __apps_package_manager_install(const char *package);
static void __apps_package_manager_uninstall(const char *package);
}
}
-Eina_Bool apps_package_manger_get_list(Eina_List **list)
+Eina_Bool apps_package_manager_get_list(Eina_List **list)
{
int ret;
app_info_filter_h handle = NULL;
}
}
-static void __apps_package_manager_install(const char *package)
+static bool __apps_data_get_app_info_from_pkg(package_info_app_component_type_e comp_type, const char *app_id, void *data)
{
+ int ret = PACKAGE_MANAGER_ERROR_NONE;
app_info_h app_info = NULL;
app_data_t *item = NULL;
- app_manager_get_app_info(package, &app_info);
+ ret = app_manager_get_app_info(app_id, &app_info);
+ if (APP_MANAGER_ERROR_NONE != ret) {
+ LOGE("Failed to get app_info, return: [%d]", ret);
+ return false;
+ }
+
if (__apps_data_pkg_get_apps_info(app_info, &item)) {
apps_data_install(item);
}
app_info_destroy(app_info);
+ return true;
+}
+
+static void __apps_package_manager_install(const char *package)
+{
+ app_info_h app_info = NULL;
+ package_info_h package_info = NULL;
+ app_data_t *item = NULL;
+ int ret = PACKAGE_MANAGER_ERROR_NONE;
+
+ ret = package_info_create(package, &package_info);
+ if (PACKAGE_MANAGER_ERROR_NONE != ret) {
+ LOGE("Failed to create pakcage info for %s", package);
+ return;
+ }
+
+ ret = package_info_foreach_app_from_package(package_info, PACKAGE_INFO_ALLAPP, __apps_data_get_app_info_from_pkg, NULL);
+ if (PACKAGE_MANAGER_ERROR_NONE != ret) {
+ LOGE("Failed to install app from %s", package);
+ return;
+ }
+ package_info_destroy(package_info);
}
static void __apps_package_manager_uninstall(const char *package)