Replace ail_filter_list_appinfo_foreach by ail_filter_list_usr_appinfo_foreach, this permits to apply the filter on all user applications not only the Global/Common ones.
Change-Id: I0d8b9b695364d54b239bae33c5b279be5033726a
Signed-off-by: Baptiste DURAND <baptiste.durand@open.eurogiciel.org>
void *data, uid_t uid)
{
CicoSCLifeCycleController* x = (CicoSCLifeCycleController*)data;
- return CSCLCCail_list_appinfo_cbX(appinfo, x);
+ return CSCLCCail_list_appinfo_cbX(appinfo, x, uid);
}
/**
*
*/
ail_cb_ret_e CSCLCCail_list_appinfo_cbX(const ail_appinfo_h appinfo,
- CicoSCLifeCycleController* x)
+ CicoSCLifeCycleController* x, uid_t uid)
{
ICO_TRA("start");
if ((NULL == x) || (0 == x)) {
char *exe;
bool bndsp = false;
/* get package name for appid */
- ail_appinfo_get_str(appinfo, AIL_PROP_PACKAGE_STR, &pkg);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_PACKAGE_STR, uid, &pkg);
if (strcmp(pkg, APP_CONF_AIL_NULL_STR) == 0) {
pkg = NULL;
}
/* get icon path */
- ail_appinfo_get_str(appinfo, AIL_PROP_ICON_STR, &icn);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_ICON_STR, uid, &icn);
if (strcmp(icn, APP_CONF_AIL_NULL_STR) == 0) {
icn = NULL;
}
}
}
/* get name */
- ail_appinfo_get_str(appinfo, AIL_PROP_NAME_STR, &nm);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_NAME_STR, uid, &nm);
if (strcmp(nm, APP_CONF_AIL_NULL_STR) == 0) {
nm = NULL;
}
/* get category */
- ail_appinfo_get_str(appinfo, AIL_PROP_CATEGORIES_STR, &ctgry);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_CATEGORIES_STR, uid, &ctgry);
if (strcmp(ctgry, APP_CONF_AIL_NULL_STR) == 0) {
ctgry = NULL;
}
/* get type */
- ail_appinfo_get_str(appinfo, AIL_PROP_TYPE_STR, &typ);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_TYPE_STR, uid, &typ);
if (strcmp(typ, APP_CONF_AIL_NULL_STR) == 0) {
typ = NULL;
}
/* get exec */
- ail_appinfo_get_str(appinfo, AIL_PROP_EXEC_STR, &exe);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_EXEC_STR, uid, &exe);
if (strcmp(exe, APP_CONF_AIL_NULL_STR) == 0) {
exe = NULL;
}
g_string_free(gsfp, TRUE);
}
int r;
+ uid_t uid = getuid();
ail_filter_h fil;
ail_filter_new(&fil);
r = ail_filter_add_str(fil, AIL_PROP_TYPE_STR, DAilTypeFilPrm_Menu);
- r = ail_filter_list_appinfo_foreach(fil, CSCLCCail_list_appinfo_cb,
- (void*)this);
+ r = ail_filter_list_usr_appinfo_foreach(fil, CSCLCCail_list_appinfo_cb,
+ (void*)this, uid);
ail_filter_destroy(fil);
if (r != AIL_ERROR_OK) {
if (m_gconf) {
ail_filter_new(&fil);
r = ail_filter_add_str(fil, AIL_PROP_TYPE_STR, DAilTypeFilPrm_App);
- r = ail_filter_list_appinfo_foreach(fil, CSCLCCail_list_appinfo_cb,
- (void*)this);
+ r = ail_filter_list_usr_appinfo_foreach(fil, CSCLCCail_list_appinfo_cb,
+ (void*)this, uid);
ail_filter_destroy(fil);
if (r != AIL_ERROR_OK) {
if (m_gconf) {
protected:
void initAIL();
friend ail_cb_ret_e CSCLCCail_list_appinfo_cbX(const ail_appinfo_h appinfo,
- CicoSCLifeCycleController* x);
+ CicoSCLifeCycleController* x, uid_t uid);
bool createAilItems();
friend
void *data, uid_t uid)
{
CicoHSLifeCycleController* x = (CicoHSLifeCycleController*)data;
- return CSCLCCail_list_appinfo_cbX(appinfo, x);
+ return CSCLCCail_list_appinfo_cbX(appinfo, x, uid);
}
/**
*
*/
ail_cb_ret_e CSCLCCail_list_appinfo_cbX(const ail_appinfo_h appinfo,
- CicoHSLifeCycleController* x)
+ CicoHSLifeCycleController* x, uid_t uid)
{
ICO_TRA("start");
if ((NULL == x) || (0 == x)) {
char *exe;
bool bndsp = false;
/* get package name for appid */
- ail_appinfo_get_str(appinfo, AIL_PROP_PACKAGE_STR, &pkg);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_PACKAGE_STR, uid, &pkg);
if (strcmp(pkg, APP_CONF_AIL_NULL_STR) == 0) {
pkg = NULL;
}
/* get icon path */
- ail_appinfo_get_str(appinfo, AIL_PROP_ICON_STR, &icn);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_ICON_STR, uid, &icn);
if (strcmp(icn, APP_CONF_AIL_NULL_STR) == 0) {
icn = NULL;
}
}
}
/* get name */
- ail_appinfo_get_str(appinfo, AIL_PROP_NAME_STR, &nm);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_NAME_STR, uid, &nm);
if (strcmp(nm, APP_CONF_AIL_NULL_STR) == 0) {
nm = NULL;
}
/* get category */
- ail_appinfo_get_str(appinfo, AIL_PROP_CATEGORIES_STR, &ctgry);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_CATEGORIES_STR, uid, &ctgry);
if (strcmp(ctgry, APP_CONF_AIL_NULL_STR) == 0) {
ctgry = NULL;
}
/* get type */
- ail_appinfo_get_str(appinfo, AIL_PROP_TYPE_STR, &typ);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_TYPE_STR, uid, &typ);
if (strcmp(typ, APP_CONF_AIL_NULL_STR) == 0) {
typ = NULL;
}
/* get exec */
- ail_appinfo_get_str(appinfo, AIL_PROP_EXEC_STR, &exe);
+ ail_appinfo_get_usr_str(appinfo, AIL_PROP_EXEC_STR, uid, &exe);
if (strcmp(exe, APP_CONF_AIL_NULL_STR) == 0) {
exe = NULL;
}
}
int r;
+ uid_t uid = getuid();
ail_filter_h fil;
ail_filter_new(&fil);
r = ail_filter_add_str(fil, AIL_PROP_TYPE_STR, DAilTypeFilPrm_Menu);
- r = ail_filter_list_appinfo_foreach(fil, CSCLCCail_list_appinfo_cb,
- (void*)this);
+ r = ail_filter_list_usr_appinfo_foreach(fil, CSCLCCail_list_appinfo_cb,
+ (void*)this, uid);
ail_filter_destroy(fil);
if (r != AIL_ERROR_OK) {
if (m_gconf) {
ail_filter_new(&fil);
r = ail_filter_add_str(fil, AIL_PROP_TYPE_STR, DAilTypeFilPrm_App);
- r = ail_filter_list_appinfo_foreach(fil, CSCLCCail_list_appinfo_cb,
- (void*)this);
+ r = ail_filter_list_usr_appinfo_foreach(fil, CSCLCCail_list_appinfo_cb,
+ (void*)this, uid);
ail_filter_destroy(fil);
if (r != AIL_ERROR_OK) {
if (m_gconf) {
protected:
void initAIL();
friend ail_cb_ret_e CSCLCCail_list_appinfo_cbX(const ail_appinfo_h appinfo,
- CicoHSLifeCycleController* x);
+ CicoHSLifeCycleController* x, uid_t uid);
bool createAilItems();
friend