From 150569ef5bac37f1b811d55e83f1751b0be7f610 Mon Sep 17 00:00:00 2001 From: junkyu Han Date: Tue, 5 Apr 2016 13:47:44 +0900 Subject: [PATCH] Add License to spec & change pkgmgrinfo for multiuser Change-Id: Ia78604c5258c5d76055a3d61f750bc12b1082698 --- packaging/org.tizen.menu-screen.spec | 2 ++ src/all_apps/list.c | 6 +++--- src/item.c | 1 + src/list.c | 4 ++-- src/menu_screen.c | 2 +- src/pkgmgr.c | 10 +++++----- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packaging/org.tizen.menu-screen.spec b/packaging/org.tizen.menu-screen.spec index ec8c3e0..2afb349 100644 --- a/packaging/org.tizen.menu-screen.spec +++ b/packaging/org.tizen.menu-screen.spec @@ -111,6 +111,7 @@ make %{?jobs:-j%jobs} %define tizen_dist_sign 1 mkdir -p %{buildroot}/usr/share/license +cp -f LICENSE %{buildroot}/usr/share/license/%{_package_name} %post @@ -129,3 +130,4 @@ INHOUSE_ID="5000" %{TZ_SYS_RO_APP}/org.tizen.menu-screen/shared/res/org.tizen.menu-screen.png #%{TZ_SYS_RO_PACKAGES}/org.tizen.menu-screen.xml /usr/share/packages/org.tizen.menu-screen.xml +/usr/share/license/%{_package_name} diff --git a/src/all_apps/list.c b/src/all_apps/list.c index 08476e8..8597ee5 100644 --- a/src/all_apps/list.c +++ b/src/all_apps/list.c @@ -39,13 +39,13 @@ HAPI int all_apps_list_find_installed_time(const char *id) int ret = 0; int installed_time = 0; - goto_if(0> pkgmgrinfo_appinfo_get_appinfo(id, &appinfo_h), ERROR); + goto_if(0> pkgmgrinfo_appinfo_get_usr_appinfo(id, getuid(), &appinfo_h), ERROR); char *pkgid = NULL; goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_pkgid(appinfo_h, &pkgid), ERROR); goto_if (NULL == pkgid, ERROR); - goto_if (0>pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle), ERROR); + goto_if (0>pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, getuid(), &handle), ERROR); ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time); goto_if (ret != PMINFO_R_OK, ERROR); @@ -207,7 +207,7 @@ HAPI app_list *all_apps_list_create(void) return NULL; } goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_NODISPLAY, 0), ERROR); - goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, _all_apps_cb, list), ERROR); + goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(handle, _all_apps_cb, list, getuid()), ERROR); pkgmgrinfo_appinfo_filter_destroy(handle); diff --git a/src/item.c b/src/item.c index 09448a4..7446aa8 100644 --- a/src/item.c +++ b/src/item.c @@ -718,6 +718,7 @@ static void _uninstall_focus_clicked_cb(void *data, Evas_Object *obj, void *even HAPI Evas_Object *item_create(Evas_Object *scroller, app_info_t* ai) { + _D("item create : %s", ai->package); Evas_Object *item; Evas_Object *bg; diff --git a/src/list.c b/src/list.c index 59457a0..d7a102e 100644 --- a/src/list.c +++ b/src/list.c @@ -115,7 +115,7 @@ HAPI menu_screen_error_e list_get_values(const char *package, app_info_t *ai) retv_if(NULL == ai, MENU_SCREEN_ERROR_FAIL); retv_if(NULL == (ai->package = strdup(package)), MENU_SCREEN_ERROR_FAIL); - goto_if(0 > pkgmgrinfo_appinfo_get_appinfo(ai->package, &appinfo_h), ERROR); + goto_if(0 > pkgmgrinfo_appinfo_get_usr_appinfo(ai->package, getuid(), &appinfo_h), ERROR); goto_if(PMINFO_R_OK != pkgmgrinfo_appinfo_get_pkgid(appinfo_h, &pkgid), ERROR); _D("pkgmgrinfo pkgid : %s", pkgid); @@ -133,7 +133,7 @@ HAPI menu_screen_error_e list_get_values(const char *package, app_info_t *ai) goto_if(NULL == pkgid || NULL == (ai->pkgid = strdup(pkgid)), ERROR); goto_if(NULL == name || NULL == (ai->name = strdup(name)), ERROR); goto_if(NULL == icon || NULL == (ai->icon = strdup(icon)), ERROR); - goto_if(0 > pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &pkghandle) || !pkghandle, ERROR); + goto_if(0 > pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, getuid(), &pkghandle) || !pkghandle, ERROR); } while (0); goto_if(PMINFO_R_OK != pkgmgrinfo_pkginfo_is_removable(pkghandle, &ai->removable), ERROR); diff --git a/src/menu_screen.c b/src/menu_screen.c index 6da58bd..a6a6534 100755 --- a/src/menu_screen.c +++ b/src/menu_screen.c @@ -619,7 +619,7 @@ static void _language_changed_cb(app_event_info_h event_info, void *data) item = page_get_item_at(page, j); if (!item) continue; - if (pkgmgrinfo_appinfo_get_appinfo(item_get_package(item), &appinfo_h) < 0) { + if (pkgmgrinfo_appinfo_get_usr_appinfo(item_get_package(item), getuid(), &appinfo_h) < 0) { pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h); continue; } diff --git a/src/pkgmgr.c b/src/pkgmgr.c index aaafe49..d32ca41 100644 --- a/src/pkgmgr.c +++ b/src/pkgmgr.c @@ -302,7 +302,7 @@ HAPI inline menu_screen_error_e pkgmgr_uninstall(Evas_Object *item) req_pc = pkgmgr_client_new(PC_REQUEST); retv_if(NULL == req_pc, MENU_SCREEN_ERROR_FAIL); - if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_appinfo(appid, &handle)) { + if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_usr_appinfo(appid, getuid(), &handle)) { if (PKGMGR_R_OK != pkgmgr_client_free(req_pc)) { _E("cannot free pkgmgr_client for request."); } @@ -528,10 +528,10 @@ static menu_screen_error_e _end(const char *package, const char *val, void *data goto OUT; } - goto_if(PMINFO_R_OK != pkgmgrinfo_pkginfo_get_pkginfo(package, &handle), ERROR); + goto_if(PMINFO_R_OK != pkgmgrinfo_pkginfo_get_usr_pkginfo(package, getuid(), &handle), ERROR); /* Criteria : appid */ - if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, _end_cb, rt)) { + if (PMINFO_R_OK != pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_UI_APP, _end_cb, rt, getuid())) { goto ERROR; } @@ -573,7 +573,7 @@ static struct pkgmgr_handler pkgmgr_cbs[] = { -static menu_screen_error_e _pkgmgr_cb(int req_id, const char *pkg_type, const char *package, const char *key, const char *val, const void *pmsg, void *data) +static menu_screen_error_e _pkgmgr_cb(uid_t target_uid, int req_id, const char *pkg_type, const char *package, const char *key, const char *val, const void *pmsg, void *data) { register unsigned int i; @@ -649,7 +649,7 @@ HAPI menu_screen_error_e pkgmgr_reserve_list_pop_request(void) if (!pr) return MENU_SCREEN_ERROR_NO_DATA; pkg_mgr_info.reserve_list = eina_list_remove(pkg_mgr_info.reserve_list, pr); - goto_if(MENU_SCREEN_ERROR_OK != _pkgmgr_cb(0, NULL, pr->package, pr->key, pr->val, NULL, NULL), ERROR); + goto_if(MENU_SCREEN_ERROR_OK != _pkgmgr_cb(getuid(), 0, NULL, pr->package, pr->key, pr->val, NULL, NULL), ERROR); if (pr->package) free(pr->package); if (pr->key) free(pr->key); -- 2.7.4