2 * Copyright (c) 2009 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <package_manager.h>
20 #include <pkgmgr-info.h>
21 #include "pkgmgr-setting-info.h"
23 int apps_sort_cb(const void *d1, const void *d2)
25 item_info_s *tmp1 = (item_info_s *) d1;
26 item_info_s *tmp2 = (item_info_s *) d2;
28 if (NULL == tmp1 || NULL == tmp1->name) return 1;
29 else if (NULL == tmp2 || NULL == tmp2->name) return -1;
31 return strcmp(tmp1->name, tmp2->name);
34 HAPI char *get_app_icon(char *appid)
36 pkgmgrinfo_appinfo_h appinfo_h = NULL;
40 // retv_if(0 > pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_h), NULL);
41 // goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_icon(appinfo_h, &tmp), ERROR);
43 pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_h);
44 pkgmgrinfo_appinfo_get_icon(appinfo_h, &tmp);
48 goto_if(NULL == name, ERROR);
51 pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
55 pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
61 HAPI char *get_app_name(const char *appid)
63 pkgmgrinfo_appinfo_h appinfo_h = NULL;
67 // retv_if(0 > pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_h), NULL);
68 // goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_label(appinfo_h, &tmp), ERROR);
70 pkgmgrinfo_appinfo_get_appinfo(appid, &appinfo_h);
71 pkgmgrinfo_appinfo_get_label(appinfo_h, &tmp);
75 goto_if(NULL == name, ERROR);
78 pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
82 pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);