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
#include <bundle.h>
+#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
* @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:
* @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:
*/
int appsvc_is_defapp(const char *appid, uid_t uid);
-
/**
* @par Description:
* This API ask a extra data is array or not.
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;
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;
__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");
__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");