diff options
author | Sabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org> | 2015-01-09 11:31:09 +0100 |
---|---|---|
committer | Baptiste DURAND <baptiste.durand@open.eurogiciel.org> | 2015-01-09 05:27:10 -0800 |
commit | 859ec161b49125408a7c74cacc29e78ad27d9a3c (patch) | |
tree | f203dc67c16e9bb9a25f02837afe4df9543b488d | |
parent | f576bfea93240152921047444a9a9a271536e4ca (diff) | |
download | app-svc-tizen_3.0.2014.q4_common.tar.gz app-svc-tizen_3.0.2014.q4_common.tar.bz2 app-svc-tizen_3.0.2014.q4_common.zip |
add _usr_ prototypes : appsvc_usr_run_service, appsvc_usr_get_listtizen_3.0_ivi_releasesubmit/tizen_wearable/20150127.000000submit/tizen_wearable/20150116.000000submit/tizen_tv/20150228.021455submit/tizen_tv/20150227.073215submit/tizen_tv/20150130.050505submit/tizen_tv/20150130.000000submit/tizen_tv/20150120.000002submit/tizen_tv/20150120.000000submit/tizen_tv/20150119.000001submit/tizen_tv/20150119.000000submit/tizen_tv/20150116.000000submit/tizen_mobile/20150213.000000submit/tizen_mobile/20150129.000000submit/tizen_mobile/20150116.000003submit/tizen_mobile/20150116.000001submit/tizen_mobile/20150116.000000submit/tizen_ivi/20150115.222222submit/tizen_common/20150112.154626submit/tizen_common/20150112.103909submit/tizen_common/20150109.133122accepted/tizen/wearable/20150128.040605accepted/tizen/tv/20150302.010506accepted/tizen/ivi/20150115.062918accepted/tizen/common/20150113.085925tizen_3.0_ivitizen_3.0.2014.q4_common
using default user to allow app-svc API usage for deamon.
App-svc run service leads to app launch that could requires a graphical session
BUG-Tizen=TC-2222
Signed-off-by: Sabera Djelti (sdi2) <sabera.djelti@open.eurogiciel.org>
Change-Id: Id937789cd6c828745f1b2dbf19330e8602c759c1
-rwxr-xr-x | include/appsvc.h | 8 | ||||
-rw-r--r-- | src/appsvc.c | 20 | ||||
-rwxr-xr-x | test/appsvc_test.c | 4 |
3 files changed, 25 insertions, 7 deletions
diff --git a/include/appsvc.h b/include/appsvc.h index f31f249..35e04c4 100755 --- a/include/appsvc.h +++ b/include/appsvc.h @@ -47,6 +47,7 @@ #include <bundle.h> +#include <sys/types.h> #ifdef __cplusplus extern "C" { @@ -485,7 +486,8 @@ int appsvc_set_category(bundle *b, const char *category); * @endcode * */ -int appsvc_run_service(bundle *b, int request_code, appsvc_res_fn cbfunc, void *data, uid_t uid); +int appsvc_run_service(bundle *b, int request_code, appsvc_res_fn cbfunc, void *data); +int appsvc_usr_run_service(bundle *b, int request_code, appsvc_res_fn cbfunc, void *data, uid_t uid); /** * @par Description: @@ -532,7 +534,8 @@ static int iter_fn(const char* pkg_name, void *data) * @endcode * */ -int appsvc_get_list(bundle *b, appsvc_info_iter_fn iter_fn, void *data, uid_t uid); +int appsvc_get_list(bundle *b, appsvc_info_iter_fn iter_fn, void *data); +int appsvc_usr_get_list(bundle *b, appsvc_info_iter_fn iter_fn, void *data, uid_t uid); /** * @par Description: @@ -919,7 +922,6 @@ int appsvc_unset_defapp(const char *defapp, uid_t uid); */ int appsvc_is_defapp(const char *appid, uid_t uid); - /** * @par Description: * This API ask a extra data is array or not. diff --git a/src/appsvc.c b/src/appsvc.c index ff70bfc..f6d6766 100644 --- a/src/appsvc.c +++ b/src/appsvc.c @@ -664,7 +664,15 @@ static int __get_list_with_submode(char *win_id, GSList **pkg_list) return 0; } -SLPAPI int appsvc_run_service(bundle *b, int request_code, appsvc_res_fn cbfunc, void *data, uid_t uid) +SLPAPI int appsvc_run_service(bundle *b, int request_code, appsvc_res_fn cbfunc, void *data) +{ + //using default user to allow app-svc API usage for deamon. + //App-svc run service leads to app launch that could require a graphical session. + //Indeed bluetooth_agent uses this API and is launched as bluetooth user (that not regular user). + return appsvc_usr_run_service(b, request_code, cbfunc, data, tzplatform_getuid(TZ_SYS_DEFAULT_USER)); +} + +SLPAPI int appsvc_usr_run_service(bundle *b, int request_code, appsvc_res_fn cbfunc, void *data, uid_t uid) { appsvc_resolve_info_t info; char *pkgname; @@ -846,7 +854,15 @@ end: return ret; } -SLPAPI int appsvc_get_list(bundle *b, appsvc_info_iter_fn iter_fn, void *data, uid_t uid) + +SLPAPI int appsvc_get_list(bundle *b, appsvc_info_iter_fn iter_fn, void *data) +{ + //using default user to allow app-svc API usage for deamon. + //App-svc run get list leads to app launch that could require a graphical session. + return appsvc_usr_get_list(b, iter_fn, data, tzplatform_getuid(TZ_SYS_DEFAULT_USER)); +} + +SLPAPI int appsvc_usr_get_list(bundle *b, appsvc_info_iter_fn iter_fn, void *data, uid_t uid) { appsvc_resolve_info_t info; char *pkgname = NULL; diff --git a/test/appsvc_test.c b/test/appsvc_test.c index d3c4965..cb4a62f 100755 --- a/test/appsvc_test.c +++ b/test/appsvc_test.c @@ -131,7 +131,7 @@ int run_svc() __set_bundle_from_args(kb); - ret = appsvc_run_service(kb,0,NULL, NULL, getuid()); + ret = appsvc_usr_run_service(kb,0,NULL, NULL, getuid()); if(ret >= 0){ printf("open service success\n"); @@ -218,7 +218,7 @@ int run_svc_res() __set_bundle_from_args(kb); - ret = appsvc_run_service(kb, 0, cb_func, (void*)num, getuid()); + ret = appsvc_usr_run_service(kb, 0, cb_func, (void*)num, getuid()); if(ret >= 0){ printf("open service success\n"); |