* limitations under the License.
*/
-
-#include <package_manager.h>
#include <stdlib.h>
#include "pkgmgr-setting-info.h"
+#include <app_info.h>
+#include <app_manager.h>
int apps_sort_cb(const void *d1, const void *d2)
{
HAPI char *get_app_icon(const char *appid)
{
char *icon_path = NULL;
- char *package_id = NULL;
- package_manager_get_package_id_by_app_id(appid, &package_id);
- if (package_id) {
-
- package_info_h package_info = NULL;
- package_manager_get_package_info(package_id, &package_info);
- if (!package_info)
- return NULL;
-
- package_info_get_icon(package_info, &icon_path);
- package_info_destroy(package_info);
+ app_info_h app_info;
+ int error_code = app_info_create(appid, &app_info);
+ if (error_code == APP_MANAGER_ERROR_NONE) {
+ error_code = app_info_get_icon(app_info, &icon_path);
+ if (error_code != APP_MANAGER_ERROR_NONE) {
+ NOTISET_ERR("app_info_get_icon() failed with error-code %d", error_code);
+ }
+ app_info_destroy(app_info);
+ } else {
+ NOTISET_ERR("app_info_create() failed with error-code %d", error_code);
}
- free(package_id);
return icon_path;
}
-
HAPI char *get_app_name(const char *appid)
{
char *name = NULL;
- char *package_id = NULL;
- package_manager_get_package_id_by_app_id(appid, &package_id);
- if (package_id) {
-
- package_info_h package_info = NULL;
- package_manager_get_package_info(package_id, &package_info);
- if (!package_info)
- return NULL;
-
- package_info_get_label(package_info, &name);
- package_info_destroy(package_info);
+ app_info_h app_info;
+ int error_code = app_info_create(appid, &app_info);
+ if (error_code == APP_MANAGER_ERROR_NONE) {
+ error_code = app_info_get_label(app_info, &name);
+ if (error_code != APP_MANAGER_ERROR_NONE) {
+ NOTISET_ERR("app_info_get_label() failed with error-code %d", error_code);
+ }
+ app_info_destroy(app_info);
+ } else {
+ NOTISET_ERR("app_info_create() failed with error-code %d", error_code);
}
- free(package_id);
return name;
}